@wordpress/block-library 7.17.0 → 7.19.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 (374) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/audio/edit.js +44 -4
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/button/deprecated.js +16 -2
  5. package/build/button/deprecated.js.map +1 -1
  6. package/build/button/edit.js +14 -8
  7. package/build/button/edit.js.map +1 -1
  8. package/build/button/index.js +4 -1
  9. package/build/button/index.js.map +1 -1
  10. package/build/button/save.js +2 -0
  11. package/build/button/save.js.map +1 -1
  12. package/build/buttons/edit.native.js +1 -1
  13. package/build/buttons/edit.native.js.map +1 -1
  14. package/build/columns/transforms.js +5 -0
  15. package/build/columns/transforms.js.map +1 -1
  16. package/build/comment-template/index.js +6 -2
  17. package/build/comment-template/index.js.map +1 -1
  18. package/build/cover/edit/index.js +3 -1
  19. package/build/cover/edit/index.js.map +1 -1
  20. package/build/cover/edit/inspector-controls.js +3 -7
  21. package/build/cover/edit/inspector-controls.js.map +1 -1
  22. package/build/embed/deprecated.js +43 -4
  23. package/build/embed/deprecated.js.map +1 -1
  24. package/build/file/deprecated.js +108 -4
  25. package/build/file/deprecated.js.map +1 -1
  26. package/build/file/transforms.js +3 -9
  27. package/build/file/transforms.js.map +1 -1
  28. package/build/gallery/deprecated.js +148 -23
  29. package/build/gallery/deprecated.js.map +1 -1
  30. package/build/gallery/gallery.js +3 -2
  31. package/build/gallery/gallery.js.map +1 -1
  32. package/build/gallery/use-image-sizes.js +2 -1
  33. package/build/gallery/use-image-sizes.js.map +1 -1
  34. package/build/gallery/v1/edit.js +6 -3
  35. package/build/gallery/v1/edit.js.map +1 -1
  36. package/build/group/edit.js +105 -48
  37. package/build/group/edit.js.map +1 -1
  38. package/build/group/index.js +3 -0
  39. package/build/group/index.js.map +1 -1
  40. package/build/group/placeholder.js +168 -0
  41. package/build/group/placeholder.js.map +1 -0
  42. package/build/group/variations.js +3 -3
  43. package/build/group/variations.js.map +1 -1
  44. package/build/image/edit.native.js +1 -1
  45. package/build/image/edit.native.js.map +1 -1
  46. package/build/image/image.js +6 -9
  47. package/build/image/image.js.map +1 -1
  48. package/build/latest-comments/edit.js +2 -1
  49. package/build/latest-comments/edit.js.map +1 -1
  50. package/build/latest-comments/index.js +5 -1
  51. package/build/latest-comments/index.js.map +1 -1
  52. package/build/latest-posts/deprecated.js +13 -0
  53. package/build/latest-posts/deprecated.js.map +1 -1
  54. package/build/latest-posts/edit.js +1 -1
  55. package/build/latest-posts/edit.js.map +1 -1
  56. package/build/latest-posts/index.js +13 -0
  57. package/build/latest-posts/index.js.map +1 -1
  58. package/build/list/utils.js +4 -8
  59. package/build/list/utils.js.map +1 -1
  60. package/build/list-item/edit.js +2 -1
  61. package/build/list-item/edit.js.map +1 -1
  62. package/build/list-item/hooks/use-outdent-list-item.js +5 -7
  63. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  64. package/build/navigation/edit/index.js +94 -103
  65. package/build/navigation/edit/index.js.map +1 -1
  66. package/build/navigation/edit/manage-menus-button.js +36 -0
  67. package/build/navigation/edit/manage-menus-button.js.map +1 -0
  68. package/build/navigation/edit/navigation-menu-selector.js +12 -5
  69. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  70. package/build/navigation/edit/responsive-wrapper.js +2 -6
  71. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  72. package/build/navigation/edit/unsaved-inner-blocks.js +5 -17
  73. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  74. package/build/navigation-link/edit.js +14 -3
  75. package/build/navigation-link/edit.js.map +1 -1
  76. package/build/navigation-submenu/edit.js +4 -4
  77. package/build/navigation-submenu/edit.js.map +1 -1
  78. package/build/page-list/edit.js +29 -10
  79. package/build/page-list/edit.js.map +1 -1
  80. package/build/post-author/edit.js +35 -20
  81. package/build/post-author/edit.js.map +1 -1
  82. package/build/post-comments-count/index.js +4 -0
  83. package/build/post-comments-count/index.js.map +1 -1
  84. package/build/post-comments-form/index.js +4 -0
  85. package/build/post-comments-form/index.js.map +1 -1
  86. package/build/post-comments-link/index.js +4 -0
  87. package/build/post-comments-link/index.js.map +1 -1
  88. package/build/post-content/edit.js +14 -6
  89. package/build/post-content/edit.js.map +1 -1
  90. package/build/post-content/index.js +3 -0
  91. package/build/post-content/index.js.map +1 -1
  92. package/build/pullquote/deprecated.js +6 -6
  93. package/build/pullquote/deprecated.js.map +1 -1
  94. package/build/search/edit.js +1 -3
  95. package/build/search/edit.js.map +1 -1
  96. package/build/site-logo/edit.js +2 -2
  97. package/build/site-logo/edit.js.map +1 -1
  98. package/build/site-tagline/edit.js +21 -9
  99. package/build/site-tagline/edit.js.map +1 -1
  100. package/build/site-title/edit/index.js +20 -8
  101. package/build/site-title/edit/index.js.map +1 -1
  102. package/build/social-link/edit.js +11 -2
  103. package/build/social-link/edit.js.map +1 -1
  104. package/build/social-link/index.js +3 -0
  105. package/build/social-link/index.js.map +1 -1
  106. package/build/spacer/controls.js +3 -7
  107. package/build/spacer/controls.js.map +1 -1
  108. package/build/table/deprecated.js +282 -27
  109. package/build/table/deprecated.js.map +1 -1
  110. package/build/table/state.js +1 -1
  111. package/build/table/state.js.map +1 -1
  112. package/build/template-part/variations.js +5 -0
  113. package/build/template-part/variations.js.map +1 -1
  114. package/build/utils/clean-empty-object.js +5 -4
  115. package/build/utils/clean-empty-object.js.map +1 -1
  116. package/build/video/deprecated.js +159 -0
  117. package/build/video/deprecated.js.map +1 -0
  118. package/build/video/edit.js +41 -5
  119. package/build/video/edit.js.map +1 -1
  120. package/build/video/index.js +3 -0
  121. package/build/video/index.js.map +1 -1
  122. package/build/video/tracks-editor.js +3 -28
  123. package/build/video/tracks-editor.js.map +1 -1
  124. package/build-module/audio/edit.js +46 -7
  125. package/build-module/audio/edit.js.map +1 -1
  126. package/build-module/button/deprecated.js +16 -2
  127. package/build-module/button/deprecated.js.map +1 -1
  128. package/build-module/button/edit.js +16 -10
  129. package/build-module/button/edit.js.map +1 -1
  130. package/build-module/button/index.js +4 -1
  131. package/build-module/button/index.js.map +1 -1
  132. package/build-module/button/save.js +2 -0
  133. package/build-module/button/save.js.map +1 -1
  134. package/build-module/buttons/edit.native.js +1 -1
  135. package/build-module/buttons/edit.native.js.map +1 -1
  136. package/build-module/columns/transforms.js +5 -0
  137. package/build-module/columns/transforms.js.map +1 -1
  138. package/build-module/comment-template/index.js +6 -2
  139. package/build-module/comment-template/index.js.map +1 -1
  140. package/build-module/cover/edit/index.js +3 -1
  141. package/build-module/cover/edit/index.js.map +1 -1
  142. package/build-module/cover/edit/inspector-controls.js +4 -8
  143. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  144. package/build-module/embed/deprecated.js +44 -5
  145. package/build-module/embed/deprecated.js.map +1 -1
  146. package/build-module/file/deprecated.js +108 -4
  147. package/build-module/file/deprecated.js.map +1 -1
  148. package/build-module/file/transforms.js +3 -8
  149. package/build-module/file/transforms.js.map +1 -1
  150. package/build-module/gallery/deprecated.js +147 -25
  151. package/build-module/gallery/deprecated.js.map +1 -1
  152. package/build-module/gallery/gallery.js +3 -2
  153. package/build-module/gallery/gallery.js.map +1 -1
  154. package/build-module/gallery/use-image-sizes.js +3 -2
  155. package/build-module/gallery/use-image-sizes.js.map +1 -1
  156. package/build-module/gallery/v1/edit.js +7 -4
  157. package/build-module/gallery/v1/edit.js.map +1 -1
  158. package/build-module/group/edit.js +101 -48
  159. package/build-module/group/edit.js.map +1 -1
  160. package/build-module/group/index.js +3 -0
  161. package/build-module/group/index.js.map +1 -1
  162. package/build-module/group/placeholder.js +154 -0
  163. package/build-module/group/placeholder.js.map +1 -0
  164. package/build-module/group/variations.js +3 -3
  165. package/build-module/group/variations.js.map +1 -1
  166. package/build-module/image/edit.native.js +1 -1
  167. package/build-module/image/edit.native.js.map +1 -1
  168. package/build-module/image/image.js +8 -11
  169. package/build-module/image/image.js.map +1 -1
  170. package/build-module/latest-comments/edit.js +2 -1
  171. package/build-module/latest-comments/edit.js.map +1 -1
  172. package/build-module/latest-comments/index.js +5 -1
  173. package/build-module/latest-comments/index.js.map +1 -1
  174. package/build-module/latest-posts/deprecated.js +13 -0
  175. package/build-module/latest-posts/deprecated.js.map +1 -1
  176. package/build-module/latest-posts/edit.js +2 -2
  177. package/build-module/latest-posts/edit.js.map +1 -1
  178. package/build-module/latest-posts/index.js +13 -0
  179. package/build-module/latest-posts/index.js.map +1 -1
  180. package/build-module/list/utils.js +5 -9
  181. package/build-module/list/utils.js.map +1 -1
  182. package/build-module/list-item/edit.js +2 -1
  183. package/build-module/list-item/edit.js.map +1 -1
  184. package/build-module/list-item/hooks/use-outdent-list-item.js +5 -6
  185. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  186. package/build-module/navigation/edit/index.js +96 -105
  187. package/build-module/navigation/edit/index.js.map +1 -1
  188. package/build-module/navigation/edit/manage-menus-button.js +26 -0
  189. package/build-module/navigation/edit/manage-menus-button.js.map +1 -0
  190. package/build-module/navigation/edit/navigation-menu-selector.js +13 -6
  191. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  192. package/build-module/navigation/edit/responsive-wrapper.js +2 -6
  193. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  194. package/build-module/navigation/edit/unsaved-inner-blocks.js +7 -18
  195. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  196. package/build-module/navigation-link/edit.js +14 -4
  197. package/build-module/navigation-link/edit.js.map +1 -1
  198. package/build-module/navigation-submenu/edit.js +4 -4
  199. package/build-module/navigation-submenu/edit.js.map +1 -1
  200. package/build-module/page-list/edit.js +29 -10
  201. package/build-module/page-list/edit.js.map +1 -1
  202. package/build-module/post-author/edit.js +35 -21
  203. package/build-module/post-author/edit.js.map +1 -1
  204. package/build-module/post-comments-count/index.js +4 -0
  205. package/build-module/post-comments-count/index.js.map +1 -1
  206. package/build-module/post-comments-form/index.js +4 -0
  207. package/build-module/post-comments-form/index.js.map +1 -1
  208. package/build-module/post-comments-link/index.js +4 -0
  209. package/build-module/post-comments-link/index.js.map +1 -1
  210. package/build-module/post-content/edit.js +14 -6
  211. package/build-module/post-content/edit.js.map +1 -1
  212. package/build-module/post-content/index.js +3 -0
  213. package/build-module/post-content/index.js.map +1 -1
  214. package/build-module/pullquote/deprecated.js +7 -7
  215. package/build-module/pullquote/deprecated.js.map +1 -1
  216. package/build-module/search/edit.js +1 -3
  217. package/build-module/search/edit.js.map +1 -1
  218. package/build-module/site-logo/edit.js +3 -3
  219. package/build-module/site-logo/edit.js.map +1 -1
  220. package/build-module/site-tagline/edit.js +23 -11
  221. package/build-module/site-tagline/edit.js.map +1 -1
  222. package/build-module/site-title/edit/index.js +22 -10
  223. package/build-module/site-title/edit/index.js.map +1 -1
  224. package/build-module/social-link/edit.js +11 -2
  225. package/build-module/social-link/edit.js.map +1 -1
  226. package/build-module/social-link/index.js +3 -0
  227. package/build-module/social-link/index.js.map +1 -1
  228. package/build-module/spacer/controls.js +4 -8
  229. package/build-module/spacer/controls.js.map +1 -1
  230. package/build-module/table/deprecated.js +282 -27
  231. package/build-module/table/deprecated.js.map +1 -1
  232. package/build-module/table/state.js +1 -1
  233. package/build-module/table/state.js.map +1 -1
  234. package/build-module/template-part/variations.js +5 -0
  235. package/build-module/template-part/variations.js.map +1 -1
  236. package/build-module/utils/clean-empty-object.js +5 -5
  237. package/build-module/utils/clean-empty-object.js.map +1 -1
  238. package/build-module/video/deprecated.js +147 -0
  239. package/build-module/video/deprecated.js.map +1 -0
  240. package/build-module/video/edit.js +45 -9
  241. package/build-module/video/edit.js.map +1 -1
  242. package/build-module/video/index.js +2 -0
  243. package/build-module/video/index.js.map +1 -1
  244. package/build-module/video/tracks-editor.js +4 -29
  245. package/build-module/video/tracks-editor.js.map +1 -1
  246. package/build-style/button/style-rtl.css +1 -0
  247. package/build-style/button/style.css +1 -0
  248. package/build-style/comment-template/style-rtl.css +1 -0
  249. package/build-style/comment-template/style.css +1 -0
  250. package/build-style/editor-rtl.css +80 -5
  251. package/build-style/editor.css +80 -5
  252. package/build-style/group/editor-rtl.css +44 -0
  253. package/build-style/group/editor.css +44 -0
  254. package/build-style/latest-comments/style-rtl.css +1 -0
  255. package/build-style/latest-comments/style.css +1 -0
  256. package/build-style/latest-posts/style-rtl.css +3 -0
  257. package/build-style/latest-posts/style.css +3 -0
  258. package/build-style/navigation/editor-rtl.css +27 -4
  259. package/build-style/navigation/editor.css +27 -4
  260. package/build-style/navigation/style-rtl.css +13 -1
  261. package/build-style/navigation/style.css +13 -1
  262. package/build-style/navigation-link/editor-rtl.css +8 -1
  263. package/build-style/navigation-link/editor.css +8 -1
  264. package/build-style/post-comments-form/style-rtl.css +3 -0
  265. package/build-style/post-comments-form/style.css +3 -0
  266. package/build-style/query/editor-rtl.css +1 -1
  267. package/build-style/query/editor.css +1 -1
  268. package/build-style/query-pagination/style-rtl.css +1 -1
  269. package/build-style/query-pagination/style.css +1 -1
  270. package/build-style/style-rtl.css +28 -2
  271. package/build-style/style.css +28 -2
  272. package/build-style/table/editor-rtl.css +1 -0
  273. package/build-style/table/editor.css +1 -0
  274. package/build-style/table/style-rtl.css +5 -0
  275. package/build-style/table/style.css +5 -0
  276. package/build-style/table/theme-rtl.css +1 -3
  277. package/build-style/table/theme.css +1 -3
  278. package/build-style/theme-rtl.css +1 -3
  279. package/build-style/theme.css +1 -3
  280. package/package.json +29 -28
  281. package/src/audio/edit.js +79 -24
  282. package/src/avatar/index.php +1 -1
  283. package/src/block/test/edit.native.js +8 -8
  284. package/src/button/block.json +4 -1
  285. package/src/button/deprecated.js +18 -2
  286. package/src/button/edit.js +12 -10
  287. package/src/button/save.js +12 -2
  288. package/src/button/style.scss +2 -0
  289. package/src/buttons/edit.native.js +1 -1
  290. package/src/buttons/test/edit.native.js +19 -19
  291. package/src/columns/test/edit.native.js +32 -32
  292. package/src/columns/transforms.js +8 -0
  293. package/src/comment-template/block.json +6 -2
  294. package/src/comment-template/style.scss +2 -0
  295. package/src/cover/edit/index.js +3 -1
  296. package/src/cover/edit/inspector-controls.js +11 -13
  297. package/src/cover/test/edit.native.js +26 -26
  298. package/src/embed/deprecated.js +53 -26
  299. package/src/embed/test/index.native.js +43 -43
  300. package/src/file/deprecated.js +130 -2
  301. package/src/file/transforms.js +3 -8
  302. package/src/gallery/deprecated.js +129 -4
  303. package/src/gallery/gallery.js +2 -0
  304. package/src/gallery/index.php +19 -10
  305. package/src/gallery/test/index.native.js +11 -11
  306. package/src/gallery/use-image-sizes.js +3 -2
  307. package/src/gallery/v1/edit.js +21 -25
  308. package/src/group/block.json +3 -0
  309. package/src/group/edit.js +105 -46
  310. package/src/group/editor.scss +48 -0
  311. package/src/group/placeholder.js +187 -0
  312. package/src/group/test/edit.native.js +3 -3
  313. package/src/group/test/placeholder.js +78 -0
  314. package/src/group/variations.js +3 -3
  315. package/src/image/edit.native.js +1 -1
  316. package/src/image/image.js +22 -10
  317. package/src/image/test/edit.native.js +17 -17
  318. package/src/latest-comments/block.json +5 -1
  319. package/src/latest-comments/edit.js +1 -0
  320. package/src/latest-comments/style.scss +3 -0
  321. package/src/latest-posts/block.json +13 -0
  322. package/src/latest-posts/edit.js +2 -2
  323. package/src/latest-posts/style.scss +3 -0
  324. package/src/list/test/edit.native.js +36 -36
  325. package/src/list/utils.js +3 -11
  326. package/src/list-item/edit.js +1 -0
  327. package/src/list-item/hooks/use-outdent-list-item.js +3 -6
  328. package/src/missing/test/edit-integration.native.js +5 -5
  329. package/src/navigation/edit/index.js +186 -161
  330. package/src/navigation/edit/manage-menus-button.js +21 -0
  331. package/src/navigation/edit/navigation-menu-selector.js +20 -5
  332. package/src/navigation/edit/responsive-wrapper.js +2 -10
  333. package/src/navigation/edit/unsaved-inner-blocks.js +5 -22
  334. package/src/navigation/editor.scss +29 -4
  335. package/src/navigation/style.scss +19 -1
  336. package/src/navigation-link/edit.js +13 -4
  337. package/src/navigation-link/editor.scss +8 -0
  338. package/src/navigation-submenu/edit.js +7 -5
  339. package/src/page-list/edit.js +36 -22
  340. package/src/post-author/edit.js +44 -20
  341. package/src/post-comments-count/block.json +4 -0
  342. package/src/post-comments-form/block.json +4 -0
  343. package/src/post-comments-form/style.scss +3 -0
  344. package/src/post-comments-link/block.json +4 -0
  345. package/src/post-content/block.json +3 -0
  346. package/src/post-content/edit.js +8 -4
  347. package/src/pullquote/deprecated.js +7 -7
  348. package/src/query/editor.scss +1 -1
  349. package/src/query-pagination/style.scss +1 -1
  350. package/src/read-more/index.php +9 -2
  351. package/src/search/edit.js +1 -1
  352. package/src/shortcode/test/edit.native.js +5 -5
  353. package/src/site-logo/edit.js +3 -3
  354. package/src/site-tagline/edit.js +25 -18
  355. package/src/site-title/edit/index.js +26 -12
  356. package/src/social-link/block.json +3 -0
  357. package/src/social-link/edit.js +8 -1
  358. package/src/social-link/index.php +11 -7
  359. package/src/social-link/test/index.native.js +10 -10
  360. package/src/social-links/test/edit.native.js +4 -4
  361. package/src/spacer/controls.js +10 -12
  362. package/src/spacer/test/index.native.js +17 -17
  363. package/src/table/deprecated.js +587 -348
  364. package/src/table/editor.scss +1 -0
  365. package/src/table/state.js +1 -1
  366. package/src/table/style.scss +7 -0
  367. package/src/table/theme.scss +1 -3
  368. package/src/template-part/index.php +5 -0
  369. package/src/template-part/variations.js +4 -0
  370. package/src/utils/clean-empty-object.js +5 -6
  371. package/src/video/deprecated.js +57 -0
  372. package/src/video/edit.js +71 -23
  373. package/src/video/index.js +2 -0
  374. package/src/video/tracks-editor.js +12 -28
@@ -15,24 +15,82 @@ var _components = require("@wordpress/components");
15
15
 
16
16
  var _i18n = require("@wordpress/i18n");
17
17
 
18
+ var _placeholder = _interopRequireWildcard(require("./placeholder"));
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
18
24
  /**
19
25
  * WordPress dependencies
20
26
  */
21
- const htmlElementMessages = {
22
- header: (0, _i18n.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
23
- main: (0, _i18n.__)('The <main> element should be used for the primary content of your document only. '),
24
- section: (0, _i18n.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
25
- article: (0, _i18n.__)('The <article> element should represent a self contained, syndicatable portion of the document.'),
26
- aside: (0, _i18n.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
27
- footer: (0, _i18n.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
28
- };
29
-
30
- function GroupEdit(_ref) {
27
+
28
+ /**
29
+ * Internal dependencies
30
+ */
31
+
32
+ /**
33
+ * Render inspector controls for the Group block.
34
+ *
35
+ * @param {Object} props Component props.
36
+ * @param {string} props.tagName The HTML tag name.
37
+ * @param {Function} props.onSelectTagName onChange function for the SelectControl.
38
+ *
39
+ * @return {JSX.Element} The control group.
40
+ */
41
+ function GroupEditControls(_ref) {
42
+ let {
43
+ tagName,
44
+ onSelectTagName
45
+ } = _ref;
46
+ const htmlElementMessages = {
47
+ header: (0, _i18n.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
48
+ main: (0, _i18n.__)('The <main> element should be used for the primary content of your document only. '),
49
+ section: (0, _i18n.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
50
+ article: (0, _i18n.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'),
51
+ aside: (0, _i18n.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
52
+ footer: (0, _i18n.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
53
+ };
54
+ return (0, _element.createElement)(_blockEditor.InspectorControls, {
55
+ __experimentalGroup: "advanced"
56
+ }, (0, _element.createElement)(_components.SelectControl, {
57
+ label: (0, _i18n.__)('HTML element'),
58
+ options: [{
59
+ label: (0, _i18n.__)('Default (<div>)'),
60
+ value: 'div'
61
+ }, {
62
+ label: '<header>',
63
+ value: 'header'
64
+ }, {
65
+ label: '<main>',
66
+ value: 'main'
67
+ }, {
68
+ label: '<section>',
69
+ value: 'section'
70
+ }, {
71
+ label: '<article>',
72
+ value: 'article'
73
+ }, {
74
+ label: '<aside>',
75
+ value: 'aside'
76
+ }, {
77
+ label: '<footer>',
78
+ value: 'footer'
79
+ }],
80
+ value: tagName,
81
+ onChange: onSelectTagName,
82
+ help: htmlElementMessages[tagName]
83
+ }));
84
+ }
85
+
86
+ function GroupEdit(_ref2) {
31
87
  let {
32
88
  attributes,
89
+ name,
33
90
  setAttributes,
34
- clientId
35
- } = _ref;
91
+ clientId,
92
+ __unstableLayoutClassNames: layoutClassNames
93
+ } = _ref2;
36
94
  const {
37
95
  hasInnerBlocks,
38
96
  themeSupportsLayout
@@ -49,12 +107,13 @@ function GroupEdit(_ref) {
49
107
  themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
50
108
  };
51
109
  }, [clientId]);
52
- const defaultLayout = (0, _blockEditor.useSetting)('layout') || {};
53
110
  const {
54
111
  tagName: TagName = 'div',
55
112
  templateLock,
56
113
  layout = {}
57
- } = attributes;
114
+ } = attributes; // Layout settings.
115
+
116
+ const defaultLayout = (0, _blockEditor.useSetting)('layout') || {};
58
117
  const usedLayout = !(layout !== null && layout !== void 0 && layout.type) ? { ...defaultLayout,
59
118
  ...layout,
60
119
  type: 'default'
@@ -64,47 +123,45 @@ function GroupEdit(_ref) {
64
123
  const {
65
124
  type = 'default'
66
125
  } = usedLayout;
67
- const layoutSupportEnabled = themeSupportsLayout || type === 'flex';
68
- const blockProps = (0, _blockEditor.useBlockProps)();
126
+ const layoutSupportEnabled = themeSupportsLayout || type === 'flex'; // Hooks.
127
+
128
+ const blockProps = (0, _blockEditor.useBlockProps)({
129
+ className: !layoutSupportEnabled ? layoutClassNames : null
130
+ });
131
+ const [showPlaceholder, setShowPlaceholder] = (0, _placeholder.useShouldShowPlaceHolder)({
132
+ attributes,
133
+ usedLayoutType: usedLayout === null || usedLayout === void 0 ? void 0 : usedLayout.type,
134
+ hasInnerBlocks
135
+ });
69
136
  const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
70
137
  className: 'wp-block-group__inner-container'
71
138
  }, {
72
139
  templateLock,
73
140
  renderAppender: hasInnerBlocks ? undefined : _blockEditor.InnerBlocks.ButtonBlockAppender,
74
- __experimentalLayout: layoutSupportEnabled ? usedLayout : undefined
141
+ __experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,
142
+ __unstableDisableLayoutClassNames: !layoutSupportEnabled
75
143
  });
76
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.InspectorControls, {
77
- __experimentalGroup: "advanced"
78
- }, (0, _element.createElement)(_components.SelectControl, {
79
- label: (0, _i18n.__)('HTML element'),
80
- options: [{
81
- label: (0, _i18n.__)('Default (<div>)'),
82
- value: 'div'
83
- }, {
84
- label: '<header>',
85
- value: 'header'
86
- }, {
87
- label: '<main>',
88
- value: 'main'
89
- }, {
90
- label: '<section>',
91
- value: 'section'
92
- }, {
93
- label: '<article>',
94
- value: 'article'
95
- }, {
96
- label: '<aside>',
97
- value: 'aside'
98
- }, {
99
- label: '<footer>',
100
- value: 'footer'
101
- }],
102
- value: TagName,
103
- onChange: value => setAttributes({
144
+ const {
145
+ selectBlock
146
+ } = (0, _data.useDispatch)(_blockEditor.store);
147
+ const updateSelection = (0, _element.useCallback)(newClientId => selectBlock(newClientId, -1), [selectBlock]);
148
+
149
+ const selectVariation = nextVariation => {
150
+ setAttributes(nextVariation.attributes);
151
+ updateSelection(clientId);
152
+ setShowPlaceholder(false);
153
+ };
154
+
155
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(GroupEditControls, {
156
+ tagName: TagName,
157
+ onSelectTagName: value => setAttributes({
104
158
  tagName: value
105
- }),
106
- help: htmlElementMessages[TagName]
107
- })), layoutSupportEnabled && (0, _element.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && (0, _element.createElement)(TagName, blockProps, (0, _element.createElement)("div", innerBlocksProps)));
159
+ })
160
+ }), showPlaceholder && (0, _element.createElement)(_placeholder.default, {
161
+ clientId: clientId,
162
+ name: name,
163
+ onSelect: selectVariation
164
+ }), layoutSupportEnabled && !showPlaceholder && (0, _element.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && !showPlaceholder && (0, _element.createElement)(TagName, blockProps, (0, _element.createElement)("div", innerBlocksProps)));
108
165
  }
109
166
 
110
167
  var _default = GroupEdit;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/group/edit.js"],"names":["htmlElementMessages","header","main","section","article","aside","footer","GroupEdit","attributes","setAttributes","clientId","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","blockEditorStore","block","innerBlocks","length","supportsLayout","defaultLayout","tagName","TagName","templateLock","layout","usedLayout","type","layoutSupportEnabled","blockProps","innerBlocksProps","className","renderAppender","undefined","InnerBlocks","ButtonBlockAppender","__experimentalLayout","label","value"],"mappings":";;;;;;;;;AAGA;;AAEA;;AAQA;;AACA;;AAdA;AACA;AACA;AAcA,MAAMA,mBAAmB,GAAG;AAC3BC,EA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V7B,aAAa,CAAE;AAAEa,MAAAA,OAAO,EAAEgB;AAAX,KAAF,CAbf;AAeC,IAAA,IAAI,EAAGtC,mBAAmB,CAAEuB,OAAF;AAf3B,IADD,CADD,EAoBGK,oBAAoB,IAAI,4BAAC,OAAD,EAAcE,gBAAd,CApB3B,EAuBG,CAAEF,oBAAF,IACD,4BAAC,OAAD,EAAcC,UAAd,EACC,mCAAUC,gBAAV,CADD,CAxBF,CADD;AA+BA;;eAEcvB,S","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst htmlElementMessages = {\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only. '\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n\tarticle: __(\n\t\t'The <article> element should represent a self contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n};\n\nfunction GroupEdit( { attributes, setAttributes, clientId } ) {\n\tconst { hasInnerBlocks, themeSupportsLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t\tthemeSupportsLayout: getSettings()?.supportsLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst { tagName: TagName = 'div', templateLock, layout = {} } = attributes;\n\tconst usedLayout = ! layout?.type\n\t\t? { ...defaultLayout, ...layout, type: 'default' }\n\t\t: { ...defaultLayout, ...layout };\n\tconst { type = 'default' } = usedLayout;\n\tconst layoutSupportEnabled = themeSupportsLayout || type === 'flex';\n\n\tconst blockProps = useBlockProps();\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\tlayoutSupportEnabled\n\t\t\t? blockProps\n\t\t\t: { className: 'wp-block-group__inner-container' },\n\t\t{\n\t\t\ttemplateLock,\n\t\t\trenderAppender: hasInnerBlocks\n\t\t\t\t? undefined\n\t\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\t\t__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,\n\t\t}\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls __experimentalGroup=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ layoutSupportEnabled && <TagName { ...innerBlocksProps } /> }\n\t\t\t{ /* Ideally this is not needed but it's there for backward compatibility reason\n\t\t\t\tto keep this div for themes that might rely on its presence */ }\n\t\t\t{ ! layoutSupportEnabled && (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t</TagName>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default GroupEdit;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/edit.js"],"names":["GroupEditControls","tagName","onSelectTagName","htmlElementMessages","header","main","section","article","aside","footer","label","value","GroupEdit","attributes","name","setAttributes","clientId","__unstableLayoutClassNames","layoutClassNames","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","blockEditorStore","block","innerBlocks","length","supportsLayout","TagName","templateLock","layout","defaultLayout","usedLayout","type","layoutSupportEnabled","blockProps","className","showPlaceholder","setShowPlaceholder","usedLayoutType","innerBlocksProps","renderAppender","undefined","InnerBlocks","ButtonBlockAppender","__experimentalLayout","__unstableDisableLayoutClassNames","selectBlock","updateSelection","newClientId","selectVariation","nextVariation"],"mappings":";;;;;;;AAcA;;AAXA;;AACA;;AAQA;;AACA;;AAMA;;;;;;AAnBA;AACA;AACA;;AAcA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,OAA2D;AAAA,MAA/B;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAA+B;AAC1D,QAAMC,mBAAmB,GAAG;AAC3BC,IAAAA,MAAM,EAAE,cACP,qHADO,CADmB;AAI3BC,IAAAA,IAAI,EAAE,cACL,mFADK,CAJqB;AAO3BC,IAAAA,OAAO,EAAE,cACR,kIADQ,CAPkB;AAU3BC,IAAAA,OAAO,EAAE,cACR,gGADQ,CAVkB;AAa3BC,IAAAA,KAAK,EAAE,cACN,uIADM,CAboB;AAgB3BC,IAAAA,MAAM,EAAE,cACP,8HADO;AAhBmB,GAA5B;AAoBA,SACC,4BAAC,8BAAD;AAAmB,IAAA,mBAAmB,EAAC;AAAvC,KACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,cAAJ,CADT;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AH,GAAgBU,SAL3D;AAMCI,IAAAA,iCAAiC,EAAE,CAAEZ;AANtC,GAJwB,CAAzB;AAcA,QAAM;AAAEa,IAAAA;AAAF,MAAkB,uBAAaxB,kBAAb,CAAxB;AACA,QAAMyB,eAAe,GAAG,0BACrBC,WAAF,IAAmBF,WAAW,CAAEE,WAAF,EAAe,CAAC,CAAhB,CADP,EAEvB,CAAEF,WAAF,CAFuB,CAAxB;;AAIA,QAAMG,eAAe,GAAKC,aAAF,IAAqB;AAC5CrC,IAAAA,aAAa,CAAEqC,aAAa,CAACvC,UAAhB,CAAb;AACAoC,IAAAA,eAAe,CAAEjC,QAAF,CAAf;AACAuB,IAAAA,kBAAkB,CAAE,KAAF,CAAlB;AACA,GAJD;;AAMA,SACC,qDACC,4BAAC,iBAAD;AACC,IAAA,OAAO,EAAGV,OADX;AAEC,IAAA,eAAe,EAAKlB,KAAF,IACjBI,aAAa,CAAE;AAAEd,MAAAA,OAAO,EAAEU;AAAX,KAAF;AAHf,IADD,EAOG2B,eAAe,IAChB,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGtB,QADZ;AAEC,IAAA,IAAI,EAAGF,IAFR;AAGC,IAAA,QAAQ,EAAGqC;AAHZ,IARF,EAcGhB,oBAAoB,IAAI,CAAEG,eAA1B,IACD,4BAAC,OAAD,EAAcG,gBAAd,CAfF,EAmBG,CAAEN,oBAAF,IAA0B,CAAEG,eAA5B,IACD,4BAAC,OAAD,EAAcF,UAAd,EACC,mCAAUK,gBAAV,CADD,CApBF,CADD;AA2BA;;eAEc7B,S","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport GroupPlaceHolder, { useShouldShowPlaceHolder } from './placeholder';\n\n/**\n * Render inspector controls for the Group block.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The HTML tag name.\n * @param {Function} props.onSelectTagName onChange function for the SelectControl.\n *\n * @return {JSX.Element} The control group.\n */\nfunction GroupEditControls( { tagName, onSelectTagName } ) {\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\treturn (\n\t\t<InspectorControls __experimentalGroup=\"advanced\">\n\t\t\t<SelectControl\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ [\n\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t] }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onSelectTagName }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction GroupEdit( {\n\tattributes,\n\tname,\n\tsetAttributes,\n\tclientId,\n\t__unstableLayoutClassNames: layoutClassNames,\n} ) {\n\tconst { hasInnerBlocks, themeSupportsLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t\tthemeSupportsLayout: getSettings()?.supportsLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { tagName: TagName = 'div', templateLock, layout = {} } = attributes;\n\n\t// Layout settings.\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = ! layout?.type\n\t\t? { ...defaultLayout, ...layout, type: 'default' }\n\t\t: { ...defaultLayout, ...layout };\n\tconst { type = 'default' } = usedLayout;\n\tconst layoutSupportEnabled = themeSupportsLayout || type === 'flex';\n\n\t// Hooks.\n\tconst blockProps = useBlockProps( {\n\t\tclassName: ! layoutSupportEnabled ? layoutClassNames : null,\n\t} );\n\tconst [ showPlaceholder, setShowPlaceholder ] = useShouldShowPlaceHolder( {\n\t\tattributes,\n\t\tusedLayoutType: usedLayout?.type,\n\t\thasInnerBlocks,\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\tlayoutSupportEnabled\n\t\t\t? blockProps\n\t\t\t: { className: 'wp-block-group__inner-container' },\n\t\t{\n\t\t\ttemplateLock,\n\t\t\trenderAppender: hasInnerBlocks\n\t\t\t\t? undefined\n\t\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\t\t__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,\n\t\t\t__unstableDisableLayoutClassNames: ! layoutSupportEnabled,\n\t\t}\n\t);\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst updateSelection = useCallback(\n\t\t( newClientId ) => selectBlock( newClientId, -1 ),\n\t\t[ selectBlock ]\n\t);\n\tconst selectVariation = ( nextVariation ) => {\n\t\tsetAttributes( nextVariation.attributes );\n\t\tupdateSelection( clientId );\n\t\tsetShowPlaceholder( false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<GroupEditControls\n\t\t\t\ttagName={ TagName }\n\t\t\t\tonSelectTagName={ ( value ) =>\n\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ showPlaceholder && (\n\t\t\t\t<GroupPlaceHolder\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tname={ name }\n\t\t\t\t\tonSelect={ selectVariation }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...innerBlocksProps } />\n\t\t\t) }\n\t\t\t{ /* Ideally this is not needed but it's there for backward compatibility reason\n\t\t\t\tto keep this div for themes that might rely on its presence */ }\n\t\t\t{ ! layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t</TagName>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default GroupEdit;\n"]}
@@ -73,6 +73,9 @@ const metadata = {
73
73
  blockGap: true
74
74
  }
75
75
  },
76
+ dimensions: {
77
+ minHeight: true
78
+ },
76
79
  __experimentalBorder: {
77
80
  color: true,
78
81
  radius: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["name","metadata","settings","icon","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","edit","save","deprecated","variations","init"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,E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AAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,MAAJ;AAHE;AAFb,KAzCY;AATL,GAFc;AA8DvBC,EAAAA,UAAU,EAAVA,mBA9DuB;AA+DvBC,EAAAA,IAAI,EAAJA,aA/DuB;AAgEvBC,EAAAA,IAAI,EAAJA,aAhEuB;AAiEvBC,EAAAA,UAAU,EAAVA,mBAjEuB;AAkEvBC,EAAAA,UAAU,EAAVA;AAlEuB,CAAjB;;;AAqEA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEnB,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { group as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tstyle: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: '#000000',\n\t\t\t\t\tbackground: '#ffffff',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#cf2e2e',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'One.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#ff6900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Two.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#fcb900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Three.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#00d084',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Four.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#0693e3',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Five.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#9b51e0',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Six.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["name","metadata","settings","icon","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","edit","save","deprecated","variations","init"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,KAA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;AAHE;AAFb,KAzCY;AATL,GAFc;AA8DvBC,EAAAA,UAAU,EAAVA,mBA9DuB;AA+DvBC,EAAAA,IAAI,EAAJA,aA/DuB;AAgEvBC,EAAAA,IAAI,EAAJA,aAhEuB;AAiEvBC,EAAAA,UAAU,EAAVA,mBAjEuB;AAkEvBC,EAAAA,UAAU,EAAVA;AAlEuB,CAAjB;;;AAqEA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEnB,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { group as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tstyle: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: '#000000',\n\t\t\t\t\tbackground: '#ffffff',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#cf2e2e',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'One.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#ff6900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Two.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#fcb900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Three.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#00d084',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Four.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#0693e3',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Five.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#9b51e0',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Six.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ exports.useShouldShowPlaceHolder = useShouldShowPlaceHolder;
8
+
9
+ var _element = require("@wordpress/element");
10
+
11
+ var _data = require("@wordpress/data");
12
+
13
+ var _blockEditor = require("@wordpress/block-editor");
14
+
15
+ var _i18n = require("@wordpress/i18n");
16
+
17
+ var _blocks = require("@wordpress/blocks");
18
+
19
+ var _components = require("@wordpress/components");
20
+
21
+ /**
22
+ * WordPress dependencies
23
+ */
24
+
25
+ /**
26
+ * Returns a custom variation icon.
27
+ *
28
+ * @param {string} name The block variation name.
29
+ *
30
+ * @return {JSX.Element} The SVG element.
31
+ */
32
+ const getGroupPlaceholderIcons = function () {
33
+ let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'group';
34
+ const icons = {
35
+ group: (0, _element.createElement)(_components.SVG, {
36
+ xmlns: "http://www.w3.org/2000/svg",
37
+ width: "44",
38
+ height: "32",
39
+ viewBox: "0 0 44 32"
40
+ }, (0, _element.createElement)(_components.Path, {
41
+ d: "M42 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2z" // style="fill:#ccc"
42
+
43
+ })),
44
+ 'group-row': (0, _element.createElement)(_components.SVG, {
45
+ xmlns: "http://www.w3.org/2000/svg",
46
+ width: "44",
47
+ height: "32",
48
+ viewBox: "0 0 44 32"
49
+ }, (0, _element.createElement)(_components.Path, {
50
+ d: "M42 0H23.5c-.6 0-1 .4-1 1v30c0 .6.4 1 1 1H42c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zM20.5 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h18.5c.6 0 1-.4 1-1V1c0-.6-.4-1-1-1z" // style="fill:#ccc"
51
+
52
+ })),
53
+ 'group-stack': (0, _element.createElement)(_components.SVG, {
54
+ xmlns: "http://www.w3.org/2000/svg",
55
+ width: "44",
56
+ height: "32",
57
+ viewBox: "0 0 44 32"
58
+ }, (0, _element.createElement)(_components.Path, {
59
+ d: "M42 0H2C.9 0 0 .9 0 2v12.5c0 .6.4 1 1 1h42c.6 0 1-.4 1-1V2c0-1.1-.9-2-2-2zm1 16.5H1c-.6 0-1 .4-1 1V30c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V17.5c0-.6-.4-1-1-1z" // style="fill:#ccc"
60
+
61
+ }))
62
+ };
63
+ return icons === null || icons === void 0 ? void 0 : icons[name];
64
+ };
65
+ /**
66
+ * A custom hook to tell the Group block whether to show the variation placeholder.
67
+ *
68
+ * @param {Object} props Arguments to pass to hook.
69
+ * @param {Object} [props.attributes] The block's attributes.
70
+ * @param {string} [props.usedLayoutType] The block's current layout type.
71
+ * @param {boolean} [props.hasInnerBlocks] Whether the block has inner blocks.
72
+ *
73
+ * @return {[boolean, Function]} A state value and setter function.
74
+ */
75
+
76
+
77
+ function useShouldShowPlaceHolder(_ref) {
78
+ let {
79
+ attributes = {
80
+ style: undefined,
81
+ backgroundColor: undefined,
82
+ textColor: undefined,
83
+ fontSize: undefined
84
+ },
85
+ usedLayoutType = '',
86
+ hasInnerBlocks = false
87
+ } = _ref;
88
+ const {
89
+ style,
90
+ backgroundColor,
91
+ textColor,
92
+ fontSize
93
+ } = attributes;
94
+ /*
95
+ * Shows the placeholder when no known styles are set,
96
+ * or when a non-default layout has been selected.
97
+ * Should the Group block support more style presets in the
98
+ * future, e.g., attributes.spacingSize, we can add them to the
99
+ * condition.
100
+ */
101
+
102
+ const [showPlaceholder, setShowPlaceholder] = (0, _element.useState)(!hasInnerBlocks && !backgroundColor && !fontSize && !textColor && !style && usedLayoutType !== 'flex');
103
+ (0, _element.useEffect)(() => {
104
+ if (!!hasInnerBlocks || !!backgroundColor || !!fontSize || !!textColor || !!style || usedLayoutType === 'flex') {
105
+ setShowPlaceholder(false);
106
+ }
107
+ }, [backgroundColor, fontSize, textColor, style, usedLayoutType, hasInnerBlocks]);
108
+ return [showPlaceholder, setShowPlaceholder];
109
+ }
110
+ /**
111
+ * Display group variations if none is selected.
112
+ *
113
+ * @param {Object} props Component props.
114
+ * @param {string} props.name The block's name.
115
+ * @param {Function} props.onSelect Function to set block's attributes.
116
+ *
117
+ * @return {JSX.Element} The placeholder.
118
+ */
119
+
120
+
121
+ function GroupPlaceHolder(_ref2) {
122
+ let {
123
+ name,
124
+ onSelect
125
+ } = _ref2;
126
+ const {
127
+ defaultVariation,
128
+ variations
129
+ } = (0, _data.useSelect)(select => {
130
+ const {
131
+ getBlockVariations,
132
+ getDefaultBlockVariation
133
+ } = select(_blocks.store);
134
+ return {
135
+ defaultVariation: getDefaultBlockVariation(name, 'block'),
136
+ variations: getBlockVariations(name, 'block') || []
137
+ };
138
+ }, [name]);
139
+ const blockProps = (0, _blockEditor.useBlockProps)({
140
+ className: 'wp-block-group__placeholder'
141
+ });
142
+
143
+ const selectVariation = function () {
144
+ let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
145
+ return onSelect(nextVariation);
146
+ };
147
+
148
+ return (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_components.Placeholder, {
149
+ instructions: (0, _i18n.__)('Group blocks together. Select a layout:')
150
+ }, (0, _element.createElement)("ul", {
151
+ role: "list",
152
+ className: "wp-block-group-placeholder__variations",
153
+ "aria-label": (0, _i18n.__)('Block variations')
154
+ }, variations.map(variation => (0, _element.createElement)("li", {
155
+ key: variation.name
156
+ }, (0, _element.createElement)(_components.Button, {
157
+ variant: "tertiary",
158
+ icon: getGroupPlaceholderIcons(variation.name),
159
+ iconSize: 44,
160
+ onClick: () => selectVariation(variation),
161
+ className: "wp-block-group-placeholder__variation-button",
162
+ label: `${variation.title}: ${variation.description}`
163
+ }))))));
164
+ }
165
+
166
+ var _default = GroupPlaceHolder;
167
+ exports.default = _default;
168
+ //# sourceMappingURL=placeholder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/placeholder.js"],"names":["getGroupPlaceholderIcons","name","icons","group","useShouldShowPlaceHolder","attributes","style","undefined","backgroundColor","textColor","fontSize","usedLayoutType","hasInnerBlocks","showPlaceholder","setShowPlaceholder","GroupPlaceHolder","onSelect","defaultVariation","variations","select","getBlockVariations","getDefaultBlockVariation","blocksStore","blockProps","className","selectVariation","nextVariation","map","variation","title","description"],"mappings":";;;;;;;;AAQA;;AALA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,wBAAwB,GAAG,YAAsB;AAAA,MAApBC,IAAoB,uEAAb,OAAa;AACtD,QAAMC,KAAK,GAAG;AACbC,IAAAA,KAAK,EACJ,4BAAC,eAAD;AACC,MAAA,KAAK,EAAC,4BADP;AAEC,MAAA,KAAK,EAAC,IAFP;AAGC,MAAA,MAAM,EAAC,IAHR;A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;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC,wCAFX;AAGC,kBAAa,cAAI,kBAAJ;AAHd,KAKGL,UAAU,CAACS,GAAX,CAAkBC,SAAF,IACjB;AAAI,IAAA,GAAG,EAAGA,SAAS,CAAC3B;AAApB,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,UADT;AAEC,IAAA,IAAI,EAAGD,wBAAwB,CAC9B4B,SAAS,CAAC3B,IADoB,CAFhC;AAKC,IAAA,QAAQ,EAAG,EALZ;AAMC,IAAA,OAAO,EAAG,MAAMwB,eAAe,CAAEG,SAAF,CANhC;AAOC,IAAA,SAAS,EAAC,8CAPX;AAQC,IAAA,KAAK,EAAI,GAAGA,SAAS,CAACC,KAAO,KAAKD,SAAS,CAACE,WAAa;AAR1D,IADD,CADC,CALH,CATD,CADD,CADD;AAmCA;;eAEcf,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { Path, SVG, Button, Placeholder } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Returns a custom variation icon.\n *\n * @param {string} name The block variation name.\n *\n * @return {JSX.Element} The SVG element.\n */\nconst getGroupPlaceholderIcons = ( name = 'group' ) => {\n\tconst icons = {\n\t\tgroup: (\n\t\t\t<SVG\n\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\twidth=\"44\"\n\t\t\t\theight=\"32\"\n\t\t\t\tviewBox=\"0 0 44 32\"\n\t\t\t>\n\t\t\t\t<Path\n\t\t\t\t\td=\"M42 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2z\"\n\t\t\t\t\t// style=\"fill:#ccc\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t),\n\t\t'group-row': (\n\t\t\t<SVG\n\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\twidth=\"44\"\n\t\t\t\theight=\"32\"\n\t\t\t\tviewBox=\"0 0 44 32\"\n\t\t\t>\n\t\t\t\t<Path\n\t\t\t\t\td=\"M42 0H23.5c-.6 0-1 .4-1 1v30c0 .6.4 1 1 1H42c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zM20.5 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h18.5c.6 0 1-.4 1-1V1c0-.6-.4-1-1-1z\"\n\t\t\t\t\t// style=\"fill:#ccc\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t),\n\t\t'group-stack': (\n\t\t\t<SVG\n\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\twidth=\"44\"\n\t\t\t\theight=\"32\"\n\t\t\t\tviewBox=\"0 0 44 32\"\n\t\t\t>\n\t\t\t\t<Path\n\t\t\t\t\td=\"M42 0H2C.9 0 0 .9 0 2v12.5c0 .6.4 1 1 1h42c.6 0 1-.4 1-1V2c0-1.1-.9-2-2-2zm1 16.5H1c-.6 0-1 .4-1 1V30c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V17.5c0-.6-.4-1-1-1z\"\n\t\t\t\t\t// style=\"fill:#ccc\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t),\n\t};\n\treturn icons?.[ name ];\n};\n\n/**\n * A custom hook to tell the Group block whether to show the variation placeholder.\n *\n * @param {Object} props Arguments to pass to hook.\n * @param {Object} [props.attributes] The block's attributes.\n * @param {string} [props.usedLayoutType] The block's current layout type.\n * @param {boolean} [props.hasInnerBlocks] Whether the block has inner blocks.\n *\n * @return {[boolean, Function]} A state value and setter function.\n */\nexport function useShouldShowPlaceHolder( {\n\tattributes = {\n\t\tstyle: undefined,\n\t\tbackgroundColor: undefined,\n\t\ttextColor: undefined,\n\t\tfontSize: undefined,\n\t},\n\tusedLayoutType = '',\n\thasInnerBlocks = false,\n} ) {\n\tconst { style, backgroundColor, textColor, fontSize } = attributes;\n\t/*\n\t * Shows the placeholder when no known styles are set,\n\t * or when a non-default layout has been selected.\n\t * Should the Group block support more style presets in the\n\t * future, e.g., attributes.spacingSize, we can add them to the\n\t * condition.\n\t */\n\tconst [ showPlaceholder, setShowPlaceholder ] = useState(\n\t\t! hasInnerBlocks &&\n\t\t\t! backgroundColor &&\n\t\t\t! fontSize &&\n\t\t\t! textColor &&\n\t\t\t! style &&\n\t\t\tusedLayoutType !== 'flex'\n\t);\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t!! hasInnerBlocks ||\n\t\t\t!! backgroundColor ||\n\t\t\t!! fontSize ||\n\t\t\t!! textColor ||\n\t\t\t!! style ||\n\t\t\tusedLayoutType === 'flex'\n\t\t) {\n\t\t\tsetShowPlaceholder( false );\n\t\t}\n\t}, [\n\t\tbackgroundColor,\n\t\tfontSize,\n\t\ttextColor,\n\t\tstyle,\n\t\tusedLayoutType,\n\t\thasInnerBlocks,\n\t] );\n\n\treturn [ showPlaceholder, setShowPlaceholder ];\n}\n\n/**\n * Display group variations if none is selected.\n *\n * @param {Object} props Component props.\n * @param {string} props.name The block's name.\n * @param {Function} props.onSelect Function to set block's attributes.\n *\n * @return {JSX.Element} The placeholder.\n */\nfunction GroupPlaceHolder( { name, onSelect } ) {\n\tconst { defaultVariation, variations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockVariations, getDefaultBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tdefaultVariation: getDefaultBlockVariation( name, 'block' ),\n\t\t\t\tvariations: getBlockVariations( name, 'block' ) || [],\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'wp-block-group__placeholder',\n\t} );\n\tconst selectVariation = ( nextVariation = defaultVariation ) =>\n\t\tonSelect( nextVariation );\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Placeholder\n\t\t\t\tinstructions={ __( 'Group blocks together. Select a layout:' ) }\n\t\t\t>\n\t\t\t\t{ /*\n\t\t\t\t * Taken from BlockVariationPicker component.\n\t\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t\t */\n\t\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t<ul\n\t\t\t\t\trole=\"list\"\n\t\t\t\t\tclassName=\"wp-block-group-placeholder__variations\"\n\t\t\t\t\taria-label={ __( 'Block variations' ) }\n\t\t\t\t>\n\t\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t\t<li key={ variation.name }>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\ticon={ getGroupPlaceholderIcons(\n\t\t\t\t\t\t\t\t\tvariation.name\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ticonSize={ 44 }\n\t\t\t\t\t\t\t\tonClick={ () => selectVariation( variation ) }\n\t\t\t\t\t\t\t\tclassName=\"wp-block-group-placeholder__variation-button\"\n\t\t\t\t\t\t\t\tlabel={ `${ variation.title }: ${ variation.description }` }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) ) }\n\t\t\t\t</ul>\n\t\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t</Placeholder>\n\t\t</div>\n\t);\n}\n\nexport default GroupPlaceHolder;\n"]}
@@ -22,7 +22,7 @@ const variations = [{
22
22
  }
23
23
  },
24
24
  isDefault: true,
25
- scope: ['inserter', 'transform'],
25
+ scope: ['block', 'inserter', 'transform'],
26
26
  isActive: blockAttributes => {
27
27
  var _blockAttributes$layo, _blockAttributes$layo2, _blockAttributes$layo3;
28
28
 
@@ -39,7 +39,7 @@ const variations = [{
39
39
  flexWrap: 'nowrap'
40
40
  }
41
41
  },
42
- scope: ['inserter', 'transform'],
42
+ scope: ['block', 'inserter', 'transform'],
43
43
  isActive: blockAttributes => {
44
44
  var _blockAttributes$layo4, _blockAttributes$layo5, _blockAttributes$layo6;
45
45
 
@@ -56,7 +56,7 @@ const variations = [{
56
56
  orientation: 'vertical'
57
57
  }
58
58
  },
59
- scope: ['inserter', 'transform'],
59
+ scope: ['block', 'inserter', 'transform'],
60
60
  isActive: blockAttributes => {
61
61
  var _blockAttributes$layo7, _blockAttributes$layo8;
62
62
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/group/variations.js"],"names":["variations","name","title","description","attributes","layout","type","isDefault","scope","isActive","blockAttributes","icon","group","flexWrap","orientation","row","stack"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,UAAU,GAAG,CAClB;AACCC,EAAAA,IAAI,EAAE,OADP;AAECC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAFR;AAGCC,EAAAA,WAAW,EAAE,cAAI,+BAAJ,CAHd;AAICC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE;AAAR;AAAV,GAJb;AAKCC,EAAAA,SAAS,EAAE,IALZ;AAMCC,EAAAA,KAAK,EAAE,CAAE,UAAF,EAAc,WAAd,CANR;AAOCC,EAAAA,QAAQ,EAAIC,eAAF;AAAA;;AAAA,WACT,CAAEA,eAAe,CAACL,MAAlB,IACA,2BAAEK,eAAe,CAACL,MAAlB,kDAAE,sBAAwBC,IAA1B,CADA,IAEA,2BAAAI,eAAe,CAACL,MAAhB,kFAAwBC,IAAxB,MAAiC,SAFjC,IAGA,2BAAAI,eAAe,CAACL,MAAhB,kFAAwBC,IAAxB,MAAiC,aAJxB;AAAA,GAPX;AAYCK,EAAAA,IAAI,EAAEC;AAZP,CADkB,EAelB;AACCX,EAAAA,IAAI,EAAE,WADP;AAECC,EAAAA,KAAK,EAAE,cAAI,KAAJ,EAAW,wBAAX,CAFR;AAGCC,EAAAA,WAAW,EAAE,cAAI,8BAAJ,CAHd;AAICC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,MAAR;AAAgBO,MAAAA,QAAQ,EAAE;AAA1B;AAAV,GAJb;AAKCL,EAAAA,KAAK,EAAE,CAAE,UAAF,EAAc,WAAd,CALR;AAMCC,EAAAA,QAAQ,EAAIC,eAAF;AAAA;;AAAA,WACT,2BAAAA,eAAe,CAACL,MAAhB,kFAAwBC,IAAxB,MAAiC,MAAjC,KACE,4BAAEI,eAAe,CAACL,MAAlB,mDAAE,uBAAwBS,WAA1B,KACD,2BAAAJ,eAAe,CAACL,MAAhB,kFAAwBS,WAAxB,MAAwC,YAFzC,CADS;AAAA,GANX;AAUCH,EAAAA,IAAI,EAAEI;AAVP,CAfkB,EA2BlB;AACCd,EAAAA,IAAI,EAAE,aADP;AAECC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAFR;AAGCC,EAAAA,WAAW,EAAE,cAAI,4BAAJ,CAHd;AAICC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,MAAR;AAAgBQ,MAAAA,WAAW,EAAE;AAA7B;AAAV,GAJb;AAKCN,EAAAA,KAAK,EAAE,CAAE,UAAF,EAAc,WAAd,CALR;AAMCC,EAAAA,QAAQ,EAAIC,eAAF;AAAA;;AAAA,WACT,2BAAAA,eAAe,CAACL,MAAhB,kFAAwBC,IAAxB,MAAiC,MAAjC,IACA,2BAAAI,eAAe,CAACL,MAAhB,kFAAwBS,WAAxB,MAAwC,UAF/B;AAAA,GANX;AASCH,EAAAA,IAAI,EAAEK;AATP,CA3BkB,CAAnB;eAwCehB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { group, row, stack } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'group',\n\t\ttitle: __( 'Group' ),\n\t\tdescription: __( 'Gather blocks in a container.' ),\n\t\tattributes: { layout: { type: 'constrained' } },\n\t\tisDefault: true,\n\t\tscope: [ 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\t! blockAttributes.layout ||\n\t\t\t! blockAttributes.layout?.type ||\n\t\t\tblockAttributes.layout?.type === 'default' ||\n\t\t\tblockAttributes.layout?.type === 'constrained',\n\t\ticon: group,\n\t},\n\t{\n\t\tname: 'group-row',\n\t\ttitle: _x( 'Row', 'single horizontal line' ),\n\t\tdescription: __( 'Arrange blocks horizontally.' ),\n\t\tattributes: { layout: { type: 'flex', flexWrap: 'nowrap' } },\n\t\tscope: [ 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes.layout?.type === 'flex' &&\n\t\t\t( ! blockAttributes.layout?.orientation ||\n\t\t\t\tblockAttributes.layout?.orientation === 'horizontal' ),\n\t\ticon: row,\n\t},\n\t{\n\t\tname: 'group-stack',\n\t\ttitle: __( 'Stack' ),\n\t\tdescription: __( 'Arrange blocks vertically.' ),\n\t\tattributes: { layout: { type: 'flex', orientation: 'vertical' } },\n\t\tscope: [ 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes.layout?.type === 'flex' &&\n\t\t\tblockAttributes.layout?.orientation === 'vertical',\n\t\ticon: stack,\n\t},\n];\n\nexport default variations;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/variations.js"],"names":["variations","name","title","description","attributes","layout","type","isDefault","scope","isActive","blockAttributes","icon","group","flexWrap","orientation","row","stack"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,UAAU,GAAG,CAClB;AACCC,EAAAA,IAAI,EAAE,OADP;AAECC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAFR;AAGCC,EAAAA,WAAW,EAAE,cAAI,+BAAJ,CAHd;AAICC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE;A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AICC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,MAAR;AAAgBQ,MAAAA,WAAW,EAAE;AAA7B;AAAV,GAJb;AAKCN,EAAAA,KAAK,EAAE,CAAE,OAAF,EAAW,UAAX,EAAuB,WAAvB,CALR;AAMCC,EAAAA,QAAQ,EAAIC,eAAF;AAAA;;AAAA,WACT,2BAAAA,eAAe,CAACL,MAAhB,kFAAwBC,IAAxB,MAAiC,MAAjC,IACA,2BAAAI,eAAe,CAACL,MAAhB,kFAAwBS,WAAxB,MAAwC,UAF/B;AAAA,GANX;AASCH,EAAAA,IAAI,EAAEK;AATP,CA3BkB,CAAnB;eAwCehB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { group, row, stack } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'group',\n\t\ttitle: __( 'Group' ),\n\t\tdescription: __( 'Gather blocks in a container.' ),\n\t\tattributes: { layout: { type: 'constrained' } },\n\t\tisDefault: true,\n\t\tscope: [ 'block', 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\t! blockAttributes.layout ||\n\t\t\t! blockAttributes.layout?.type ||\n\t\t\tblockAttributes.layout?.type === 'default' ||\n\t\t\tblockAttributes.layout?.type === 'constrained',\n\t\ticon: group,\n\t},\n\t{\n\t\tname: 'group-row',\n\t\ttitle: _x( 'Row', 'single horizontal line' ),\n\t\tdescription: __( 'Arrange blocks horizontally.' ),\n\t\tattributes: { layout: { type: 'flex', flexWrap: 'nowrap' } },\n\t\tscope: [ 'block', 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes.layout?.type === 'flex' &&\n\t\t\t( ! blockAttributes.layout?.orientation ||\n\t\t\t\tblockAttributes.layout?.orientation === 'horizontal' ),\n\t\ticon: row,\n\t},\n\t{\n\t\tname: 'group-stack',\n\t\ttitle: __( 'Stack' ),\n\t\tdescription: __( 'Arrange blocks vertically.' ),\n\t\tattributes: { layout: { type: 'flex', orientation: 'vertical' } },\n\t\tscope: [ 'block', 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes.layout?.type === 'flex' &&\n\t\t\tblockAttributes.layout?.orientation === 'vertical',\n\t\ticon: stack,\n\t},\n];\n\nexport default variations;\n"]}
@@ -810,7 +810,7 @@ class ImageEdit extends _element.Component {
810
810
  }))), (0, _element.createElement)(_blockEditor.BlockCaption, {
811
811
  clientId: this.props.clientId,
812
812
  isSelected: this.state.isCaptionSelected,
813
- accessible: true,
813
+ accessible: !this.state.isCaptionSelected,
814
814
  accessibilityLabelCreator: this.accessibilityLabelCreator,
815
815
  onFocus: this.onFocusCaption,
816
816
  onBlur: this.props.onBlur // Always assign onBlur as props.