@wordpress/block-library 6.0.12 → 6.0.17-next.33ec3857e2.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 (737) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/archives/index.js +1 -0
  3. package/build/archives/index.js.map +1 -1
  4. package/build/audio/index.js +1 -0
  5. package/build/audio/index.js.map +1 -1
  6. package/build/block/index.js +1 -0
  7. package/build/block/index.js.map +1 -1
  8. package/build/button/edit.native.js +1 -1
  9. package/build/button/edit.native.js.map +1 -1
  10. package/build/button/index.js +5 -1
  11. package/build/button/index.js.map +1 -1
  12. package/build/buttons/index.js +1 -0
  13. package/build/buttons/index.js.map +1 -1
  14. package/build/buttons/transforms.js +1 -0
  15. package/build/buttons/transforms.js.map +1 -1
  16. package/build/calendar/index.js +1 -0
  17. package/build/calendar/index.js.map +1 -1
  18. package/build/categories/index.js +1 -0
  19. package/build/categories/index.js.map +1 -1
  20. package/build/code/index.js +6 -1
  21. package/build/code/index.js.map +1 -1
  22. package/build/column/index.js +1 -0
  23. package/build/column/index.js.map +1 -1
  24. package/build/columns/index.js +1 -0
  25. package/build/columns/index.js.map +1 -1
  26. package/build/comment-author-avatar/edit.js +2 -1
  27. package/build/comment-author-avatar/edit.js.map +1 -1
  28. package/build/comment-author-avatar/index.js +7 -2
  29. package/build/comment-author-avatar/index.js.map +1 -1
  30. package/build/comment-author-name/index.js +1 -0
  31. package/build/comment-author-name/index.js.map +1 -1
  32. package/build/comment-content/index.js +1 -0
  33. package/build/comment-content/index.js.map +1 -1
  34. package/build/comment-date/index.js +1 -0
  35. package/build/comment-date/index.js.map +1 -1
  36. package/build/comment-edit-link/index.js +2 -1
  37. package/build/comment-edit-link/index.js.map +1 -1
  38. package/build/comment-reply-link/index.js +1 -0
  39. package/build/comment-reply-link/index.js.map +1 -1
  40. package/build/comment-template/edit.js +98 -23
  41. package/build/comment-template/edit.js.map +1 -1
  42. package/build/comment-template/index.js +4 -2
  43. package/build/comment-template/index.js.map +1 -1
  44. package/build/comment-template/util.js +66 -0
  45. package/build/comment-template/util.js.map +1 -0
  46. package/build/comments-pagination/comments-pagination-arrow-controls.js +39 -0
  47. package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -0
  48. package/build/comments-pagination/edit.js +80 -0
  49. package/build/comments-pagination/edit.js.map +1 -0
  50. package/build/comments-pagination/index.js +71 -0
  51. package/build/comments-pagination/index.js.map +1 -0
  52. package/build/comments-pagination/save.js +18 -0
  53. package/build/comments-pagination/save.js.map +1 -0
  54. package/build/comments-pagination-numbers/edit.js +47 -0
  55. package/build/comments-pagination-numbers/edit.js.map +1 -0
  56. package/build/comments-pagination-numbers/index.js +47 -0
  57. package/build/comments-pagination-numbers/index.js.map +1 -0
  58. package/build/comments-query-loop/edit.js +2 -2
  59. package/build/comments-query-loop/edit.js.map +1 -1
  60. package/build/comments-query-loop/index.js +4 -7
  61. package/build/comments-query-loop/index.js.map +1 -1
  62. package/build/comments-query-loop/toolbar.js +3 -3
  63. package/build/comments-query-loop/toolbar.js.map +1 -1
  64. package/build/cover/edit.js +2 -1
  65. package/build/cover/edit.js.map +1 -1
  66. package/build/cover/index.js +1 -0
  67. package/build/cover/index.js.map +1 -1
  68. package/build/embed/deprecated.js +1 -0
  69. package/build/embed/deprecated.js.map +1 -1
  70. package/build/embed/edit.native.js +23 -20
  71. package/build/embed/edit.native.js.map +1 -1
  72. package/build/embed/embed-controls.native.js +69 -0
  73. package/build/embed/embed-controls.native.js.map +1 -0
  74. package/build/embed/embed-link-settings.native.js +101 -0
  75. package/build/embed/embed-link-settings.native.js.map +1 -0
  76. package/build/embed/embed-placeholder.native.js +9 -2
  77. package/build/embed/embed-placeholder.native.js.map +1 -1
  78. package/build/embed/index.js +1 -0
  79. package/build/embed/index.js.map +1 -1
  80. package/build/embed/transforms.js +1 -0
  81. package/build/embed/transforms.js.map +1 -1
  82. package/build/embed/util.js +1 -0
  83. package/build/embed/util.js.map +1 -1
  84. package/build/file/index.js +1 -0
  85. package/build/file/index.js.map +1 -1
  86. package/build/freeform/index.js +1 -0
  87. package/build/freeform/index.js.map +1 -1
  88. package/build/gallery/edit.js +5 -1
  89. package/build/gallery/edit.js.map +1 -1
  90. package/build/gallery/index.js +1 -0
  91. package/build/gallery/index.js.map +1 -1
  92. package/build/group/index.js +8 -1
  93. package/build/group/index.js.map +1 -1
  94. package/build/heading/index.js +1 -0
  95. package/build/heading/index.js.map +1 -1
  96. package/build/heading/transforms.js +1 -0
  97. package/build/heading/transforms.js.map +1 -1
  98. package/build/home-link/index.js +1 -0
  99. package/build/home-link/index.js.map +1 -1
  100. package/build/html/index.js +1 -0
  101. package/build/html/index.js.map +1 -1
  102. package/build/image/edit.js +56 -5
  103. package/build/image/edit.js.map +1 -1
  104. package/build/image/edit.native.js +1 -1
  105. package/build/image/edit.native.js.map +1 -1
  106. package/build/image/image.js +45 -10
  107. package/build/image/image.js.map +1 -1
  108. package/build/image/index.js +5 -1
  109. package/build/image/index.js.map +1 -1
  110. package/build/index.js +5 -1
  111. package/build/index.js.map +1 -1
  112. package/build/latest-comments/index.js +1 -0
  113. package/build/latest-comments/index.js.map +1 -1
  114. package/build/latest-posts/deprecated.js +1 -0
  115. package/build/latest-posts/deprecated.js.map +1 -1
  116. package/build/latest-posts/index.js +1 -0
  117. package/build/latest-posts/index.js.map +1 -1
  118. package/build/list/index.js +1 -0
  119. package/build/list/index.js.map +1 -1
  120. package/build/loginout/index.js +1 -0
  121. package/build/loginout/index.js.map +1 -1
  122. package/build/media-text/index.js +1 -0
  123. package/build/media-text/index.js.map +1 -1
  124. package/build/missing/index.js +1 -0
  125. package/build/missing/index.js.map +1 -1
  126. package/build/more/index.js +1 -0
  127. package/build/more/index.js.map +1 -1
  128. package/build/navigation/edit/index.js +27 -8
  129. package/build/navigation/edit/index.js.map +1 -1
  130. package/build/navigation/edit/navigation-menu-selector.js +7 -1
  131. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  132. package/build/navigation/index.js +1 -0
  133. package/build/navigation/index.js.map +1 -1
  134. package/build/navigation/menu-items-to-blocks.js +8 -2
  135. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  136. package/build/navigation/view.js +2 -2
  137. package/build/navigation/view.js.map +1 -1
  138. package/build/navigation-area/edit.js +2 -1
  139. package/build/navigation-area/edit.js.map +1 -1
  140. package/build/navigation-area/index.js +2 -1
  141. package/build/navigation-area/index.js.map +1 -1
  142. package/build/navigation-link/edit.js +7 -0
  143. package/build/navigation-link/edit.js.map +1 -1
  144. package/build/navigation-link/index.js +1 -0
  145. package/build/navigation-link/index.js.map +1 -1
  146. package/build/navigation-submenu/edit.js +2 -1
  147. package/build/navigation-submenu/edit.js.map +1 -1
  148. package/build/navigation-submenu/index.js +1 -0
  149. package/build/navigation-submenu/index.js.map +1 -1
  150. package/build/nextpage/index.js +1 -0
  151. package/build/nextpage/index.js.map +1 -1
  152. package/build/page-list/index.js +6 -1
  153. package/build/page-list/index.js.map +1 -1
  154. package/build/paragraph/edit.js +12 -2
  155. package/build/paragraph/edit.js.map +1 -1
  156. package/build/paragraph/index.js +1 -0
  157. package/build/paragraph/index.js.map +1 -1
  158. package/build/paragraph/transforms.js +1 -0
  159. package/build/paragraph/transforms.js.map +1 -1
  160. package/build/pattern/index.js +1 -0
  161. package/build/pattern/index.js.map +1 -1
  162. package/build/post-author/index.js +1 -0
  163. package/build/post-author/index.js.map +1 -1
  164. package/build/post-comment/index.js +1 -0
  165. package/build/post-comment/index.js.map +1 -1
  166. package/build/post-comments/index.js +2 -1
  167. package/build/post-comments/index.js.map +1 -1
  168. package/build/post-comments-count/index.js +1 -0
  169. package/build/post-comments-count/index.js.map +1 -1
  170. package/build/post-comments-form/index.js +1 -0
  171. package/build/post-comments-form/index.js.map +1 -1
  172. package/build/post-comments-link/index.js +1 -0
  173. package/build/post-comments-link/index.js.map +1 -1
  174. package/build/post-content/index.js +1 -0
  175. package/build/post-content/index.js.map +1 -1
  176. package/build/post-date/index.js +1 -0
  177. package/build/post-date/index.js.map +1 -1
  178. package/build/post-excerpt/index.js +1 -0
  179. package/build/post-excerpt/index.js.map +1 -1
  180. package/build/post-featured-image/dimension-controls.js +50 -30
  181. package/build/post-featured-image/dimension-controls.js.map +1 -1
  182. package/build/post-featured-image/edit.js +7 -3
  183. package/build/post-featured-image/edit.js.map +1 -1
  184. package/build/post-featured-image/index.js +1 -0
  185. package/build/post-featured-image/index.js.map +1 -1
  186. package/build/post-navigation-link/index.js +1 -0
  187. package/build/post-navigation-link/index.js.map +1 -1
  188. package/build/post-template/edit.js +54 -13
  189. package/build/post-template/edit.js.map +1 -1
  190. package/build/post-template/index.js +1 -0
  191. package/build/post-template/index.js.map +1 -1
  192. package/build/post-terms/index.js +1 -0
  193. package/build/post-terms/index.js.map +1 -1
  194. package/build/post-title/index.js +1 -0
  195. package/build/post-title/index.js.map +1 -1
  196. package/build/preformatted/edit.native.js +2 -1
  197. package/build/preformatted/edit.native.js.map +1 -1
  198. package/build/preformatted/index.js +1 -0
  199. package/build/preformatted/index.js.map +1 -1
  200. package/build/pullquote/index.js +8 -1
  201. package/build/pullquote/index.js.map +1 -1
  202. package/build/query/index.js +1 -0
  203. package/build/query/index.js.map +1 -1
  204. package/build/query-pagination/index.js +1 -0
  205. package/build/query-pagination/index.js.map +1 -1
  206. package/build/query-pagination-next/index.js +1 -0
  207. package/build/query-pagination-next/index.js.map +1 -1
  208. package/build/query-pagination-numbers/index.js +1 -0
  209. package/build/query-pagination-numbers/index.js.map +1 -1
  210. package/build/query-pagination-previous/index.js +1 -0
  211. package/build/query-pagination-previous/index.js.map +1 -1
  212. package/build/query-title/index.js +1 -0
  213. package/build/query-title/index.js.map +1 -1
  214. package/build/quote/index.js +1 -0
  215. package/build/quote/index.js.map +1 -1
  216. package/build/rss/index.js +1 -0
  217. package/build/rss/index.js.map +1 -1
  218. package/build/search/edit.js +5 -3
  219. package/build/search/edit.js.map +1 -1
  220. package/build/search/index.js +8 -1
  221. package/build/search/index.js.map +1 -1
  222. package/build/separator/index.js +1 -0
  223. package/build/separator/index.js.map +1 -1
  224. package/build/shortcode/index.js +1 -0
  225. package/build/shortcode/index.js.map +1 -1
  226. package/build/site-logo/index.js +1 -0
  227. package/build/site-logo/index.js.map +1 -1
  228. package/build/site-tagline/index.js +2 -1
  229. package/build/site-tagline/index.js.map +1 -1
  230. package/build/site-title/index.js +1 -0
  231. package/build/site-title/index.js.map +1 -1
  232. package/build/social-link/index.js +2 -1
  233. package/build/social-link/index.js.map +1 -1
  234. package/build/social-links/index.js +2 -1
  235. package/build/social-links/index.js.map +1 -1
  236. package/build/spacer/index.js +1 -0
  237. package/build/spacer/index.js.map +1 -1
  238. package/build/table/index.js +7 -1
  239. package/build/table/index.js.map +1 -1
  240. package/build/table-of-contents/index.js +1 -0
  241. package/build/table-of-contents/index.js.map +1 -1
  242. package/build/tag-cloud/index.js +1 -0
  243. package/build/tag-cloud/index.js.map +1 -1
  244. package/build/template-part/edit/index.js +7 -1
  245. package/build/template-part/edit/index.js.map +1 -1
  246. package/build/template-part/index.js +26 -9
  247. package/build/template-part/index.js.map +1 -1
  248. package/build/term-description/index.js +1 -0
  249. package/build/term-description/index.js.map +1 -1
  250. package/build/text-columns/index.js +1 -0
  251. package/build/text-columns/index.js.map +1 -1
  252. package/build/verse/index.js +1 -0
  253. package/build/verse/index.js.map +1 -1
  254. package/build/video/index.js +1 -0
  255. package/build/video/index.js.map +1 -1
  256. package/build-module/archives/index.js +1 -0
  257. package/build-module/archives/index.js.map +1 -1
  258. package/build-module/audio/index.js +1 -0
  259. package/build-module/audio/index.js.map +1 -1
  260. package/build-module/block/index.js +1 -0
  261. package/build-module/block/index.js.map +1 -1
  262. package/build-module/button/edit.native.js +1 -1
  263. package/build-module/button/edit.native.js.map +1 -1
  264. package/build-module/button/index.js +5 -1
  265. package/build-module/button/index.js.map +1 -1
  266. package/build-module/buttons/index.js +1 -0
  267. package/build-module/buttons/index.js.map +1 -1
  268. package/build-module/buttons/transforms.js +1 -0
  269. package/build-module/buttons/transforms.js.map +1 -1
  270. package/build-module/calendar/index.js +1 -0
  271. package/build-module/calendar/index.js.map +1 -1
  272. package/build-module/categories/index.js +1 -0
  273. package/build-module/categories/index.js.map +1 -1
  274. package/build-module/code/index.js +6 -1
  275. package/build-module/code/index.js.map +1 -1
  276. package/build-module/column/index.js +1 -0
  277. package/build-module/column/index.js.map +1 -1
  278. package/build-module/columns/index.js +1 -0
  279. package/build-module/columns/index.js.map +1 -1
  280. package/build-module/comment-author-avatar/edit.js +3 -2
  281. package/build-module/comment-author-avatar/edit.js.map +1 -1
  282. package/build-module/comment-author-avatar/index.js +7 -2
  283. package/build-module/comment-author-avatar/index.js.map +1 -1
  284. package/build-module/comment-author-name/index.js +1 -0
  285. package/build-module/comment-author-name/index.js.map +1 -1
  286. package/build-module/comment-content/index.js +1 -0
  287. package/build-module/comment-content/index.js.map +1 -1
  288. package/build-module/comment-date/index.js +1 -0
  289. package/build-module/comment-date/index.js.map +1 -1
  290. package/build-module/comment-edit-link/index.js +2 -1
  291. package/build-module/comment-edit-link/index.js.map +1 -1
  292. package/build-module/comment-reply-link/index.js +1 -0
  293. package/build-module/comment-reply-link/index.js.map +1 -1
  294. package/build-module/comment-template/edit.js +97 -23
  295. package/build-module/comment-template/edit.js.map +1 -1
  296. package/build-module/comment-template/index.js +4 -2
  297. package/build-module/comment-template/index.js.map +1 -1
  298. package/build-module/comment-template/util.js +57 -0
  299. package/build-module/comment-template/util.js.map +1 -0
  300. package/build-module/comments-pagination/comments-pagination-arrow-controls.js +30 -0
  301. package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -0
  302. package/build-module/comments-pagination/edit.js +67 -0
  303. package/build-module/comments-pagination/edit.js.map +1 -0
  304. package/build-module/comments-pagination/index.js +57 -0
  305. package/build-module/comments-pagination/index.js.map +1 -0
  306. package/build-module/comments-pagination/save.js +10 -0
  307. package/build-module/comments-pagination/save.js.map +1 -0
  308. package/build-module/comments-pagination-numbers/edit.js +40 -0
  309. package/build-module/comments-pagination-numbers/edit.js.map +1 -0
  310. package/build-module/comments-pagination-numbers/index.js +34 -0
  311. package/build-module/comments-pagination-numbers/index.js.map +1 -0
  312. package/build-module/comments-query-loop/edit.js +2 -2
  313. package/build-module/comments-query-loop/edit.js.map +1 -1
  314. package/build-module/comments-query-loop/index.js +4 -7
  315. package/build-module/comments-query-loop/index.js.map +1 -1
  316. package/build-module/comments-query-loop/toolbar.js +3 -3
  317. package/build-module/comments-query-loop/toolbar.js.map +1 -1
  318. package/build-module/cover/edit.js +2 -1
  319. package/build-module/cover/edit.js.map +1 -1
  320. package/build-module/cover/index.js +1 -0
  321. package/build-module/cover/index.js.map +1 -1
  322. package/build-module/embed/deprecated.js +1 -0
  323. package/build-module/embed/deprecated.js.map +1 -1
  324. package/build-module/embed/edit.native.js +24 -21
  325. package/build-module/embed/edit.native.js.map +1 -1
  326. package/build-module/embed/embed-controls.native.js +54 -0
  327. package/build-module/embed/embed-controls.native.js.map +1 -0
  328. package/build-module/embed/embed-link-settings.native.js +90 -0
  329. package/build-module/embed/embed-link-settings.native.js.map +1 -0
  330. package/build-module/embed/embed-placeholder.native.js +9 -2
  331. package/build-module/embed/embed-placeholder.native.js.map +1 -1
  332. package/build-module/embed/index.js +1 -0
  333. package/build-module/embed/index.js.map +1 -1
  334. package/build-module/embed/transforms.js +1 -0
  335. package/build-module/embed/transforms.js.map +1 -1
  336. package/build-module/embed/util.js +1 -0
  337. package/build-module/embed/util.js.map +1 -1
  338. package/build-module/file/index.js +1 -0
  339. package/build-module/file/index.js.map +1 -1
  340. package/build-module/freeform/index.js +1 -0
  341. package/build-module/freeform/index.js.map +1 -1
  342. package/build-module/gallery/edit.js +5 -1
  343. package/build-module/gallery/edit.js.map +1 -1
  344. package/build-module/gallery/index.js +1 -0
  345. package/build-module/gallery/index.js.map +1 -1
  346. package/build-module/group/index.js +8 -1
  347. package/build-module/group/index.js.map +1 -1
  348. package/build-module/heading/index.js +1 -0
  349. package/build-module/heading/index.js.map +1 -1
  350. package/build-module/heading/transforms.js +1 -0
  351. package/build-module/heading/transforms.js.map +1 -1
  352. package/build-module/home-link/index.js +1 -0
  353. package/build-module/home-link/index.js.map +1 -1
  354. package/build-module/html/index.js +1 -0
  355. package/build-module/html/index.js.map +1 -1
  356. package/build-module/image/edit.js +52 -4
  357. package/build-module/image/edit.js.map +1 -1
  358. package/build-module/image/edit.native.js +1 -1
  359. package/build-module/image/edit.native.js.map +1 -1
  360. package/build-module/image/image.js +47 -12
  361. package/build-module/image/image.js.map +1 -1
  362. package/build-module/image/index.js +5 -1
  363. package/build-module/image/index.js.map +1 -1
  364. package/build-module/index.js +3 -1
  365. package/build-module/index.js.map +1 -1
  366. package/build-module/latest-comments/index.js +1 -0
  367. package/build-module/latest-comments/index.js.map +1 -1
  368. package/build-module/latest-posts/deprecated.js +1 -0
  369. package/build-module/latest-posts/deprecated.js.map +1 -1
  370. package/build-module/latest-posts/index.js +1 -0
  371. package/build-module/latest-posts/index.js.map +1 -1
  372. package/build-module/list/index.js +1 -0
  373. package/build-module/list/index.js.map +1 -1
  374. package/build-module/loginout/index.js +1 -0
  375. package/build-module/loginout/index.js.map +1 -1
  376. package/build-module/media-text/index.js +1 -0
  377. package/build-module/media-text/index.js.map +1 -1
  378. package/build-module/missing/index.js +1 -0
  379. package/build-module/missing/index.js.map +1 -1
  380. package/build-module/more/index.js +1 -0
  381. package/build-module/more/index.js.map +1 -1
  382. package/build-module/navigation/edit/index.js +26 -8
  383. package/build-module/navigation/edit/index.js.map +1 -1
  384. package/build-module/navigation/edit/navigation-menu-selector.js +6 -1
  385. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  386. package/build-module/navigation/index.js +1 -0
  387. package/build-module/navigation/index.js.map +1 -1
  388. package/build-module/navigation/menu-items-to-blocks.js +7 -2
  389. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  390. package/build-module/navigation/view.js +2 -2
  391. package/build-module/navigation/view.js.map +1 -1
  392. package/build-module/navigation-area/edit.js +2 -1
  393. package/build-module/navigation-area/edit.js.map +1 -1
  394. package/build-module/navigation-area/index.js +2 -1
  395. package/build-module/navigation-area/index.js.map +1 -1
  396. package/build-module/navigation-link/edit.js +7 -0
  397. package/build-module/navigation-link/edit.js.map +1 -1
  398. package/build-module/navigation-link/index.js +1 -0
  399. package/build-module/navigation-link/index.js.map +1 -1
  400. package/build-module/navigation-submenu/edit.js +2 -1
  401. package/build-module/navigation-submenu/edit.js.map +1 -1
  402. package/build-module/navigation-submenu/index.js +1 -0
  403. package/build-module/navigation-submenu/index.js.map +1 -1
  404. package/build-module/nextpage/index.js +1 -0
  405. package/build-module/nextpage/index.js.map +1 -1
  406. package/build-module/page-list/index.js +6 -1
  407. package/build-module/page-list/index.js.map +1 -1
  408. package/build-module/paragraph/edit.js +13 -3
  409. package/build-module/paragraph/edit.js.map +1 -1
  410. package/build-module/paragraph/index.js +1 -0
  411. package/build-module/paragraph/index.js.map +1 -1
  412. package/build-module/paragraph/transforms.js +1 -0
  413. package/build-module/paragraph/transforms.js.map +1 -1
  414. package/build-module/pattern/index.js +1 -0
  415. package/build-module/pattern/index.js.map +1 -1
  416. package/build-module/post-author/index.js +1 -0
  417. package/build-module/post-author/index.js.map +1 -1
  418. package/build-module/post-comment/index.js +1 -0
  419. package/build-module/post-comment/index.js.map +1 -1
  420. package/build-module/post-comments/index.js +2 -1
  421. package/build-module/post-comments/index.js.map +1 -1
  422. package/build-module/post-comments-count/index.js +1 -0
  423. package/build-module/post-comments-count/index.js.map +1 -1
  424. package/build-module/post-comments-form/index.js +1 -0
  425. package/build-module/post-comments-form/index.js.map +1 -1
  426. package/build-module/post-comments-link/index.js +1 -0
  427. package/build-module/post-comments-link/index.js.map +1 -1
  428. package/build-module/post-content/index.js +1 -0
  429. package/build-module/post-content/index.js.map +1 -1
  430. package/build-module/post-date/index.js +1 -0
  431. package/build-module/post-date/index.js.map +1 -1
  432. package/build-module/post-excerpt/index.js +1 -0
  433. package/build-module/post-excerpt/index.js.map +1 -1
  434. package/build-module/post-featured-image/dimension-controls.js +52 -29
  435. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  436. package/build-module/post-featured-image/edit.js +8 -4
  437. package/build-module/post-featured-image/edit.js.map +1 -1
  438. package/build-module/post-featured-image/index.js +1 -0
  439. package/build-module/post-featured-image/index.js.map +1 -1
  440. package/build-module/post-navigation-link/index.js +1 -0
  441. package/build-module/post-navigation-link/index.js.map +1 -1
  442. package/build-module/post-template/edit.js +54 -15
  443. package/build-module/post-template/edit.js.map +1 -1
  444. package/build-module/post-template/index.js +1 -0
  445. package/build-module/post-template/index.js.map +1 -1
  446. package/build-module/post-terms/index.js +1 -0
  447. package/build-module/post-terms/index.js.map +1 -1
  448. package/build-module/post-title/index.js +1 -0
  449. package/build-module/post-title/index.js.map +1 -1
  450. package/build-module/preformatted/edit.native.js +2 -1
  451. package/build-module/preformatted/edit.native.js.map +1 -1
  452. package/build-module/preformatted/index.js +1 -0
  453. package/build-module/preformatted/index.js.map +1 -1
  454. package/build-module/pullquote/index.js +8 -1
  455. package/build-module/pullquote/index.js.map +1 -1
  456. package/build-module/query/index.js +1 -0
  457. package/build-module/query/index.js.map +1 -1
  458. package/build-module/query-pagination/index.js +1 -0
  459. package/build-module/query-pagination/index.js.map +1 -1
  460. package/build-module/query-pagination-next/index.js +1 -0
  461. package/build-module/query-pagination-next/index.js.map +1 -1
  462. package/build-module/query-pagination-numbers/index.js +1 -0
  463. package/build-module/query-pagination-numbers/index.js.map +1 -1
  464. package/build-module/query-pagination-previous/index.js +1 -0
  465. package/build-module/query-pagination-previous/index.js.map +1 -1
  466. package/build-module/query-title/index.js +1 -0
  467. package/build-module/query-title/index.js.map +1 -1
  468. package/build-module/quote/index.js +1 -0
  469. package/build-module/quote/index.js.map +1 -1
  470. package/build-module/rss/index.js +1 -0
  471. package/build-module/rss/index.js.map +1 -1
  472. package/build-module/search/edit.js +5 -3
  473. package/build-module/search/edit.js.map +1 -1
  474. package/build-module/search/index.js +8 -1
  475. package/build-module/search/index.js.map +1 -1
  476. package/build-module/separator/index.js +1 -0
  477. package/build-module/separator/index.js.map +1 -1
  478. package/build-module/shortcode/index.js +1 -0
  479. package/build-module/shortcode/index.js.map +1 -1
  480. package/build-module/site-logo/index.js +1 -0
  481. package/build-module/site-logo/index.js.map +1 -1
  482. package/build-module/site-tagline/index.js +2 -1
  483. package/build-module/site-tagline/index.js.map +1 -1
  484. package/build-module/site-title/index.js +1 -0
  485. package/build-module/site-title/index.js.map +1 -1
  486. package/build-module/social-link/index.js +2 -1
  487. package/build-module/social-link/index.js.map +1 -1
  488. package/build-module/social-links/index.js +2 -1
  489. package/build-module/social-links/index.js.map +1 -1
  490. package/build-module/spacer/index.js +1 -0
  491. package/build-module/spacer/index.js.map +1 -1
  492. package/build-module/table/index.js +7 -1
  493. package/build-module/table/index.js.map +1 -1
  494. package/build-module/table-of-contents/index.js +1 -0
  495. package/build-module/table-of-contents/index.js.map +1 -1
  496. package/build-module/tag-cloud/index.js +1 -0
  497. package/build-module/tag-cloud/index.js.map +1 -1
  498. package/build-module/template-part/edit/index.js +6 -1
  499. package/build-module/template-part/edit/index.js.map +1 -1
  500. package/build-module/template-part/index.js +26 -9
  501. package/build-module/template-part/index.js.map +1 -1
  502. package/build-module/term-description/index.js +1 -0
  503. package/build-module/term-description/index.js.map +1 -1
  504. package/build-module/text-columns/index.js +1 -0
  505. package/build-module/text-columns/index.js.map +1 -1
  506. package/build-module/verse/index.js +1 -0
  507. package/build-module/verse/index.js.map +1 -1
  508. package/build-module/video/index.js +1 -0
  509. package/build-module/video/index.js.map +1 -1
  510. package/build-style/columns/style-rtl.css +4 -3
  511. package/build-style/columns/style.css +4 -3
  512. package/build-style/comment-template/style-rtl.css +91 -0
  513. package/build-style/comment-template/style.css +91 -0
  514. package/build-style/{home-link/style.css → comments-pagination/editor-rtl.css} +18 -22
  515. package/build-style/comments-pagination/editor.css +102 -0
  516. package/build-style/{home-link → comments-pagination}/style-rtl.css +21 -21
  517. package/build-style/comments-pagination/style.css +106 -0
  518. package/build-style/comments-pagination-numbers/editor-rtl.css +85 -0
  519. package/build-style/comments-pagination-numbers/editor.css +86 -0
  520. package/build-style/common-rtl.css +29 -0
  521. package/build-style/common.css +29 -0
  522. package/build-style/cover/style-rtl.css +4 -0
  523. package/build-style/cover/style.css +4 -0
  524. package/build-style/editor-rtl.css +70 -23
  525. package/build-style/editor.css +73 -23
  526. package/build-style/gallery/editor-rtl.css +0 -12
  527. package/build-style/gallery/editor.css +0 -12
  528. package/build-style/gallery/style-rtl.css +3 -0
  529. package/build-style/gallery/style.css +3 -0
  530. package/build-style/group/theme-rtl.css +1 -1
  531. package/build-style/group/theme.css +1 -1
  532. package/build-style/image/editor-rtl.css +16 -0
  533. package/build-style/image/editor.css +16 -0
  534. package/build-style/navigation/editor-rtl.css +9 -0
  535. package/build-style/navigation/editor.css +9 -0
  536. package/build-style/navigation/style-rtl.css +13 -7
  537. package/build-style/navigation/style.css +13 -7
  538. package/build-style/post-comments/style-rtl.css +3 -1
  539. package/build-style/post-comments/style.css +3 -1
  540. package/build-style/post-comments-form/style-rtl.css +2 -2
  541. package/build-style/post-comments-form/style.css +2 -2
  542. package/build-style/post-featured-image/editor-rtl.css +0 -7
  543. package/build-style/post-featured-image/editor.css +0 -7
  544. package/build-style/post-featured-image/style-rtl.css +1 -1
  545. package/build-style/post-featured-image/style.css +1 -1
  546. package/build-style/post-title/style-rtl.css +3 -0
  547. package/build-style/post-title/style.css +3 -0
  548. package/build-style/pullquote/style-rtl.css +1 -0
  549. package/build-style/pullquote/style.css +1 -0
  550. package/build-style/query-pagination/editor-rtl.css +0 -4
  551. package/build-style/query-pagination/editor.css +0 -4
  552. package/build-style/query-pagination/style-rtl.css +6 -2
  553. package/build-style/query-pagination/style.css +6 -2
  554. package/build-style/style-rtl.css +131 -61
  555. package/build-style/style.css +133 -61
  556. package/build-style/table/style-rtl.css +1 -0
  557. package/build-style/table/style.css +1 -0
  558. package/build-style/theme-rtl.css +1 -1
  559. package/build-style/theme.css +1 -1
  560. package/package.json +31 -31
  561. package/src/archives/block.json +1 -0
  562. package/src/audio/block.json +1 -0
  563. package/src/block/block.json +1 -0
  564. package/src/button/block.json +5 -1
  565. package/src/button/edit.native.js +1 -1
  566. package/src/buttons/block.json +2 -1
  567. package/src/calendar/block.json +1 -0
  568. package/src/calendar/index.php +35 -39
  569. package/src/categories/block.json +1 -0
  570. package/src/code/block.json +6 -1
  571. package/src/column/block.json +1 -0
  572. package/src/columns/block.json +1 -0
  573. package/src/columns/style.scss +8 -5
  574. package/src/comment-author-avatar/block.json +7 -2
  575. package/src/comment-author-avatar/edit.js +7 -2
  576. package/src/comment-author-avatar/index.php +25 -6
  577. package/src/comment-author-name/block.json +1 -0
  578. package/src/comment-content/block.json +1 -0
  579. package/src/comment-date/block.json +1 -0
  580. package/src/comment-edit-link/block.json +1 -0
  581. package/src/comment-edit-link/index.js +1 -1
  582. package/src/comment-reply-link/block.json +1 -0
  583. package/src/comment-template/block.json +4 -2
  584. package/src/comment-template/edit.js +111 -37
  585. package/src/comment-template/index.php +46 -19
  586. package/src/comment-template/style.scss +17 -0
  587. package/src/comment-template/test/index.js +45 -0
  588. package/src/comment-template/util.js +56 -0
  589. package/src/comments-pagination/block.json +37 -0
  590. package/src/comments-pagination/comments-pagination-arrow-controls.js +44 -0
  591. package/src/comments-pagination/edit.js +78 -0
  592. package/src/comments-pagination/editor.scss +34 -0
  593. package/src/comments-pagination/index.js +20 -0
  594. package/src/comments-pagination/index.php +39 -0
  595. package/src/comments-pagination/save.js +8 -0
  596. package/src/comments-pagination/style.scss +38 -0
  597. package/src/comments-pagination-numbers/block.json +16 -0
  598. package/src/comments-pagination-numbers/edit.js +22 -0
  599. package/src/comments-pagination-numbers/editor.scss +12 -0
  600. package/src/comments-pagination-numbers/index.js +18 -0
  601. package/src/comments-pagination-numbers/index.php +69 -0
  602. package/src/comments-query-loop/block.json +4 -7
  603. package/src/comments-query-loop/edit.js +2 -5
  604. package/src/comments-query-loop/toolbar.js +3 -3
  605. package/src/common.scss +31 -0
  606. package/src/cover/block.json +1 -0
  607. package/src/cover/edit.js +1 -0
  608. package/src/cover/style.scss +4 -0
  609. package/src/editor.scss +14 -0
  610. package/src/embed/block.json +1 -0
  611. package/src/embed/edit.native.js +23 -18
  612. package/src/embed/embed-controls.native.js +65 -0
  613. package/src/embed/embed-link-settings.native.js +100 -0
  614. package/src/embed/embed-placeholder.native.js +8 -0
  615. package/src/embed/test/__snapshots__/index.native.js.snap +10 -0
  616. package/src/embed/test/index.native.js +228 -88
  617. package/src/file/block.json +1 -0
  618. package/src/freeform/block.json +1 -0
  619. package/src/gallery/block.json +1 -0
  620. package/src/gallery/edit.js +13 -0
  621. package/src/gallery/editor.scss +0 -14
  622. package/src/gallery/index.php +7 -8
  623. package/src/gallery/style.scss +4 -0
  624. package/src/gallery/test/use-get-new-images.js +93 -0
  625. package/src/group/block.json +8 -1
  626. package/src/group/theme.scss +4 -5
  627. package/src/heading/block.json +1 -0
  628. package/src/home-link/block.json +1 -0
  629. package/src/home-link/index.php +4 -4
  630. package/src/html/block.json +1 -0
  631. package/src/image/block.json +5 -1
  632. package/src/image/edit.js +44 -0
  633. package/src/image/edit.native.js +1 -1
  634. package/src/image/editor.scss +18 -0
  635. package/src/image/image.js +46 -11
  636. package/src/image/index.php +1 -1
  637. package/src/index.js +4 -0
  638. package/src/latest-comments/block.json +1 -0
  639. package/src/latest-posts/block.json +1 -0
  640. package/src/list/block.json +1 -0
  641. package/src/loginout/block.json +1 -0
  642. package/src/media-text/block.json +1 -0
  643. package/src/missing/block.json +1 -0
  644. package/src/more/block.json +1 -0
  645. package/src/navigation/README.md +13 -0
  646. package/src/navigation/block.json +4 -16
  647. package/src/navigation/edit/index.js +51 -28
  648. package/src/navigation/edit/navigation-menu-selector.js +8 -0
  649. package/src/navigation/editor.scss +12 -0
  650. package/src/navigation/index.php +4 -4
  651. package/src/navigation/menu-items-to-blocks.js +9 -2
  652. package/src/navigation/style.scss +26 -14
  653. package/src/navigation/view.js +2 -2
  654. package/src/navigation-area/block.json +3 -7
  655. package/src/navigation-area/edit.js +2 -1
  656. package/src/navigation-link/block.json +2 -3
  657. package/src/navigation-link/edit.js +5 -0
  658. package/src/navigation-link/index.php +4 -4
  659. package/src/navigation-submenu/block.json +2 -3
  660. package/src/navigation-submenu/edit.js +1 -1
  661. package/src/navigation-submenu/index.php +12 -6
  662. package/src/nextpage/block.json +1 -0
  663. package/src/page-list/block.json +4 -0
  664. package/src/page-list/index.php +12 -7
  665. package/src/paragraph/block.json +1 -0
  666. package/src/paragraph/edit.js +12 -4
  667. package/src/pattern/block.json +1 -0
  668. package/src/post-author/block.json +1 -0
  669. package/src/post-comment/block.json +1 -0
  670. package/src/post-comments/block.json +6 -1
  671. package/src/post-comments/index.php +17 -0
  672. package/src/post-comments/style.scss +7 -3
  673. package/src/post-comments-count/block.json +1 -0
  674. package/src/post-comments-form/block.json +6 -1
  675. package/src/post-comments-form/index.php +6 -4
  676. package/src/post-comments-form/style.scss +7 -5
  677. package/src/post-comments-link/block.json +1 -0
  678. package/src/post-content/block.json +1 -0
  679. package/src/post-date/block.json +1 -0
  680. package/src/post-excerpt/block.json +1 -0
  681. package/src/post-featured-image/block.json +1 -0
  682. package/src/post-featured-image/dimension-controls.js +75 -50
  683. package/src/post-featured-image/edit.js +12 -5
  684. package/src/post-featured-image/editor.scss +0 -8
  685. package/src/post-featured-image/style.scss +1 -1
  686. package/src/post-navigation-link/block.json +1 -0
  687. package/src/post-template/block.json +1 -0
  688. package/src/post-template/edit.js +54 -17
  689. package/src/post-terms/block.json +1 -0
  690. package/src/post-title/block.json +1 -0
  691. package/src/post-title/style.scss +6 -2
  692. package/src/preformatted/block.json +1 -0
  693. package/src/preformatted/edit.native.js +3 -1
  694. package/src/pullquote/block.json +8 -1
  695. package/src/pullquote/style.scss +1 -0
  696. package/src/query/block.json +1 -0
  697. package/src/query-pagination/block.json +1 -0
  698. package/src/query-pagination/editor.scss +0 -4
  699. package/src/query-pagination/style.scss +12 -2
  700. package/src/query-pagination-next/block.json +1 -0
  701. package/src/query-pagination-next/index.php +42 -19
  702. package/src/query-pagination-numbers/block.json +1 -0
  703. package/src/query-pagination-previous/block.json +1 -0
  704. package/src/query-pagination-previous/index.php +45 -13
  705. package/src/query-title/block.json +1 -0
  706. package/src/quote/block.json +1 -0
  707. package/src/rss/block.json +1 -0
  708. package/src/search/block.json +8 -1
  709. package/src/search/edit.js +2 -1
  710. package/src/search/index.php +20 -10
  711. package/src/separator/block.json +1 -0
  712. package/src/shortcode/block.json +1 -0
  713. package/src/site-logo/block.json +1 -0
  714. package/src/site-tagline/block.json +2 -1
  715. package/src/site-title/block.json +1 -0
  716. package/src/social-link/block.json +2 -1
  717. package/src/social-links/block.json +3 -8
  718. package/src/spacer/block.json +1 -0
  719. package/src/style.scss +3 -2
  720. package/src/table/block.json +7 -1
  721. package/src/table/style.scss +1 -0
  722. package/src/table-of-contents/block.json +1 -0
  723. package/src/tag-cloud/block.json +1 -0
  724. package/src/template-part/block.json +1 -8
  725. package/src/template-part/edit/index.js +6 -1
  726. package/src/template-part/index.js +28 -0
  727. package/src/template-part/index.php +5 -2
  728. package/src/term-description/block.json +1 -0
  729. package/src/text-columns/block.json +1 -0
  730. package/src/verse/block.json +1 -0
  731. package/src/video/block.json +1 -0
  732. package/build/embed/embed-bottom-sheet.native.js +0 -85
  733. package/build/embed/embed-bottom-sheet.native.js.map +0 -1
  734. package/build-module/embed/embed-bottom-sheet.native.js +0 -74
  735. package/build-module/embed/embed-bottom-sheet.native.js.map +0 -1
  736. package/src/embed/embed-bottom-sheet.native.js +0 -78
  737. package/src/home-link/style.scss +0 -51
@@ -0,0 +1,93 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, screen } from '@testing-library/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import useGetNewImages from '../use-get-new-images';
10
+
11
+ const TestComponent = ( { images, imageData } ) => {
12
+ const newImages = useGetNewImages( images, imageData );
13
+ return <div title="testResult">{ JSON.stringify( newImages ) }</div>;
14
+ };
15
+
16
+ describe( 'gallery block useGetNewImages hook', () => {
17
+ it( 'returns null if no images currently in the gallery', () => {
18
+ render( <TestComponent images={ [] } imageData={ [] } /> );
19
+ expect( screen.getByTitle( 'testResult' ) ).toHaveTextContent( 'null' );
20
+ } );
21
+
22
+ it( 'should not return images that have been loaded from the saved post content', () => {
23
+ render(
24
+ <TestComponent
25
+ images={ [
26
+ { clientId: 'abc123', id: 1, fromSavedContent: true },
27
+ ] }
28
+ imageData={ [ { id: 1 } ] }
29
+ />
30
+ );
31
+ expect( screen.getByTitle( 'testResult' ) ).toHaveTextContent( 'null' );
32
+ } );
33
+
34
+ it( 'returns array of new images that have been added since the last render', () => {
35
+ const { rerender } = render(
36
+ <TestComponent
37
+ images={ [ { clientId: 'abc123', id: 1 } ] }
38
+ imageData={ [ { id: 1 } ] }
39
+ />
40
+ );
41
+
42
+ expect( screen.getByTitle( 'testResult' ) ).toHaveTextContent(
43
+ '[{"clientId":"abc123","id":1}]'
44
+ );
45
+
46
+ rerender(
47
+ <TestComponent
48
+ images={ [
49
+ { clientId: 'abc123', id: 1 },
50
+ { clientId: 'efg456', id: 2 },
51
+ ] }
52
+ imageData={ [ { id: 1 }, { id: 2 } ] }
53
+ />
54
+ );
55
+
56
+ expect( screen.getByTitle( 'testResult' ) ).toHaveTextContent(
57
+ '[{"clientId":"efg456","id":2}]'
58
+ );
59
+ } );
60
+
61
+ it( 'sees an image as new if it has been deleted and added again', () => {
62
+ const { rerender } = render(
63
+ <TestComponent
64
+ images={ [
65
+ { clientId: 'abc123', id: 1 },
66
+ { clientId: 'efg456', id: 2 },
67
+ ] }
68
+ imageData={ [ { id: 1 }, { id: 2 } ] }
69
+ />
70
+ );
71
+
72
+ rerender(
73
+ <TestComponent
74
+ images={ [ { clientId: 'abc123', id: 1 } ] }
75
+ imageData={ [ { id: 1 } ] }
76
+ />
77
+ );
78
+
79
+ rerender(
80
+ <TestComponent
81
+ images={ [
82
+ { clientId: 'abc123', id: 1 },
83
+ { clientId: 'efg456', id: 2 },
84
+ ] }
85
+ imageData={ [ { id: 1 }, { id: 2 } ] }
86
+ />
87
+ );
88
+
89
+ expect( screen.getByTitle( 'testResult' ) ).toHaveTextContent(
90
+ '[{"clientId":"efg456","id":2}]'
91
+ );
92
+ } );
93
+ } );
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/group",
4
5
  "title": "Group",
@@ -34,7 +35,13 @@
34
35
  "color": true,
35
36
  "radius": true,
36
37
  "style": true,
37
- "width": true
38
+ "width": true,
39
+ "__experimentalDefaultControls": {
40
+ "color": true,
41
+ "radius": true,
42
+ "style": true,
43
+ "width": true
44
+ }
38
45
  },
39
46
  "__experimentalLayout": true
40
47
  },
@@ -1,6 +1,5 @@
1
- .wp-block-group {
2
- &:where(.has-background) {
3
- // Matches paragraph Block padding
4
- padding: $block-bg-padding--v $block-bg-padding--h;
5
- }
1
+ // Add low specificity default padding to groups with backgrounds.
2
+ :where(.wp-block-group.has-background) {
3
+ // Matches paragraph block padding.
4
+ padding: $block-bg-padding--v $block-bg-padding--h;
6
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/heading",
4
5
  "title": "Heading",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/home-link",
4
5
  "category": "design",
@@ -79,7 +79,7 @@ function block_core_home_link_build_css_font_sizes( $context ) {
79
79
  $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
80
80
  } elseif ( $has_custom_font_size ) {
81
81
  // Add the custom font size inline style.
82
- $font_sizes['inline_styles'] = sprintf( 'font-size: %spx;', $context['style']['typography']['fontSize'] );
82
+ $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] );
83
83
  }
84
84
 
85
85
  return $font_sizes;
@@ -114,9 +114,9 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) {
114
114
  /**
115
115
  * Renders the `core/home-link` block.
116
116
  *
117
- * @param array $attributes The block attributes.
118
- * @param array $content The saved content.
119
- * @param array $block The parsed block.
117
+ * @param array $attributes The block attributes.
118
+ * @param array $content The saved content.
119
+ * @param WP_Block $block The parsed block.
120
120
  *
121
121
  * @return string Returns the post content with the home url added.
122
122
  */
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/html",
4
5
  "title": "Custom HTML",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/image",
4
5
  "title": "Image",
@@ -83,7 +84,10 @@
83
84
  "background": false
84
85
  },
85
86
  "__experimentalBorder": {
86
- "radius": true
87
+ "radius": true,
88
+ "__experimentalDefaultControls": {
89
+ "radius": true
90
+ }
87
91
  }
88
92
  },
89
93
  "styles": [
package/src/image/edit.js CHANGED
@@ -87,6 +87,20 @@ function hasDefaultSize( image, defaultSize ) {
87
87
  );
88
88
  }
89
89
 
90
+ /**
91
+ * Checks if a media attachment object has been "destroyed",
92
+ * that is, removed from the media library. The core Media Library
93
+ * adds a `destroyed` property to a deleted attachment object in the media collection.
94
+ *
95
+ * @param {number} id The attachment id.
96
+ *
97
+ * @return {boolean} Whether the image has been destroyed.
98
+ */
99
+ export function isMediaDestroyed( id ) {
100
+ const attachment = wp?.media?.attachment( id ) || {};
101
+ return attachment.destroyed;
102
+ }
103
+
90
104
  export function ImageEdit( {
91
105
  attributes,
92
106
  setAttributes,
@@ -127,6 +141,33 @@ export function ImageEdit( {
127
141
  return pick( getSettings(), [ 'imageDefaultSize', 'mediaUpload' ] );
128
142
  }, [] );
129
143
 
144
+ // A callback passed to MediaUpload,
145
+ // fired when the media modal closes.
146
+ function onCloseModal() {
147
+ if ( isMediaDestroyed( attributes?.id ) ) {
148
+ setAttributes( {
149
+ url: undefined,
150
+ id: undefined,
151
+ } );
152
+ }
153
+ }
154
+
155
+ /*
156
+ Runs an error callback if the image does not load.
157
+ If the error callback is triggered, we infer that that image
158
+ has been deleted.
159
+ */
160
+ function onImageError( isReplaced = false ) {
161
+ // If the image block was not replaced with an embed,
162
+ // clear the attributes and trigger the placeholder.
163
+ if ( ! isReplaced ) {
164
+ setAttributes( {
165
+ url: undefined,
166
+ id: undefined,
167
+ } );
168
+ }
169
+ }
170
+
130
171
  function onUploadError( message ) {
131
172
  noticeOperations.removeAllNotices();
132
173
  noticeOperations.createErrorNotice( message );
@@ -324,6 +365,8 @@ export function ImageEdit( {
324
365
  containerRef={ ref }
325
366
  context={ context }
326
367
  clientId={ clientId }
368
+ onCloseModal={ onCloseModal }
369
+ onImageLoadError={ onImageError }
327
370
  />
328
371
  ) }
329
372
  { ! url && (
@@ -340,6 +383,7 @@ export function ImageEdit( {
340
383
  onSelectURL={ onSelectURL }
341
384
  notices={ noticeUI }
342
385
  onError={ onUploadError }
386
+ onClose={ onCloseModal }
343
387
  accept="image/*"
344
388
  allowedTypes={ ALLOWED_MEDIA_TYPES }
345
389
  value={ { id, src } }
@@ -134,7 +134,7 @@ function LinkSettings( {
134
134
  url: {
135
135
  valueMask,
136
136
  autoFocus: false,
137
- autoFill: true,
137
+ autoFill: false,
138
138
  },
139
139
  openInNewTab: {
140
140
  label: __( 'Open in new tab' ),
@@ -70,6 +70,24 @@ figure.wp-block-image:not(.wp-block) {
70
70
  }
71
71
  }
72
72
 
73
+ *:not([data-align]) {
74
+ > .wp-block-image {
75
+ display: grid;
76
+ grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
77
+ .components-placeholder {
78
+ grid-column: placeholder;
79
+ }
80
+ > div:not(.components-placeholder) {
81
+ grid-column: image;
82
+ }
83
+ > figcaption {
84
+ grid-column: image;
85
+ display: table-caption;
86
+ caption-side: bottom;
87
+ }
88
+ }
89
+ }
90
+
73
91
  .wp-block[data-align="left"] > .wp-block-image {
74
92
  margin-right: 1em;
75
93
  margin-left: 0;
@@ -30,7 +30,7 @@ import {
30
30
  __experimentalImageEditor as ImageEditor,
31
31
  __experimentalImageEditingProvider as ImageEditingProvider,
32
32
  } from '@wordpress/block-editor';
33
- import { useEffect, useState, useRef } from '@wordpress/element';
33
+ import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
34
34
  import { __, sprintf, isRTL } from '@wordpress/i18n';
35
35
  import { getFilename } from '@wordpress/url';
36
36
  import { createBlock, switchToBlockType } from '@wordpress/blocks';
@@ -43,7 +43,7 @@ import { store as coreStore } from '@wordpress/core-data';
43
43
  */
44
44
  import { createUpgradedEmbedBlock } from '../embed/util';
45
45
  import useClientWidth from './use-client-width';
46
- import { isExternalImage } from './edit';
46
+ import { isExternalImage, isMediaDestroyed } from './edit';
47
47
 
48
48
  /**
49
49
  * Module constants
@@ -72,13 +72,16 @@ export default function Image( {
72
72
  isSelected,
73
73
  insertBlocksAfter,
74
74
  onReplace,
75
+ onCloseModal,
75
76
  onSelectImage,
76
77
  onSelectURL,
77
78
  onUploadError,
78
79
  containerRef,
79
80
  context,
80
81
  clientId,
82
+ onImageLoadError,
81
83
  } ) {
84
+ const imageRef = useRef();
82
85
  const captionRef = useRef();
83
86
  const prevUrl = usePrevious( url );
84
87
  const { allowResize = true } = context;
@@ -141,7 +144,10 @@ export default function Image( {
141
144
  );
142
145
  const isLargeViewport = useViewportMatch( 'medium' );
143
146
  const isWideAligned = includes( [ 'wide', 'full' ], align );
144
- const [ { naturalWidth, naturalHeight }, setNaturalSize ] = useState( {} );
147
+ const [
148
+ { loadedNaturalWidth, loadedNaturalHeight },
149
+ setLoadedNaturalSize,
150
+ ] = useState( {} );
145
151
  const [ isEditingImage, setIsEditingImage ] = useState( false );
146
152
  const [ externalBlob, setExternalBlob ] = useState();
147
153
  const clientWidth = useClientWidth( containerRef, [ align ] );
@@ -179,6 +185,27 @@ export default function Image( {
179
185
  }
180
186
  }, [ url, prevUrl ] );
181
187
 
188
+ // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
189
+ // width and height. This resolves an issue in Safari where the loaded natural
190
+ // witdth and height is otherwise lost when switching between alignments.
191
+ // See: https://github.com/WordPress/gutenberg/pull/37210.
192
+ const { naturalWidth, naturalHeight } = useMemo( () => {
193
+ return {
194
+ naturalWidth:
195
+ imageRef.current?.naturalWidth ||
196
+ loadedNaturalWidth ||
197
+ undefined,
198
+ naturalHeight:
199
+ imageRef.current?.naturalHeight ||
200
+ loadedNaturalHeight ||
201
+ undefined,
202
+ };
203
+ }, [
204
+ loadedNaturalWidth,
205
+ loadedNaturalHeight,
206
+ imageRef.current?.complete,
207
+ ] );
208
+
182
209
  function onResizeStart() {
183
210
  toggleSelection( false );
184
211
  }
@@ -188,11 +215,16 @@ export default function Image( {
188
215
  }
189
216
 
190
217
  function onImageError() {
191
- // Check if there's an embed block that handles this URL.
218
+ // Check if there's an embed block that handles this URL, e.g., instagram URL.
219
+ // See: https://github.com/WordPress/gutenberg/pull/11472
192
220
  const embedBlock = createUpgradedEmbedBlock( { attributes: { url } } );
193
- if ( undefined !== embedBlock ) {
221
+ const shouldReplace = undefined !== embedBlock;
222
+
223
+ if ( shouldReplace ) {
194
224
  onReplace( embedBlock );
195
225
  }
226
+
227
+ onImageLoadError( shouldReplace );
196
228
  }
197
229
 
198
230
  function onSetHref( props ) {
@@ -264,6 +296,9 @@ export default function Image( {
264
296
  if ( ! isSelected ) {
265
297
  setIsEditingImage( false );
266
298
  }
299
+ if ( isSelected && isMediaDestroyed( id ) ) {
300
+ onImageLoadError();
301
+ }
267
302
  }, [ isSelected ] );
268
303
 
269
304
  const canEditImage = id && naturalWidth && naturalHeight && imageEditing;
@@ -327,6 +362,7 @@ export default function Image( {
327
362
  onSelect={ onSelectImage }
328
363
  onSelectURL={ onSelectURL }
329
364
  onError={ onUploadError }
365
+ onCloseModal={ onCloseModal }
330
366
  />
331
367
  </BlockControls>
332
368
  ) }
@@ -411,13 +447,12 @@ export default function Image( {
411
447
  alt={ defaultedAlt }
412
448
  onError={ () => onImageError() }
413
449
  onLoad={ ( event ) => {
414
- setNaturalSize(
415
- pick( event.target, [
416
- 'naturalWidth',
417
- 'naturalHeight',
418
- ] )
419
- );
450
+ setLoadedNaturalSize( {
451
+ loadedNaturalWidth: event.target?.naturalWidth,
452
+ loadedNaturalHeight: event.target?.naturalHeight,
453
+ } );
420
454
  } }
455
+ ref={ imageRef }
421
456
  />
422
457
  { temporaryURL && <Spinner /> }
423
458
  </>
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * @param array $attributes The block attributes.
13
13
  * @param array $content The block content.
14
- * @return string Returns the block content with the data-id attribute added.
14
+ * @return string Returns the block content with the data-id attribute added.
15
15
  */
16
16
  function render_block_core_image( $attributes, $content ) {
17
17
  if ( isset( $attributes['data-id'] ) ) {
package/src/index.js CHANGED
@@ -30,6 +30,8 @@ import * as commentEditLink from './comment-edit-link';
30
30
  import * as commentReplyLink from './comment-reply-link';
31
31
  import * as commentTemplate from './comment-template';
32
32
  import * as commentsQueryLoop from './comments-query-loop';
33
+ import * as commentsPagination from './comments-pagination';
34
+ import * as commentsPaginationNumbers from './comments-pagination-numbers';
33
35
  import * as cover from './cover';
34
36
  import * as embed from './embed';
35
37
  import * as file from './file';
@@ -254,6 +256,8 @@ export const __experimentalRegisterExperimentalCoreBlocks =
254
256
  commentReplyLink,
255
257
  commentTemplate,
256
258
  commentsQueryLoop,
259
+ commentsPagination,
260
+ commentsPaginationNumbers,
257
261
  navigationArea,
258
262
  postComment,
259
263
  postCommentsCount,
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/latest-comments",
4
5
  "title": "Latest Comments",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/latest-posts",
4
5
  "title": "Latest Posts",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/list",
4
5
  "title": "List",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/loginout",
4
5
  "title": "Login/out",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/media-text",
4
5
  "title": "Media & Text",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/missing",
4
5
  "title": "Unsupported",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/more",
4
5
  "title": "More",
@@ -0,0 +1,13 @@
1
+ # Navigation block
2
+
3
+ The Navigation block is a container block for the collection of blocks that allow visitors to get around your site. See also the Navigation Link block and Navigation Submenu block.
4
+
5
+ ## CSS Classes
6
+
7
+ The structural CSS for the navigation block targets generic classnames across menu items of multiple types including those automatically generated by the Page List block. Here are some of the notable classnames and what they are used for:
8
+
9
+ - `.wp-block-navigation__submenu-container` is applied to submenus to main menu items.
10
+ - `.wp-block-navigation-item` is applied to every menu item.
11
+ - `.wp-block-navigation-item__content` is applied to the link inside a menu item.
12
+ - `.wp-block-navigation-item__label` is applied to the innermost container around the menu item text label.
13
+ - `.wp-block-navigation__submenu-icon` is applied to the submenu indicator (chevron).
@@ -1,14 +1,11 @@
1
1
  {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
2
3
  "apiVersion": 2,
3
4
  "name": "core/navigation",
4
5
  "title": "Navigation",
5
6
  "category": "theme",
6
7
  "description": "A collection of blocks that allow visitors to get around your site.",
7
- "keywords": [
8
- "menu",
9
- "navigation",
10
- "links"
11
- ],
8
+ "keywords": [ "menu", "navigation", "links" ],
12
9
  "textdomain": "default",
13
10
  "attributes": {
14
11
  "ref": {
@@ -78,10 +75,7 @@
78
75
  "orientation": "orientation"
79
76
  },
80
77
  "supports": {
81
- "align": [
82
- "wide",
83
- "full"
84
- ],
78
+ "align": [ "wide", "full" ],
85
79
  "anchor": true,
86
80
  "html": false,
87
81
  "inserter": true,
@@ -99,13 +93,7 @@
99
93
  },
100
94
  "spacing": {
101
95
  "blockGap": true,
102
- "units": [
103
- "px",
104
- "em",
105
- "rem",
106
- "vh",
107
- "vw"
108
- ],
96
+ "units": [ "px", "em", "rem", "vh", "vw" ],
109
97
  "__experimentalDefaultControls": {
110
98
  "blockGap": true
111
99
  }
@@ -2,6 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
+ import noop from 'lodash';
5
6
 
6
7
  /**
7
8
  * WordPress dependencies
@@ -109,12 +110,19 @@ function Navigation( {
109
110
  layout: { justifyContent, orientation = 'horizontal' } = {},
110
111
  } = attributes;
111
112
 
112
- const [ areaMenu, setAreaMenu ] = useEntityProp(
113
- 'root',
114
- 'navigationArea',
115
- 'navigation',
116
- navigationArea
117
- );
113
+ let areaMenu,
114
+ setAreaMenu = noop;
115
+ // Navigation areas are deprecated and on their way out. Let's not perform
116
+ // the request unless we're in an environment where the endpoint exists.
117
+ if ( process.env.GUTENBERG_PHASE === 2 ) {
118
+ // eslint-disable-next-line react-hooks/rules-of-hooks
119
+ [ areaMenu, setAreaMenu ] = useEntityProp(
120
+ 'root',
121
+ 'navigationArea',
122
+ 'navigation',
123
+ navigationArea
124
+ );
125
+ }
118
126
 
119
127
  const navigationAreaMenu = areaMenu === 0 ? undefined : areaMenu;
120
128
 
@@ -134,13 +142,19 @@ function Navigation( {
134
142
  `navigationMenu/${ ref }`
135
143
  );
136
144
 
137
- const { innerBlocks, isInnerBlockSelected } = useSelect(
145
+ const { innerBlocks, isInnerBlockSelected, hasSubmenus } = useSelect(
138
146
  ( select ) => {
139
147
  const { getBlocks, hasSelectedInnerBlock } = select(
140
148
  blockEditorStore
141
149
  );
150
+ const blocks = getBlocks( clientId );
151
+ const firstSubmenu = !! blocks.find(
152
+ ( block ) => block.name === 'core/navigation-submenu'
153
+ );
154
+
142
155
  return {
143
- innerBlocks: getBlocks( clientId ),
156
+ hasSubmenus: firstSubmenu,
157
+ innerBlocks: blocks,
144
158
  isInnerBlockSelected: hasSelectedInnerBlock( clientId, true ),
145
159
  };
146
160
  },
@@ -411,26 +425,35 @@ function Navigation( {
411
425
  label={ __( 'Always' ) }
412
426
  />
413
427
  </ToggleGroupControl>
414
- <h3>{ __( 'Submenus' ) }</h3>
415
- <ToggleControl
416
- checked={ openSubmenusOnClick }
417
- onChange={ ( value ) => {
418
- setAttributes( {
419
- openSubmenusOnClick: value,
420
- } );
421
- } }
422
- label={ __( 'Open on click' ) }
423
- />
424
- { ! attributes.openSubmenusOnClick && (
425
- <ToggleControl
426
- checked={ showSubmenuIcon }
427
- onChange={ ( value ) => {
428
- setAttributes( {
429
- showSubmenuIcon: value,
430
- } );
431
- } }
432
- label={ __( 'Show icons' ) }
433
- />
428
+ { hasSubmenus && (
429
+ <>
430
+ <h3>{ __( 'Submenus' ) }</h3>
431
+ <ToggleControl
432
+ checked={ openSubmenusOnClick }
433
+ onChange={ ( value ) => {
434
+ setAttributes( {
435
+ openSubmenusOnClick: value,
436
+ ...( value && {
437
+ showSubmenuIcon: true,
438
+ } ), // Make sure arrows are shown when we toggle this on.
439
+ } );
440
+ } }
441
+ label={ __( 'Open on click' ) }
442
+ />
443
+
444
+ <ToggleControl
445
+ checked={ showSubmenuIcon }
446
+ onChange={ ( value ) => {
447
+ setAttributes( {
448
+ showSubmenuIcon: value,
449
+ } );
450
+ } }
451
+ disabled={
452
+ attributes.openSubmenusOnClick
453
+ }
454
+ label={ __( 'Show arrow' ) }
455
+ />
456
+ </>
434
457
  ) }
435
458
  </PanelBody>
436
459
  ) }