@wordpress/block-library 8.30.0 → 8.31.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 (254) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/block/edit.js +17 -8
  3. package/build/block/edit.js.map +1 -1
  4. package/build/code/save.js +3 -1
  5. package/build/code/save.js.map +1 -1
  6. package/build/cover/edit/index.js +2 -1
  7. package/build/cover/edit/index.js.map +1 -1
  8. package/build/details/edit.js +1 -0
  9. package/build/details/edit.js.map +1 -1
  10. package/build/file/edit.js +2 -0
  11. package/build/file/edit.js.map +1 -1
  12. package/build/heading/index.js +4 -3
  13. package/build/heading/index.js.map +1 -1
  14. package/build/media-text/edit.js +33 -9
  15. package/build/media-text/edit.js.map +1 -1
  16. package/build/media-text/index.js +5 -0
  17. package/build/media-text/index.js.map +1 -1
  18. package/build/media-text/media-container.js +30 -11
  19. package/build/media-text/media-container.js.map +1 -1
  20. package/build/media-text/save.js +2 -2
  21. package/build/media-text/save.js.map +1 -1
  22. package/build/navigation/edit/index.js +23 -29
  23. package/build/navigation/edit/index.js.map +1 -1
  24. package/build/navigation/edit/navigation-menu-delete-control.js +12 -20
  25. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  26. package/build/navigation/edit/navigation-menu-selector.js +24 -23
  27. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  28. package/build/navigation/edit/placeholder/index.js +4 -4
  29. package/build/navigation/edit/placeholder/index.js.map +1 -1
  30. package/build/navigation/use-navigation-menu.js +15 -12
  31. package/build/navigation/use-navigation-menu.js.map +1 -1
  32. package/build/navigation-link/edit.js +12 -10
  33. package/build/navigation-link/edit.js.map +1 -1
  34. package/build/navigation-submenu/edit.js +4 -0
  35. package/build/navigation-submenu/edit.js.map +1 -1
  36. package/build/post-author/edit.js +1 -0
  37. package/build/post-author/edit.js.map +1 -1
  38. package/build/post-excerpt/edit.js +1 -0
  39. package/build/post-excerpt/edit.js.map +1 -1
  40. package/build/post-featured-image/edit.js +4 -1
  41. package/build/post-featured-image/edit.js.map +1 -1
  42. package/build/post-featured-image/index.js +6 -0
  43. package/build/post-featured-image/index.js.map +1 -1
  44. package/build/post-navigation-link/edit.js +1 -0
  45. package/build/post-navigation-link/edit.js.map +1 -1
  46. package/build/post-terms/edit.js +2 -0
  47. package/build/post-terms/edit.js.map +1 -1
  48. package/build/quote/edit.js +2 -2
  49. package/build/quote/edit.js.map +1 -1
  50. package/build/read-more/edit.js +1 -0
  51. package/build/read-more/edit.js.map +1 -1
  52. package/build/search/edit.js +2 -0
  53. package/build/search/edit.js.map +1 -1
  54. package/build/search/edit.native.js +2 -2
  55. package/build/search/edit.native.js.map +1 -1
  56. package/build/social-link/edit.js +1 -1
  57. package/build/social-link/edit.js.map +1 -1
  58. package/build/social-link/icons/medium.js +1 -1
  59. package/build/social-link/icons/medium.js.map +1 -1
  60. package/build/social-link/icons/reddit.js +1 -1
  61. package/build/social-link/icons/reddit.js.map +1 -1
  62. package/build/table/deprecated.js +285 -175
  63. package/build/table/deprecated.js.map +1 -1
  64. package/build/table/index.js +1 -1
  65. package/build/template-part/edit/index.js +1 -1
  66. package/build/template-part/edit/index.js.map +1 -1
  67. package/build/video/edit.native.js +1 -1
  68. package/build/video/edit.native.js.map +1 -1
  69. package/build-module/block/edit.js +18 -9
  70. package/build-module/block/edit.js.map +1 -1
  71. package/build-module/code/save.js +3 -1
  72. package/build-module/code/save.js.map +1 -1
  73. package/build-module/cover/edit/index.js +2 -1
  74. package/build-module/cover/edit/index.js.map +1 -1
  75. package/build-module/details/edit.js +1 -0
  76. package/build-module/details/edit.js.map +1 -1
  77. package/build-module/file/edit.js +2 -0
  78. package/build-module/file/edit.js.map +1 -1
  79. package/build-module/heading/index.js +4 -3
  80. package/build-module/heading/index.js.map +1 -1
  81. package/build-module/media-text/edit.js +34 -10
  82. package/build-module/media-text/edit.js.map +1 -1
  83. package/build-module/media-text/index.js +5 -0
  84. package/build-module/media-text/index.js.map +1 -1
  85. package/build-module/media-text/media-container.js +31 -12
  86. package/build-module/media-text/media-container.js.map +1 -1
  87. package/build-module/media-text/save.js +2 -2
  88. package/build-module/media-text/save.js.map +1 -1
  89. package/build-module/navigation/edit/index.js +24 -30
  90. package/build-module/navigation/edit/index.js.map +1 -1
  91. package/build-module/navigation/edit/navigation-menu-delete-control.js +15 -23
  92. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  93. package/build-module/navigation/edit/navigation-menu-selector.js +24 -23
  94. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  95. package/build-module/navigation/edit/placeholder/index.js +4 -4
  96. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  97. package/build-module/navigation/use-navigation-menu.js +15 -12
  98. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  99. package/build-module/navigation-link/edit.js +13 -11
  100. package/build-module/navigation-link/edit.js.map +1 -1
  101. package/build-module/navigation-submenu/edit.js +4 -0
  102. package/build-module/navigation-submenu/edit.js.map +1 -1
  103. package/build-module/post-author/edit.js +1 -0
  104. package/build-module/post-author/edit.js.map +1 -1
  105. package/build-module/post-excerpt/edit.js +1 -0
  106. package/build-module/post-excerpt/edit.js.map +1 -1
  107. package/build-module/post-featured-image/edit.js +5 -2
  108. package/build-module/post-featured-image/edit.js.map +1 -1
  109. package/build-module/post-featured-image/index.js +6 -0
  110. package/build-module/post-featured-image/index.js.map +1 -1
  111. package/build-module/post-navigation-link/edit.js +1 -0
  112. package/build-module/post-navigation-link/edit.js.map +1 -1
  113. package/build-module/post-terms/edit.js +2 -0
  114. package/build-module/post-terms/edit.js.map +1 -1
  115. package/build-module/quote/edit.js +2 -2
  116. package/build-module/quote/edit.js.map +1 -1
  117. package/build-module/read-more/edit.js +1 -0
  118. package/build-module/read-more/edit.js.map +1 -1
  119. package/build-module/search/edit.js +2 -0
  120. package/build-module/search/edit.js.map +1 -1
  121. package/build-module/search/edit.native.js +2 -2
  122. package/build-module/search/edit.native.js.map +1 -1
  123. package/build-module/social-link/edit.js +1 -1
  124. package/build-module/social-link/edit.js.map +1 -1
  125. package/build-module/social-link/icons/medium.js +1 -1
  126. package/build-module/social-link/icons/medium.js.map +1 -1
  127. package/build-module/social-link/icons/reddit.js +1 -1
  128. package/build-module/social-link/icons/reddit.js.map +1 -1
  129. package/build-module/table/deprecated.js +286 -176
  130. package/build-module/table/deprecated.js.map +1 -1
  131. package/build-module/table/index.js +1 -1
  132. package/build-module/template-part/edit/index.js +1 -1
  133. package/build-module/template-part/edit/index.js.map +1 -1
  134. package/build-module/video/edit.native.js +1 -1
  135. package/build-module/video/edit.native.js.map +1 -1
  136. package/build-style/editor-rtl.css +10 -4
  137. package/build-style/editor.css +10 -4
  138. package/build-style/file/editor-rtl.css +3 -0
  139. package/build-style/file/editor.css +3 -0
  140. package/build-style/image/editor-rtl.css +0 -3
  141. package/build-style/image/editor.css +0 -3
  142. package/build-style/media-text/editor-rtl.css +7 -1
  143. package/build-style/media-text/editor.css +7 -1
  144. package/build-style/social-links/style-rtl.css +2 -2
  145. package/build-style/social-links/style.css +2 -2
  146. package/build-style/style-rtl.css +2 -2
  147. package/build-style/style.css +2 -2
  148. package/package.json +34 -34
  149. package/src/archives/index.php +4 -0
  150. package/src/avatar/index.php +6 -0
  151. package/src/block/edit.js +38 -15
  152. package/src/block/index.php +4 -0
  153. package/src/block/test/edit.native.js +67 -0
  154. package/src/calendar/index.php +12 -0
  155. package/src/categories/index.php +6 -0
  156. package/src/code/save.js +7 -1
  157. package/src/comment-author-name/index.php +4 -0
  158. package/src/comment-content/index.php +4 -0
  159. package/src/comment-date/index.php +4 -0
  160. package/src/comment-edit-link/index.php +4 -0
  161. package/src/comment-reply-link/index.php +4 -0
  162. package/src/comment-template/index.php +4 -0
  163. package/src/comments/index.php +10 -0
  164. package/src/comments-pagination/index.php +4 -0
  165. package/src/comments-pagination-next/index.php +4 -0
  166. package/src/comments-pagination-numbers/index.php +4 -0
  167. package/src/comments-pagination-previous/index.php +4 -0
  168. package/src/comments-title/index.php +4 -0
  169. package/src/cover/edit/index.js +4 -1
  170. package/src/cover/index.php +4 -0
  171. package/src/details/edit.js +1 -0
  172. package/src/file/edit.js +2 -0
  173. package/src/file/editor.scss +3 -0
  174. package/src/file/index.php +4 -0
  175. package/src/gallery/index.php +6 -0
  176. package/src/heading/index.js +4 -3
  177. package/src/heading/index.php +4 -0
  178. package/src/home-link/index.php +10 -0
  179. package/src/image/editor.scss +0 -5
  180. package/src/image/index.php +12 -1
  181. package/src/latest-comments/index.php +4 -0
  182. package/src/latest-posts/index.php +8 -0
  183. package/src/loginout/index.php +4 -0
  184. package/src/media-text/block.json +5 -0
  185. package/src/media-text/edit.js +70 -19
  186. package/src/media-text/editor.scss +7 -1
  187. package/src/media-text/index.php +70 -0
  188. package/src/media-text/media-container.js +49 -9
  189. package/src/media-text/save.js +2 -2
  190. package/src/navigation/edit/index.js +67 -71
  191. package/src/navigation/edit/navigation-menu-delete-control.js +22 -49
  192. package/src/navigation/edit/navigation-menu-selector.js +39 -21
  193. package/src/navigation/edit/placeholder/index.js +4 -4
  194. package/src/navigation/edit/test/navigation-menu-selector.js +75 -53
  195. package/src/navigation/index.php +101 -26
  196. package/src/navigation/test/use-navigation-menu.js +21 -21
  197. package/src/navigation/use-navigation-menu.js +23 -9
  198. package/src/navigation-link/edit.js +12 -13
  199. package/src/navigation-link/index.php +14 -0
  200. package/src/navigation-submenu/edit.js +4 -0
  201. package/src/navigation-submenu/index.php +8 -0
  202. package/src/page-list/index.php +12 -0
  203. package/src/page-list-item/index.php +2 -0
  204. package/src/pattern/index.php +2 -0
  205. package/src/post-author/edit.js +1 -0
  206. package/src/post-author/index.php +4 -0
  207. package/src/post-author-biography/index.php +4 -0
  208. package/src/post-author-name/index.php +4 -0
  209. package/src/post-comments-form/index.php +6 -0
  210. package/src/post-content/index.php +4 -0
  211. package/src/post-date/index.php +4 -0
  212. package/src/post-excerpt/edit.js +1 -0
  213. package/src/post-excerpt/index.php +4 -0
  214. package/src/post-featured-image/block.json +6 -0
  215. package/src/post-featured-image/edit.js +4 -0
  216. package/src/post-featured-image/index.php +15 -0
  217. package/src/post-navigation-link/edit.js +1 -0
  218. package/src/post-navigation-link/index.php +4 -0
  219. package/src/post-template/index.php +4 -0
  220. package/src/post-terms/edit.js +2 -0
  221. package/src/post-terms/index.php +6 -0
  222. package/src/post-title/index.php +2 -0
  223. package/src/query/index.php +2 -0
  224. package/src/query-no-results/index.php +4 -0
  225. package/src/query-pagination/index.php +4 -0
  226. package/src/query-pagination-next/index.php +4 -0
  227. package/src/query-pagination-numbers/index.php +4 -0
  228. package/src/query-pagination-previous/index.php +4 -0
  229. package/src/query-title/index.php +4 -0
  230. package/src/quote/edit.js +11 -5
  231. package/src/read-more/edit.js +1 -0
  232. package/src/read-more/index.php +4 -0
  233. package/src/rss/index.php +4 -0
  234. package/src/search/edit.js +2 -0
  235. package/src/search/edit.native.js +2 -2
  236. package/src/search/index.php +19 -1
  237. package/src/shortcode/index.php +4 -0
  238. package/src/site-logo/index.php +20 -0
  239. package/src/site-tagline/index.php +4 -0
  240. package/src/site-title/index.php +4 -0
  241. package/src/social-link/edit.js +1 -1
  242. package/src/social-link/icons/medium.js +1 -1
  243. package/src/social-link/icons/reddit.js +1 -1
  244. package/src/social-link/index.php +22 -9
  245. package/src/social-link/socials-with-bg.scss +1 -1
  246. package/src/social-link/socials-without-bg.scss +1 -1
  247. package/src/table/block.json +1 -1
  248. package/src/table/deprecated.js +308 -175
  249. package/src/tag-cloud/index.php +4 -0
  250. package/src/template-part/edit/index.js +1 -1
  251. package/src/template-part/index.php +10 -0
  252. package/src/term-description/index.php +4 -0
  253. package/src/video/edit.native.js +2 -0
  254. package/tsconfig.json +1 -0
@@ -117,16 +117,16 @@ describe( 'useNavigationMenus', () => {
117
117
  navigationMenus: null,
118
118
  navigationMenu: undefined,
119
119
  canSwitchNavigationMenu: false,
120
- canUserCreateNavigationMenu: false,
120
+ canUserCreateNavigationMenus: false,
121
121
  canUserDeleteNavigationMenu: undefined,
122
122
  canUserUpdateNavigationMenu: undefined,
123
- hasResolvedCanUserCreateNavigationMenu: false,
123
+ hasResolvedCanUserCreateNavigationMenus: false,
124
124
  hasResolvedCanUserDeleteNavigationMenu: undefined,
125
125
  hasResolvedCanUserUpdateNavigationMenu: undefined,
126
126
  hasResolvedNavigationMenus: false,
127
127
  isNavigationMenuMissing: true,
128
128
  isNavigationMenuResolved: false,
129
- isResolvingCanUserCreateNavigationMenu: false,
129
+ isResolvingCanUserCreateNavigationMenus: false,
130
130
  isResolvingNavigationMenus: false,
131
131
  } );
132
132
  } );
@@ -139,16 +139,16 @@ describe( 'useNavigationMenus', () => {
139
139
  navigationMenus,
140
140
  navigationMenu: undefined,
141
141
  canSwitchNavigationMenu: true,
142
- canUserCreateNavigationMenu: true,
142
+ canUserCreateNavigationMenus: true,
143
143
  canUserDeleteNavigationMenu: undefined,
144
144
  canUserUpdateNavigationMenu: undefined,
145
- hasResolvedCanUserCreateNavigationMenu: true,
145
+ hasResolvedCanUserCreateNavigationMenus: true,
146
146
  hasResolvedCanUserDeleteNavigationMenu: undefined,
147
147
  hasResolvedCanUserUpdateNavigationMenu: undefined,
148
148
  hasResolvedNavigationMenus: true,
149
149
  isNavigationMenuMissing: true,
150
150
  isNavigationMenuResolved: false,
151
- isResolvingCanUserCreateNavigationMenu: false,
151
+ isResolvingCanUserCreateNavigationMenus: false,
152
152
  isResolvingNavigationMenus: false,
153
153
  } );
154
154
  } );
@@ -159,16 +159,16 @@ describe( 'useNavigationMenus', () => {
159
159
  navigationMenu: navigationMenu1,
160
160
  navigationMenus,
161
161
  canSwitchNavigationMenu: true,
162
- canUserCreateNavigationMenu: false,
162
+ canUserCreateNavigationMenus: false,
163
163
  canUserDeleteNavigationMenu: false,
164
164
  canUserUpdateNavigationMenu: false,
165
- hasResolvedCanUserCreateNavigationMenu: false,
165
+ hasResolvedCanUserCreateNavigationMenus: false,
166
166
  hasResolvedCanUserDeleteNavigationMenu: false,
167
167
  hasResolvedCanUserUpdateNavigationMenu: false,
168
168
  hasResolvedNavigationMenus: true,
169
169
  isNavigationMenuMissing: false,
170
170
  isNavigationMenuResolved: false,
171
- isResolvingCanUserCreateNavigationMenu: false,
171
+ isResolvingCanUserCreateNavigationMenus: false,
172
172
  isResolvingNavigationMenus: false,
173
173
  } );
174
174
  } );
@@ -181,16 +181,16 @@ describe( 'useNavigationMenus', () => {
181
181
  navigationMenu: navigationMenuDraft,
182
182
  navigationMenus: testMenus,
183
183
  canSwitchNavigationMenu: true,
184
- canUserCreateNavigationMenu: false,
184
+ canUserCreateNavigationMenus: false,
185
185
  canUserDeleteNavigationMenu: false,
186
186
  canUserUpdateNavigationMenu: false,
187
- hasResolvedCanUserCreateNavigationMenu: false,
187
+ hasResolvedCanUserCreateNavigationMenus: false,
188
188
  hasResolvedCanUserDeleteNavigationMenu: false,
189
189
  hasResolvedCanUserUpdateNavigationMenu: false,
190
190
  hasResolvedNavigationMenus: true,
191
191
  isNavigationMenuMissing: false,
192
192
  isNavigationMenuResolved: false,
193
- isResolvingCanUserCreateNavigationMenu: false,
193
+ isResolvingCanUserCreateNavigationMenus: false,
194
194
  isResolvingNavigationMenus: false,
195
195
  } );
196
196
  } );
@@ -205,16 +205,16 @@ describe( 'useNavigationMenus', () => {
205
205
  navigationMenu: navigationMenu1,
206
206
  navigationMenus,
207
207
  canSwitchNavigationMenu: true,
208
- canUserCreateNavigationMenu: true,
208
+ canUserCreateNavigationMenus: true,
209
209
  canUserDeleteNavigationMenu: false,
210
210
  canUserUpdateNavigationMenu: true,
211
- hasResolvedCanUserCreateNavigationMenu: true,
211
+ hasResolvedCanUserCreateNavigationMenus: true,
212
212
  hasResolvedCanUserDeleteNavigationMenu: true,
213
213
  hasResolvedCanUserUpdateNavigationMenu: true,
214
214
  hasResolvedNavigationMenus: true,
215
215
  isNavigationMenuMissing: false,
216
216
  isNavigationMenuResolved: false,
217
- isResolvingCanUserCreateNavigationMenu: false,
217
+ isResolvingCanUserCreateNavigationMenus: false,
218
218
  isResolvingNavigationMenus: false,
219
219
  } );
220
220
  } );
@@ -229,16 +229,16 @@ describe( 'useNavigationMenus', () => {
229
229
  navigationMenu: navigationMenu1,
230
230
  navigationMenus,
231
231
  canSwitchNavigationMenu: true,
232
- canUserCreateNavigationMenu: false,
232
+ canUserCreateNavigationMenus: false,
233
233
  canUserDeleteNavigationMenu: true,
234
234
  canUserUpdateNavigationMenu: false,
235
- hasResolvedCanUserCreateNavigationMenu: true,
235
+ hasResolvedCanUserCreateNavigationMenus: true,
236
236
  hasResolvedCanUserDeleteNavigationMenu: true,
237
237
  hasResolvedCanUserUpdateNavigationMenu: true,
238
238
  hasResolvedNavigationMenus: true,
239
239
  isNavigationMenuMissing: false,
240
240
  isNavigationMenuResolved: false,
241
- isResolvingCanUserCreateNavigationMenu: false,
241
+ isResolvingCanUserCreateNavigationMenus: false,
242
242
  isResolvingNavigationMenus: false,
243
243
  } );
244
244
  } );
@@ -254,16 +254,16 @@ describe( 'useNavigationMenus', () => {
254
254
  navigationMenu: requestedMenu,
255
255
  navigationMenus,
256
256
  canSwitchNavigationMenu: true,
257
- canUserCreateNavigationMenu: false,
257
+ canUserCreateNavigationMenus: false,
258
258
  canUserDeleteNavigationMenu: false,
259
259
  canUserUpdateNavigationMenu: false,
260
- hasResolvedCanUserCreateNavigationMenu: false,
260
+ hasResolvedCanUserCreateNavigationMenus: false,
261
261
  hasResolvedCanUserDeleteNavigationMenu: false,
262
262
  hasResolvedCanUserUpdateNavigationMenu: false,
263
263
  hasResolvedNavigationMenus: true,
264
264
  isNavigationMenuMissing: false,
265
265
  isNavigationMenuResolved: false,
266
- isResolvingCanUserCreateNavigationMenu: false,
266
+ isResolvingCanUserCreateNavigationMenus: false,
267
267
  isResolvingNavigationMenus: false,
268
268
  } );
269
269
  } );
@@ -27,8 +27,18 @@ export default function useNavigationMenu( ref ) {
27
27
  [ ref ]
28
28
  );
29
29
 
30
- const { canCreate, canUpdate, canDelete, isResolving, hasResolved } =
31
- permissions;
30
+ const {
31
+ // Can the user create navigation menus?
32
+ canCreate: canCreateNavigationMenus,
33
+
34
+ // Can the user update the specific navigation menu with the given post ID?
35
+ canUpdate: canUpdateNavigationMenu,
36
+
37
+ // Can the user delete the specific navigation menu with the given post ID?
38
+ canDelete: canDeleteNavigationMenu,
39
+ isResolving: isResolvingPermissions,
40
+ hasResolved: hasResolvedPermissions,
41
+ } = permissions;
32
42
 
33
43
  const {
34
44
  records: navigationMenus,
@@ -52,13 +62,17 @@ export default function useNavigationMenu( ref ) {
52
62
  isResolvingNavigationMenus,
53
63
  hasResolvedNavigationMenus,
54
64
  canSwitchNavigationMenu,
55
- canUserCreateNavigationMenu: canCreate,
56
- isResolvingCanUserCreateNavigationMenu: isResolving,
57
- hasResolvedCanUserCreateNavigationMenu: hasResolved,
58
- canUserUpdateNavigationMenu: canUpdate,
59
- hasResolvedCanUserUpdateNavigationMenu: ref ? hasResolved : undefined,
60
- canUserDeleteNavigationMenu: canDelete,
61
- hasResolvedCanUserDeleteNavigationMenu: ref ? hasResolved : undefined,
65
+ canUserCreateNavigationMenus: canCreateNavigationMenus,
66
+ isResolvingCanUserCreateNavigationMenus: isResolvingPermissions,
67
+ hasResolvedCanUserCreateNavigationMenus: hasResolvedPermissions,
68
+ canUserUpdateNavigationMenu: canUpdateNavigationMenu,
69
+ hasResolvedCanUserUpdateNavigationMenu: ref
70
+ ? hasResolvedPermissions
71
+ : undefined,
72
+ canUserDeleteNavigationMenu: canDeleteNavigationMenu,
73
+ hasResolvedCanUserDeleteNavigationMenu: ref
74
+ ? hasResolvedPermissions
75
+ : undefined,
62
76
  };
63
77
  }
64
78
 
@@ -16,7 +16,7 @@ import {
16
16
  Tooltip,
17
17
  ToolbarGroup,
18
18
  } from '@wordpress/components';
19
- import { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';
19
+ import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
20
20
  import { __ } from '@wordpress/i18n';
21
21
  import {
22
22
  BlockControls,
@@ -220,7 +220,7 @@ export default function NavigationLinkEdit( {
220
220
  hasChildren: !! getBlockCount( clientId ),
221
221
  };
222
222
  },
223
- [ clientId ]
223
+ [ clientId, maxNestingLevel ]
224
224
  );
225
225
 
226
226
  /**
@@ -282,7 +282,7 @@ export default function NavigationLinkEdit( {
282
282
  placeCaretAtHorizontalEdge( ref.current, true );
283
283
  }
284
284
  }
285
- }, [ url ] );
285
+ }, [ url, isLinkOpen, label ] );
286
286
 
287
287
  /**
288
288
  * Focus the Link label text and select it.
@@ -329,10 +329,11 @@ export default function NavigationLinkEdit( {
329
329
  } = getColors( context, ! isTopLevelLink );
330
330
 
331
331
  function onKeyDown( event ) {
332
- if (
333
- isKeyboardEvent.primary( event, 'k' ) ||
334
- ( ( ! url || isDraft || isInvalid ) && event.keyCode === ENTER )
335
- ) {
332
+ if ( isKeyboardEvent.primary( event, 'k' ) ) {
333
+ // Required to prevent the command center from opening,
334
+ // as it shares the CMD+K shortcut.
335
+ // See https://github.com/WordPress/gutenberg/pull/59845.
336
+ event.preventDefault();
336
337
  setIsLinkOpen( true );
337
338
  }
338
339
  }
@@ -370,7 +371,9 @@ export default function NavigationLinkEdit( {
370
371
  );
371
372
 
372
373
  if ( ! url || isInvalid || isDraft ) {
373
- blockProps.onClick = () => setIsLinkOpen( true );
374
+ blockProps.onClick = () => {
375
+ setIsLinkOpen( true );
376
+ };
374
377
  }
375
378
 
376
379
  const classes = classnames( 'wp-block-navigation-item__content', {
@@ -518,11 +521,6 @@ export default function NavigationLinkEdit( {
518
521
  'core/image',
519
522
  'core/strikethrough',
520
523
  ] }
521
- onClick={ () => {
522
- if ( ! url ) {
523
- setIsLinkOpen( true );
524
- }
525
- } }
526
524
  />
527
525
  { description && (
528
526
  <span className="wp-block-navigation-item__description">
@@ -570,6 +568,7 @@ export default function NavigationLinkEdit( {
570
568
  // Need to handle refocusing the Nav block or the inserter?
571
569
  onReplace( [] );
572
570
  }
571
+ setIsLinkOpen( false );
573
572
  } }
574
573
  anchor={ popoverAnchor }
575
574
  onRemove={ removeLink }
@@ -9,6 +9,8 @@
9
9
  * Build an array with CSS classes and inline styles defining the colors
10
10
  * which will be applied to the navigation markup in the front-end.
11
11
  *
12
+ * @since 5.9.0
13
+ *
12
14
  * @param array $context Navigation block context.
13
15
  * @param array $attributes Block attributes.
14
16
  * @param bool $is_sub_menu Whether the link is part of a sub-menu.
@@ -79,6 +81,8 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is
79
81
  * Build an array with CSS classes and inline styles defining the font sizes
80
82
  * which will be applied to the navigation markup in the front-end.
81
83
  *
84
+ * @since 5.9.0
85
+ *
82
86
  * @param array $context Navigation block context.
83
87
  * @return array Font size CSS classes and inline styles.
84
88
  */
@@ -113,6 +117,8 @@ function block_core_navigation_link_build_css_font_sizes( $context ) {
113
117
  /**
114
118
  * Returns the top-level submenu SVG chevron icon.
115
119
  *
120
+ * @since 5.9.0
121
+ *
116
122
  * @return string
117
123
  */
118
124
  function block_core_navigation_link_render_submenu_icon() {
@@ -122,6 +128,8 @@ function block_core_navigation_link_render_submenu_icon() {
122
128
  /**
123
129
  * Decodes a url if it's encoded, returning the same url if not.
124
130
  *
131
+ * @since 6.2.0
132
+ *
125
133
  * @param string $url The url to decode.
126
134
  *
127
135
  * @return string $url Returns the decoded url.
@@ -153,6 +161,8 @@ function block_core_navigation_link_maybe_urldecode( $url ) {
153
161
  /**
154
162
  * Renders the `core/navigation-link` block.
155
163
  *
164
+ * @since 5.9.0
165
+ *
156
166
  * @param array $attributes The block attributes.
157
167
  * @param string $content The saved content.
158
168
  * @param WP_Block $block The parsed block.
@@ -269,6 +279,8 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
269
279
  /**
270
280
  * Returns a navigation link variation
271
281
  *
282
+ * @since 5.9.0
283
+ *
272
284
  * @param WP_Taxonomy|WP_Post_Type $entity post type or taxonomy entity.
273
285
  * @param string $kind string of value 'taxonomy' or 'post-type'.
274
286
  *
@@ -391,6 +403,8 @@ function block_core_navigation_link_build_variations() {
391
403
  /**
392
404
  * Registers the navigation link block.
393
405
  *
406
+ * @since 5.9.0
407
+ *
394
408
  * @uses render_block_core_navigation_link()
395
409
  * @throws WP_Error An WP_Error exception parsing the block definition.
396
410
  */
@@ -279,6 +279,10 @@ export default function NavigationSubmenuEdit( {
279
279
 
280
280
  function onKeyDown( event ) {
281
281
  if ( isKeyboardEvent.primary( event, 'k' ) ) {
282
+ // Required to prevent the command center from opening,
283
+ // as it shares the CMD+K shortcut.
284
+ // See https://github.com/WordPress/gutenberg/pull/59845.
285
+ event.preventDefault();
282
286
  setIsLinkOpen( true );
283
287
  }
284
288
  }
@@ -9,6 +9,8 @@
9
9
  * Build an array with CSS classes and inline styles defining the font sizes
10
10
  * which will be applied to the navigation markup in the front-end.
11
11
  *
12
+ * @since 5.9.0
13
+ *
12
14
  * @param array $context Navigation block context.
13
15
  * @return array Font size CSS classes and inline styles.
14
16
  */
@@ -43,6 +45,8 @@ function block_core_navigation_submenu_build_css_font_sizes( $context ) {
43
45
  /**
44
46
  * Returns the top-level submenu SVG chevron icon.
45
47
  *
48
+ * @since 5.9.0
49
+ *
46
50
  * @return string
47
51
  */
48
52
  function block_core_navigation_submenu_render_submenu_icon() {
@@ -52,6 +56,8 @@ function block_core_navigation_submenu_render_submenu_icon() {
52
56
  /**
53
57
  * Renders the `core/navigation-submenu` block.
54
58
  *
59
+ * @since 5.9.0
60
+ *
55
61
  * @param array $attributes The block attributes.
56
62
  * @param string $content The saved content.
57
63
  * @param WP_Block $block The parsed block.
@@ -238,6 +244,8 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
238
244
  /**
239
245
  * Register the navigation submenu block.
240
246
  *
247
+ * @since 5.9.0
248
+ *
241
249
  * @uses render_block_core_navigation_submenu()
242
250
  * @throws WP_Error An WP_Error exception parsing the block definition.
243
251
  */
@@ -9,6 +9,8 @@
9
9
  * Build an array with CSS classes and inline styles defining the colors
10
10
  * which will be applied to the pages markup in the front-end when it is a descendant of navigation.
11
11
  *
12
+ * @since 5.8.0
13
+ *
12
14
  * @param array $attributes Block attributes.
13
15
  * @param array $context Navigation block context.
14
16
  * @return array Colors CSS classes and inline styles.
@@ -101,6 +103,8 @@ function block_core_page_list_build_css_colors( $attributes, $context ) {
101
103
  * Build an array with CSS classes and inline styles defining the font sizes
102
104
  * which will be applied to the pages markup in the front-end when it is a descendant of navigation.
103
105
  *
106
+ * @since 5.8.0
107
+ *
104
108
  * @param array $context Navigation block context.
105
109
  * @return array Font size CSS classes and inline styles.
106
110
  */
@@ -135,6 +139,8 @@ function block_core_page_list_build_css_font_sizes( $context ) {
135
139
  /**
136
140
  * Outputs Page list markup from an array of pages with nested children.
137
141
  *
142
+ * @since 5.8.0
143
+ *
138
144
  * @param boolean $open_submenus_on_click Whether to open submenus on click instead of hover.
139
145
  * @param boolean $show_submenu_icons Whether to show submenu indicator icons.
140
146
  * @param boolean $is_navigation_child If block is a child of Navigation block.
@@ -220,6 +226,8 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
220
226
  /**
221
227
  * Outputs nested array of pages
222
228
  *
229
+ * @since 5.8.0
230
+ *
223
231
  * @param array $current_level The level being iterated through.
224
232
  * @param array $children The children grouped by parent post ID.
225
233
  *
@@ -240,6 +248,8 @@ function block_core_page_list_nest_pages( $current_level, $children ) {
240
248
  /**
241
249
  * Renders the `core/page-list` block on server.
242
250
  *
251
+ * @since 5.8.0
252
+ *
243
253
  * @param array $attributes The block attributes.
244
254
  * @param string $content The saved content.
245
255
  * @param WP_Block $block The parsed block.
@@ -345,6 +355,8 @@ function render_block_core_page_list( $attributes, $content, $block ) {
345
355
 
346
356
  /**
347
357
  * Registers the `core/pages` block on server.
358
+ *
359
+ * @since 5.8.0
348
360
  */
349
361
  function register_block_core_page_list() {
350
362
  register_block_type_from_metadata(
@@ -7,6 +7,8 @@
7
7
 
8
8
  /**
9
9
  * Registers the `core/page-list-item` block on server.
10
+ *
11
+ * @since 6.3.0
10
12
  */
11
13
  function register_block_core_page_list_item() {
12
14
  register_block_type_from_metadata( __DIR__ . '/page-list-item' );
@@ -7,6 +7,8 @@
7
7
 
8
8
  /**
9
9
  * Registers the `core/pattern` block on the server.
10
+ *
11
+ * @since 5.9.0
10
12
  */
11
13
  function register_block_core_pattern() {
12
14
  register_block_type_from_metadata(
@@ -195,6 +195,7 @@ function PostAuthorEdit( {
195
195
  <div className="wp-block-post-author__content">
196
196
  { ( ! RichText.isEmpty( byline ) || isSelected ) && (
197
197
  <RichText
198
+ identifier="byline"
198
199
  className="wp-block-post-author__byline"
199
200
  aria-label={ __( 'Post author byline text' ) }
200
201
  placeholder={ __( 'Write byline…' ) }
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-author` block on the server.
10
10
  *
11
+ * @since 5.9.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -61,6 +63,8 @@ function render_block_core_post_author( $attributes, $content, $block ) {
61
63
 
62
64
  /**
63
65
  * Registers the `core/post-author` block on the server.
66
+ *
67
+ * @since 5.9.0
64
68
  */
65
69
  function register_block_core_post_author() {
66
70
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-author-biography` block on the server.
10
10
  *
11
+ * @since 6.0.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -37,6 +39,8 @@ function render_block_core_post_author_biography( $attributes, $content, $block
37
39
 
38
40
  /**
39
41
  * Registers the `core/post-author-biography` block on the server.
42
+ *
43
+ * @since 6.0.0
40
44
  */
41
45
  function register_block_core_post_author_biography() {
42
46
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-author-name` block on the server.
10
10
  *
11
+ * @since 6.2.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -43,6 +45,8 @@ function render_block_core_post_author_name( $attributes, $content, $block ) {
43
45
 
44
46
  /**
45
47
  * Registers the `core/post-author-name` block on the server.
48
+ *
49
+ * @since 6.2.0
46
50
  */
47
51
  function register_block_core_post_author_name() {
48
52
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-comments-form` block on the server.
10
10
  *
11
+ * @since 6.0.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -54,6 +56,8 @@ function render_block_core_post_comments_form( $attributes, $content, $block ) {
54
56
 
55
57
  /**
56
58
  * Registers the `core/post-comments-form` block on the server.
59
+ *
60
+ * @since 6.0.0
57
61
  */
58
62
  function register_block_core_post_comments_form() {
59
63
  register_block_type_from_metadata(
@@ -68,6 +72,8 @@ add_action( 'init', 'register_block_core_post_comments_form' );
68
72
  /**
69
73
  * Use the button block classes for the form-submit button.
70
74
  *
75
+ * @since 6.0.0
76
+ *
71
77
  * @param array $fields The default comment form arguments.
72
78
  *
73
79
  * @return array Returns the modified fields.
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-content` block on the server.
10
10
  *
11
+ * @since 5.8.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -63,6 +65,8 @@ function render_block_core_post_content( $attributes, $content, $block ) {
63
65
 
64
66
  /**
65
67
  * Registers the `core/post-content` block on the server.
68
+ *
69
+ * @since 5.8.0
66
70
  */
67
71
  function register_block_core_post_content() {
68
72
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-date` block on the server.
10
10
  *
11
+ * @since 5.8.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -60,6 +62,8 @@ function render_block_core_post_date( $attributes, $content, $block ) {
60
62
 
61
63
  /**
62
64
  * Registers the `core/post-date` block on the server.
65
+ *
66
+ * @since 5.8.0
63
67
  */
64
68
  function register_block_core_post_date() {
65
69
  register_block_type_from_metadata(
@@ -127,6 +127,7 @@ export default function PostExcerptEditor( {
127
127
  }
128
128
  const readMoreLink = (
129
129
  <RichText
130
+ identifier="moreText"
130
131
  className="wp-block-post-excerpt__more-link"
131
132
  tagName="a"
132
133
  aria-label={ __( '“Read more” link text' ) }
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-excerpt` block on the server.
10
10
  *
11
+ * @since 5.8.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -66,6 +68,8 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
66
68
 
67
69
  /**
68
70
  * Registers the `core/post-excerpt` block on the server.
71
+ *
72
+ * @since 5.8.0
69
73
  */
70
74
  function register_block_core_post_excerpt() {
71
75
  register_block_type_from_metadata(
@@ -77,6 +77,9 @@
77
77
  "width": true
78
78
  }
79
79
  },
80
+ "shadow": {
81
+ "__experimentalSkipSerialization": true
82
+ },
80
83
  "html": false,
81
84
  "spacing": {
82
85
  "margin": true,
@@ -86,6 +89,9 @@
86
89
  "clientNavigation": true
87
90
  }
88
91
  },
92
+ "selectors": {
93
+ "shadow": ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder"
94
+ },
89
95
  "editorStyle": "wp-block-post-featured-image-editor",
90
96
  "style": "wp-block-post-featured-image"
91
97
  }
@@ -24,6 +24,7 @@ import {
24
24
  useBlockProps,
25
25
  store as blockEditorStore,
26
26
  __experimentalUseBorderProps as useBorderProps,
27
+ __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,
27
28
  useBlockEditingMode,
28
29
  } from '@wordpress/block-editor';
29
30
  import { useMemo } from '@wordpress/element';
@@ -144,6 +145,7 @@ export default function PostFeaturedImageEdit( {
144
145
  style: { width, height, aspectRatio },
145
146
  } );
146
147
  const borderProps = useBorderProps( attributes );
148
+ const shadowProps = getShadowClassesAndStyles( attributes );
147
149
  const blockEditingMode = useBlockEditingMode();
148
150
 
149
151
  const placeholder = ( content ) => {
@@ -158,6 +160,7 @@ export default function PostFeaturedImageEdit( {
158
160
  height: !! aspectRatio && '100%',
159
161
  width: !! aspectRatio && '100%',
160
162
  ...borderProps.style,
163
+ ...shadowProps.style,
161
164
  } }
162
165
  >
163
166
  { content }
@@ -267,6 +270,7 @@ export default function PostFeaturedImageEdit( {
267
270
  const label = __( 'Add a featured image' );
268
271
  const imageStyles = {
269
272
  ...borderProps.style,
273
+ ...shadowProps.style,
270
274
  height: aspectRatio ? '100%' : height,
271
275
  width: !! aspectRatio && '100%',
272
276
  objectFit: !! ( height || aspectRatio ) && scale,