@wordpress/block-library 7.19.0 → 8.1.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 (862) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/audio/edit.native.js +1 -3
  3. package/build/audio/edit.native.js.map +1 -1
  4. package/build/audio/index.js +2 -1
  5. package/build/audio/index.js.map +1 -1
  6. package/build/avatar/edit.js +1 -0
  7. package/build/avatar/edit.js.map +1 -1
  8. package/build/avatar/user-control.js +1 -0
  9. package/build/avatar/user-control.js.map +1 -1
  10. package/build/block/edit.js +14 -2
  11. package/build/block/edit.js.map +1 -1
  12. package/build/block/edit.native.js +14 -6
  13. package/build/block/edit.native.js.map +1 -1
  14. package/build/block/index.js +1 -2
  15. package/build/block/index.js.map +1 -1
  16. package/build/button/edit.native.js.map +1 -1
  17. package/build/categories/edit.js +1 -1
  18. package/build/categories/edit.js.map +1 -1
  19. package/build/code/transforms.js +1 -1
  20. package/build/code/transforms.js.map +1 -1
  21. package/build/columns/edit.js +1 -0
  22. package/build/columns/edit.js.map +1 -1
  23. package/build/columns/edit.native.js +13 -30
  24. package/build/columns/edit.native.js.map +1 -1
  25. package/build/comment-author-avatar/edit.js +1 -0
  26. package/build/comment-author-avatar/edit.js.map +1 -1
  27. package/build/cover/edit/inspector-controls.js +3 -1
  28. package/build/cover/edit/inspector-controls.js.map +1 -1
  29. package/build/cover/edit.native.js +24 -16
  30. package/build/cover/edit.native.js.map +1 -1
  31. package/build/embed/embed-controls.native.js +1 -0
  32. package/build/embed/embed-controls.native.js.map +1 -1
  33. package/build/embed/embed-preview.native.js +1 -3
  34. package/build/embed/embed-preview.native.js.map +1 -1
  35. package/build/file/inspector.js +1 -0
  36. package/build/file/inspector.js.map +1 -1
  37. package/build/freeform/edit.js +21 -6
  38. package/build/freeform/edit.js.map +1 -1
  39. package/build/freeform/modal.js +97 -0
  40. package/build/freeform/modal.js.map +1 -0
  41. package/build/gallery/edit.js +38 -15
  42. package/build/gallery/edit.js.map +1 -1
  43. package/build/gallery/gallery.js +2 -16
  44. package/build/gallery/gallery.js.map +1 -1
  45. package/build/gallery/gallery.native.js +1 -3
  46. package/build/gallery/gallery.native.js.map +1 -1
  47. package/build/gallery/shared.js +4 -10
  48. package/build/gallery/shared.js.map +1 -1
  49. package/build/gallery/transforms.js +1 -7
  50. package/build/gallery/transforms.js.map +1 -1
  51. package/build/gallery/use-get-media.js +1 -1
  52. package/build/gallery/use-get-media.js.map +1 -1
  53. package/build/gallery/use-get-media.native.js +3 -1
  54. package/build/gallery/use-get-media.native.js.map +1 -1
  55. package/build/gallery/v1/edit.js +22 -15
  56. package/build/gallery/v1/edit.js.map +1 -1
  57. package/build/gallery/v1/gallery.native.js +1 -3
  58. package/build/gallery/v1/gallery.native.js.map +1 -1
  59. package/build/gallery/v1/shared.js +4 -1
  60. package/build/gallery/v1/shared.js.map +1 -1
  61. package/build/group/edit.js +1 -2
  62. package/build/group/edit.js.map +1 -1
  63. package/build/group/index.js +3 -1
  64. package/build/group/index.js.map +1 -1
  65. package/build/group/placeholder.js +5 -26
  66. package/build/group/placeholder.js.map +1 -1
  67. package/build/heading/deprecated.js +152 -69
  68. package/build/heading/deprecated.js.map +1 -1
  69. package/build/heading/index.js +1 -2
  70. package/build/heading/index.js.map +1 -1
  71. package/build/heading/transforms.js +1 -2
  72. package/build/heading/transforms.js.map +1 -1
  73. package/build/html/index.js +1 -1
  74. package/build/image/edit.js +8 -5
  75. package/build/image/edit.js.map +1 -1
  76. package/build/image/edit.native.js +3 -2
  77. package/build/image/edit.native.js.map +1 -1
  78. package/build/image/image.js +13 -8
  79. package/build/image/image.js.map +1 -1
  80. package/build/index.js +3 -1
  81. package/build/index.js.map +1 -1
  82. package/build/latest-comments/edit.js +1 -0
  83. package/build/latest-comments/edit.js.map +1 -1
  84. package/build/latest-posts/edit.js +2 -0
  85. package/build/latest-posts/edit.js.map +1 -1
  86. package/build/list/transforms.js +1 -9
  87. package/build/list/transforms.js.map +1 -1
  88. package/build/list/utils.js +5 -2
  89. package/build/list/utils.js.map +1 -1
  90. package/build/list-item/index.js +4 -1
  91. package/build/list-item/index.js.map +1 -1
  92. package/build/list-item/transforms.js +22 -0
  93. package/build/list-item/transforms.js.map +1 -0
  94. package/build/list-item/utils.js +77 -1
  95. package/build/list-item/utils.js.map +1 -1
  96. package/build/media-text/edit.js +5 -2
  97. package/build/media-text/edit.js.map +1 -1
  98. package/build/missing/edit.native.js +2 -2
  99. package/build/missing/edit.native.js.map +1 -1
  100. package/build/navigation/edit/are-blocks-dirty.js +52 -0
  101. package/build/navigation/edit/are-blocks-dirty.js.map +1 -0
  102. package/build/navigation/edit/index.js +95 -117
  103. package/build/navigation/edit/index.js.map +1 -1
  104. package/build/navigation/edit/menu-inspector-controls.js +94 -0
  105. package/build/navigation/edit/menu-inspector-controls.js.map +1 -0
  106. package/build/navigation/edit/navigation-menu-selector.js +2 -4
  107. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  108. package/build/navigation/edit/unsaved-inner-blocks.js +11 -7
  109. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  110. package/build/navigation/edit/utils.js +81 -0
  111. package/build/navigation/edit/utils.js.map +1 -1
  112. package/build/navigation/view-modal.js +6 -2
  113. package/build/navigation/view-modal.js.map +1 -1
  114. package/build/navigation-link/edit.js +46 -356
  115. package/build/navigation-link/edit.js.map +1 -1
  116. package/build/navigation-link/link-ui.js +222 -0
  117. package/build/navigation-link/link-ui.js.map +1 -0
  118. package/build/navigation-link/transforms.js +12 -0
  119. package/build/navigation-link/transforms.js.map +1 -1
  120. package/build/navigation-link/update-attributes.js +108 -0
  121. package/build/navigation-link/update-attributes.js.map +1 -0
  122. package/build/navigation-submenu/edit.js +49 -245
  123. package/build/navigation-submenu/edit.js.map +1 -1
  124. package/build/page-list/constants.js +15 -0
  125. package/build/page-list/constants.js.map +1 -0
  126. package/build/page-list/convert-to-links-modal.js +22 -86
  127. package/build/page-list/convert-to-links-modal.js.map +1 -1
  128. package/build/page-list/convert-to-navigation-links.js +76 -0
  129. package/build/page-list/convert-to-navigation-links.js.map +1 -0
  130. package/build/page-list/edit.js +143 -78
  131. package/build/page-list/edit.js.map +1 -1
  132. package/build/page-list/index.js +35 -3
  133. package/build/page-list/index.js.map +1 -1
  134. package/build/page-list-item/edit.js +91 -0
  135. package/build/page-list-item/edit.js.map +1 -0
  136. package/build/page-list-item/index.js +85 -0
  137. package/build/page-list-item/index.js.map +1 -0
  138. package/build/page-list-item/init.js +16 -0
  139. package/build/page-list-item/init.js.map +1 -0
  140. package/build/paragraph/index.js +1 -7
  141. package/build/paragraph/index.js.map +1 -1
  142. package/build/post-author/edit.js +3 -2
  143. package/build/post-author/edit.js.map +1 -1
  144. package/build/post-featured-image/overlay.js +1 -1
  145. package/build/post-featured-image/overlay.js.map +1 -1
  146. package/build/post-template/index.js +8 -0
  147. package/build/post-template/index.js.map +1 -1
  148. package/build/preformatted/transforms.js +3 -1
  149. package/build/preformatted/transforms.js.map +1 -1
  150. package/build/query/deprecated.js +192 -21
  151. package/build/query/deprecated.js.map +1 -1
  152. package/build/query/edit/index.js +2 -1
  153. package/build/query/edit/index.js.map +1 -1
  154. package/build/query/edit/inspector-controls/index.js +11 -5
  155. package/build/query/edit/inspector-controls/index.js.map +1 -1
  156. package/build/query/edit/inspector-controls/taxonomy-controls.js +101 -37
  157. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  158. package/build/query/edit/query-content.js +2 -3
  159. package/build/query/edit/query-content.js.map +1 -1
  160. package/build/query/edit/query-placeholder.js +16 -27
  161. package/build/query/edit/query-placeholder.js.map +1 -1
  162. package/build/query/index.js +0 -8
  163. package/build/query/index.js.map +1 -1
  164. package/build/query/utils.js +73 -9
  165. package/build/query/utils.js.map +1 -1
  166. package/build/rss/edit.js +3 -0
  167. package/build/rss/edit.js.map +1 -1
  168. package/build/search/edit.js +2 -2
  169. package/build/search/edit.js.map +1 -1
  170. package/build/search/edit.native.js +22 -22
  171. package/build/search/edit.native.js.map +1 -1
  172. package/build/search/index.js +9 -1
  173. package/build/search/index.js.map +1 -1
  174. package/build/site-logo/edit.js +17 -9
  175. package/build/site-logo/edit.js.map +1 -1
  176. package/build/site-logo/index.js +1 -0
  177. package/build/site-logo/index.js.map +1 -1
  178. package/build/site-title/index.js +1 -0
  179. package/build/site-title/index.js.map +1 -1
  180. package/build/social-link/edit.js.map +1 -1
  181. package/build/social-link/social-list.js +4 -12
  182. package/build/social-link/social-list.js.map +1 -1
  183. package/build/social-links/edit.js +0 -1
  184. package/build/social-links/edit.js.map +1 -1
  185. package/build/table/edit.js +3 -1
  186. package/build/table/edit.js.map +1 -1
  187. package/build/table/index.js +17 -1
  188. package/build/table/index.js.map +1 -1
  189. package/build/table/save.js +4 -2
  190. package/build/table/save.js.map +1 -1
  191. package/build/table/state.js +24 -12
  192. package/build/table/state.js.map +1 -1
  193. package/build/table/transforms.js +3 -2
  194. package/build/table/transforms.js.map +1 -1
  195. package/build/table-of-contents/edit.js +3 -3
  196. package/build/table-of-contents/edit.js.map +1 -1
  197. package/build/tag-cloud/edit.js +2 -1
  198. package/build/tag-cloud/edit.js.map +1 -1
  199. package/build/template-part/edit/advanced-controls.js +11 -1
  200. package/build/template-part/edit/advanced-controls.js.map +1 -1
  201. package/build/template-part/edit/import-controls.js +160 -0
  202. package/build/template-part/edit/import-controls.js.map +1 -0
  203. package/build/template-part/edit/index.js +2 -1
  204. package/build/template-part/edit/index.js.map +1 -1
  205. package/build/template-part/edit/selection-modal.js +5 -2
  206. package/build/template-part/edit/selection-modal.js.map +1 -1
  207. package/build/template-part/edit/utils/hooks.js +2 -6
  208. package/build/template-part/edit/utils/hooks.js.map +1 -1
  209. package/build/template-part/edit/utils/transformers.js +48 -0
  210. package/build/template-part/edit/utils/transformers.js.map +1 -0
  211. package/build/text-columns/edit.js +1 -0
  212. package/build/text-columns/edit.js.map +1 -1
  213. package/build/utils/transformation-categories.native.js +1 -1
  214. package/build/utils/transformation-categories.native.js.map +1 -1
  215. package/build/video/edit.js +1 -1
  216. package/build/video/edit.js.map +1 -1
  217. package/build/video/edit.native.js +1 -3
  218. package/build/video/edit.native.js.map +1 -1
  219. package/build-module/audio/edit.native.js +1 -2
  220. package/build-module/audio/edit.native.js.map +1 -1
  221. package/build-module/audio/index.js +2 -1
  222. package/build-module/audio/index.js.map +1 -1
  223. package/build-module/avatar/edit.js +1 -0
  224. package/build-module/avatar/edit.js.map +1 -1
  225. package/build-module/avatar/user-control.js +1 -0
  226. package/build-module/avatar/user-control.js.map +1 -1
  227. package/build-module/block/edit.js +14 -2
  228. package/build-module/block/edit.js.map +1 -1
  229. package/build-module/block/edit.native.js +14 -6
  230. package/build-module/block/edit.native.js.map +1 -1
  231. package/build-module/block/index.js +1 -2
  232. package/build-module/block/index.js.map +1 -1
  233. package/build-module/button/edit.native.js +2 -1
  234. package/build-module/button/edit.native.js.map +1 -1
  235. package/build-module/categories/edit.js +1 -1
  236. package/build-module/categories/edit.js.map +1 -1
  237. package/build-module/code/transforms.js +1 -1
  238. package/build-module/code/transforms.js.map +1 -1
  239. package/build-module/columns/edit.js +1 -0
  240. package/build-module/columns/edit.js.map +1 -1
  241. package/build-module/columns/edit.native.js +13 -29
  242. package/build-module/columns/edit.native.js.map +1 -1
  243. package/build-module/comment-author-avatar/edit.js +1 -0
  244. package/build-module/comment-author-avatar/edit.js.map +1 -1
  245. package/build-module/cover/edit/inspector-controls.js +5 -3
  246. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  247. package/build-module/cover/edit.native.js +22 -14
  248. package/build-module/cover/edit.native.js.map +1 -1
  249. package/build-module/embed/embed-controls.native.js +2 -1
  250. package/build-module/embed/embed-controls.native.js.map +1 -1
  251. package/build-module/embed/embed-preview.native.js +1 -2
  252. package/build-module/embed/embed-preview.native.js.map +1 -1
  253. package/build-module/file/inspector.js +1 -0
  254. package/build-module/file/inspector.js.map +1 -1
  255. package/build-module/freeform/edit.js +22 -8
  256. package/build-module/freeform/edit.js.map +1 -1
  257. package/build-module/freeform/modal.js +90 -0
  258. package/build-module/freeform/modal.js.map +1 -0
  259. package/build-module/gallery/edit.js +39 -15
  260. package/build-module/gallery/edit.js.map +1 -1
  261. package/build-module/gallery/gallery.js +3 -16
  262. package/build-module/gallery/gallery.js.map +1 -1
  263. package/build-module/gallery/gallery.native.js +1 -2
  264. package/build-module/gallery/gallery.native.js.map +1 -1
  265. package/build-module/gallery/shared.js +5 -11
  266. package/build-module/gallery/shared.js.map +1 -1
  267. package/build-module/gallery/transforms.js +1 -6
  268. package/build-module/gallery/transforms.js.map +1 -1
  269. package/build-module/gallery/use-get-media.js +1 -1
  270. package/build-module/gallery/use-get-media.js.map +1 -1
  271. package/build-module/gallery/use-get-media.native.js +3 -1
  272. package/build-module/gallery/use-get-media.native.js.map +1 -1
  273. package/build-module/gallery/v1/edit.js +23 -16
  274. package/build-module/gallery/v1/edit.js.map +1 -1
  275. package/build-module/gallery/v1/gallery.native.js +1 -2
  276. package/build-module/gallery/v1/gallery.native.js.map +1 -1
  277. package/build-module/gallery/v1/shared.js +5 -2
  278. package/build-module/gallery/v1/shared.js.map +1 -1
  279. package/build-module/group/edit.js +1 -3
  280. package/build-module/group/edit.js.map +1 -1
  281. package/build-module/group/index.js +3 -1
  282. package/build-module/group/index.js.map +1 -1
  283. package/build-module/group/placeholder.js +5 -26
  284. package/build-module/group/placeholder.js.map +1 -1
  285. package/build-module/heading/deprecated.js +152 -69
  286. package/build-module/heading/deprecated.js.map +1 -1
  287. package/build-module/heading/index.js +1 -2
  288. package/build-module/heading/index.js.map +1 -1
  289. package/build-module/heading/transforms.js +1 -2
  290. package/build-module/heading/transforms.js.map +1 -1
  291. package/build-module/html/index.js +1 -1
  292. package/build-module/image/edit.js +9 -6
  293. package/build-module/image/edit.js.map +1 -1
  294. package/build-module/image/edit.native.js +2 -1
  295. package/build-module/image/edit.native.js.map +1 -1
  296. package/build-module/image/image.js +14 -9
  297. package/build-module/image/image.js.map +1 -1
  298. package/build-module/index.js +2 -1
  299. package/build-module/index.js.map +1 -1
  300. package/build-module/latest-comments/edit.js +1 -0
  301. package/build-module/latest-comments/edit.js.map +1 -1
  302. package/build-module/latest-posts/edit.js +2 -0
  303. package/build-module/latest-posts/edit.js.map +1 -1
  304. package/build-module/list/transforms.js +1 -9
  305. package/build-module/list/transforms.js.map +1 -1
  306. package/build-module/list/utils.js +5 -2
  307. package/build-module/list/utils.js.map +1 -1
  308. package/build-module/list-item/index.js +3 -1
  309. package/build-module/list-item/index.js.map +1 -1
  310. package/build-module/list-item/transforms.js +13 -0
  311. package/build-module/list-item/transforms.js.map +1 -0
  312. package/build-module/list-item/utils.js +78 -1
  313. package/build-module/list-item/utils.js.map +1 -1
  314. package/build-module/media-text/edit.js +6 -3
  315. package/build-module/media-text/edit.js.map +1 -1
  316. package/build-module/missing/edit.native.js +2 -2
  317. package/build-module/missing/edit.native.js.map +1 -1
  318. package/build-module/navigation/edit/are-blocks-dirty.js +44 -0
  319. package/build-module/navigation/edit/are-blocks-dirty.js.map +1 -0
  320. package/build-module/navigation/edit/index.js +95 -118
  321. package/build-module/navigation/edit/index.js.map +1 -1
  322. package/build-module/navigation/edit/menu-inspector-controls.js +80 -0
  323. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -0
  324. package/build-module/navigation/edit/navigation-menu-selector.js +2 -4
  325. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  326. package/build-module/navigation/edit/unsaved-inner-blocks.js +9 -6
  327. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  328. package/build-module/navigation/edit/utils.js +75 -0
  329. package/build-module/navigation/edit/utils.js.map +1 -1
  330. package/build-module/navigation/view-modal.js +6 -2
  331. package/build-module/navigation/view-modal.js.map +1 -1
  332. package/build-module/navigation-link/edit.js +49 -357
  333. package/build-module/navigation-link/edit.js.map +1 -1
  334. package/build-module/navigation-link/link-ui.js +206 -0
  335. package/build-module/navigation-link/link-ui.js.map +1 -0
  336. package/build-module/navigation-link/transforms.js +12 -0
  337. package/build-module/navigation-link/transforms.js.map +1 -1
  338. package/build-module/navigation-link/update-attributes.js +97 -0
  339. package/build-module/navigation-link/update-attributes.js.map +1 -0
  340. package/build-module/navigation-submenu/edit.js +52 -246
  341. package/build-module/navigation-submenu/edit.js.map +1 -1
  342. package/build-module/page-list/constants.js +6 -0
  343. package/build-module/page-list/constants.js.map +1 -0
  344. package/build-module/page-list/convert-to-links-modal.js +20 -81
  345. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  346. package/build-module/page-list/convert-to-navigation-links.js +66 -0
  347. package/build-module/page-list/convert-to-navigation-links.js.map +1 -0
  348. package/build-module/page-list/edit.js +146 -82
  349. package/build-module/page-list/edit.js.map +1 -1
  350. package/build-module/page-list/index.js +36 -4
  351. package/build-module/page-list/index.js.map +1 -1
  352. package/build-module/page-list-item/edit.js +77 -0
  353. package/build-module/page-list-item/edit.js.map +1 -0
  354. package/build-module/page-list-item/index.js +68 -0
  355. package/build-module/page-list-item/index.js.map +1 -0
  356. package/build-module/page-list-item/init.js +6 -0
  357. package/build-module/page-list-item/init.js.map +1 -0
  358. package/build-module/paragraph/index.js +1 -7
  359. package/build-module/paragraph/index.js.map +1 -1
  360. package/build-module/post-author/edit.js +3 -2
  361. package/build-module/post-author/edit.js.map +1 -1
  362. package/build-module/post-featured-image/overlay.js +1 -1
  363. package/build-module/post-featured-image/overlay.js.map +1 -1
  364. package/build-module/post-template/index.js +8 -0
  365. package/build-module/post-template/index.js.map +1 -1
  366. package/build-module/preformatted/transforms.js +3 -1
  367. package/build-module/preformatted/transforms.js.map +1 -1
  368. package/build-module/query/deprecated.js +185 -21
  369. package/build-module/query/deprecated.js.map +1 -1
  370. package/build-module/query/edit/index.js +2 -1
  371. package/build-module/query/edit/index.js.map +1 -1
  372. package/build-module/query/edit/inspector-controls/index.js +11 -5
  373. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  374. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +99 -35
  375. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  376. package/build-module/query/edit/query-content.js +1 -1
  377. package/build-module/query/edit/query-content.js.map +1 -1
  378. package/build-module/query/edit/query-placeholder.js +15 -27
  379. package/build-module/query/edit/query-placeholder.js.map +1 -1
  380. package/build-module/query/index.js +0 -8
  381. package/build-module/query/index.js.map +1 -1
  382. package/build-module/query/utils.js +69 -8
  383. package/build-module/query/utils.js.map +1 -1
  384. package/build-module/rss/edit.js +3 -0
  385. package/build-module/rss/edit.js.map +1 -1
  386. package/build-module/search/edit.js +2 -2
  387. package/build-module/search/edit.js.map +1 -1
  388. package/build-module/search/edit.native.js +20 -20
  389. package/build-module/search/edit.native.js.map +1 -1
  390. package/build-module/search/index.js +8 -1
  391. package/build-module/search/index.js.map +1 -1
  392. package/build-module/site-logo/edit.js +17 -8
  393. package/build-module/site-logo/edit.js.map +1 -1
  394. package/build-module/site-logo/index.js +1 -0
  395. package/build-module/site-logo/index.js.map +1 -1
  396. package/build-module/site-title/index.js +1 -0
  397. package/build-module/site-title/index.js.map +1 -1
  398. package/build-module/social-link/edit.js +2 -2
  399. package/build-module/social-link/edit.js.map +1 -1
  400. package/build-module/social-link/social-list.js +2 -11
  401. package/build-module/social-link/social-list.js.map +1 -1
  402. package/build-module/social-links/edit.js +0 -1
  403. package/build-module/social-links/edit.js.map +1 -1
  404. package/build-module/table/edit.js +3 -1
  405. package/build-module/table/edit.js.map +1 -1
  406. package/build-module/table/index.js +17 -1
  407. package/build-module/table/index.js.map +1 -1
  408. package/build-module/table/save.js +4 -2
  409. package/build-module/table/save.js.map +1 -1
  410. package/build-module/table/state.js +25 -13
  411. package/build-module/table/state.js.map +1 -1
  412. package/build-module/table/transforms.js +3 -2
  413. package/build-module/table/transforms.js.map +1 -1
  414. package/build-module/table-of-contents/edit.js +3 -3
  415. package/build-module/table-of-contents/edit.js.map +1 -1
  416. package/build-module/tag-cloud/edit.js +3 -2
  417. package/build-module/tag-cloud/edit.js.map +1 -1
  418. package/build-module/template-part/edit/advanced-controls.js +10 -1
  419. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  420. package/build-module/template-part/edit/import-controls.js +146 -0
  421. package/build-module/template-part/edit/import-controls.js.map +1 -0
  422. package/build-module/template-part/edit/index.js +2 -1
  423. package/build-module/template-part/edit/index.js.map +1 -1
  424. package/build-module/template-part/edit/selection-modal.js +6 -3
  425. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  426. package/build-module/template-part/edit/utils/hooks.js +3 -7
  427. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  428. package/build-module/template-part/edit/utils/transformers.js +40 -0
  429. package/build-module/template-part/edit/utils/transformers.js.map +1 -0
  430. package/build-module/text-columns/edit.js +1 -0
  431. package/build-module/text-columns/edit.js.map +1 -1
  432. package/build-module/utils/transformation-categories.native.js +1 -1
  433. package/build-module/utils/transformation-categories.native.js.map +1 -1
  434. package/build-module/video/edit.js +1 -1
  435. package/build-module/video/edit.js.map +1 -1
  436. package/build-module/video/edit.native.js +1 -2
  437. package/build-module/video/edit.native.js.map +1 -1
  438. package/build-style/archives/editor-rtl.css +15 -3
  439. package/build-style/archives/editor.css +15 -3
  440. package/build-style/archives/style-rtl.css +15 -3
  441. package/build-style/archives/style.css +15 -3
  442. package/build-style/audio/editor-rtl.css +15 -3
  443. package/build-style/audio/editor.css +15 -3
  444. package/build-style/audio/style-rtl.css +15 -3
  445. package/build-style/audio/style.css +15 -3
  446. package/build-style/audio/theme-rtl.css +15 -3
  447. package/build-style/audio/theme.css +15 -3
  448. package/build-style/avatar/editor-rtl.css +15 -3
  449. package/build-style/avatar/editor.css +15 -3
  450. package/build-style/avatar/style-rtl.css +15 -3
  451. package/build-style/avatar/style.css +15 -3
  452. package/build-style/block/editor-rtl.css +25 -3
  453. package/build-style/block/editor.css +25 -3
  454. package/build-style/button/editor-rtl.css +15 -3
  455. package/build-style/button/editor.css +15 -3
  456. package/build-style/button/style-rtl.css +15 -3
  457. package/build-style/button/style.css +15 -3
  458. package/build-style/buttons/editor-rtl.css +15 -3
  459. package/build-style/buttons/editor.css +15 -3
  460. package/build-style/buttons/style-rtl.css +15 -3
  461. package/build-style/buttons/style.css +15 -3
  462. package/build-style/calendar/style-rtl.css +15 -3
  463. package/build-style/calendar/style.css +15 -3
  464. package/build-style/categories/editor-rtl.css +15 -3
  465. package/build-style/categories/editor.css +15 -3
  466. package/build-style/categories/style-rtl.css +15 -3
  467. package/build-style/categories/style.css +15 -3
  468. package/build-style/classic-rtl.css +15 -3
  469. package/build-style/classic.css +15 -3
  470. package/build-style/code/editor-rtl.css +15 -3
  471. package/build-style/code/editor.css +15 -3
  472. package/build-style/code/style-rtl.css +15 -3
  473. package/build-style/code/style.css +15 -3
  474. package/build-style/code/theme-rtl.css +15 -3
  475. package/build-style/code/theme.css +15 -3
  476. package/build-style/columns/editor-rtl.css +15 -3
  477. package/build-style/columns/editor.css +15 -3
  478. package/build-style/columns/style-rtl.css +15 -3
  479. package/build-style/columns/style.css +15 -3
  480. package/build-style/comment-author-avatar/editor-rtl.css +15 -3
  481. package/build-style/comment-author-avatar/editor.css +15 -3
  482. package/build-style/comment-content/style-rtl.css +15 -3
  483. package/build-style/comment-content/style.css +15 -3
  484. package/build-style/comment-template/style-rtl.css +15 -3
  485. package/build-style/comment-template/style.css +15 -3
  486. package/build-style/comments/editor-rtl.css +15 -3
  487. package/build-style/comments/editor.css +15 -3
  488. package/build-style/comments/style-rtl.css +15 -3
  489. package/build-style/comments/style.css +15 -3
  490. package/build-style/comments-pagination/editor-rtl.css +15 -3
  491. package/build-style/comments-pagination/editor.css +15 -3
  492. package/build-style/comments-pagination/style-rtl.css +15 -3
  493. package/build-style/comments-pagination/style.css +15 -3
  494. package/build-style/comments-pagination-numbers/editor-rtl.css +15 -3
  495. package/build-style/comments-pagination-numbers/editor.css +15 -3
  496. package/build-style/comments-title/editor-rtl.css +15 -3
  497. package/build-style/comments-title/editor.css +15 -3
  498. package/build-style/common-rtl.css +20 -4
  499. package/build-style/common.css +20 -4
  500. package/build-style/cover/editor-rtl.css +15 -3
  501. package/build-style/cover/editor.css +15 -3
  502. package/build-style/cover/style-rtl.css +17 -4
  503. package/build-style/cover/style.css +17 -4
  504. package/build-style/editor-elements-rtl.css +15 -3
  505. package/build-style/editor-elements.css +15 -3
  506. package/build-style/editor-rtl.css +46 -29
  507. package/build-style/editor.css +46 -29
  508. package/build-style/elements-rtl.css +15 -3
  509. package/build-style/elements.css +15 -3
  510. package/build-style/embed/editor-rtl.css +15 -3
  511. package/build-style/embed/editor.css +15 -3
  512. package/build-style/embed/style-rtl.css +15 -3
  513. package/build-style/embed/style.css +15 -3
  514. package/build-style/embed/theme-rtl.css +15 -3
  515. package/build-style/embed/theme.css +15 -3
  516. package/build-style/file/editor-rtl.css +15 -3
  517. package/build-style/file/editor.css +15 -3
  518. package/build-style/file/style-rtl.css +15 -3
  519. package/build-style/file/style.css +15 -3
  520. package/build-style/freeform/editor-rtl.css +15 -3
  521. package/build-style/freeform/editor.css +15 -3
  522. package/build-style/gallery/editor-rtl.css +16 -4
  523. package/build-style/gallery/editor.css +16 -4
  524. package/build-style/gallery/style-rtl.css +19 -5
  525. package/build-style/gallery/style.css +19 -5
  526. package/build-style/gallery/theme-rtl.css +15 -3
  527. package/build-style/gallery/theme.css +15 -3
  528. package/build-style/group/editor-rtl.css +15 -3
  529. package/build-style/group/editor.css +15 -3
  530. package/build-style/group/style-rtl.css +15 -3
  531. package/build-style/group/style.css +15 -3
  532. package/build-style/group/theme-rtl.css +15 -3
  533. package/build-style/group/theme.css +15 -3
  534. package/build-style/heading/style-rtl.css +15 -3
  535. package/build-style/heading/style.css +15 -3
  536. package/build-style/html/editor-rtl.css +15 -3
  537. package/build-style/html/editor.css +15 -3
  538. package/build-style/image/editor-rtl.css +15 -12
  539. package/build-style/image/editor.css +15 -12
  540. package/build-style/image/style-rtl.css +15 -3
  541. package/build-style/image/style.css +15 -3
  542. package/build-style/image/theme-rtl.css +15 -3
  543. package/build-style/image/theme.css +15 -3
  544. package/build-style/latest-comments/style-rtl.css +15 -3
  545. package/build-style/latest-comments/style.css +15 -3
  546. package/build-style/latest-posts/editor-rtl.css +15 -3
  547. package/build-style/latest-posts/editor.css +15 -3
  548. package/build-style/latest-posts/style-rtl.css +15 -3
  549. package/build-style/latest-posts/style.css +15 -3
  550. package/build-style/list/style-rtl.css +15 -3
  551. package/build-style/list/style.css +15 -3
  552. package/build-style/media-text/editor-rtl.css +15 -3
  553. package/build-style/media-text/editor.css +15 -3
  554. package/build-style/media-text/style-rtl.css +15 -3
  555. package/build-style/media-text/style.css +15 -3
  556. package/build-style/more/editor-rtl.css +15 -3
  557. package/build-style/more/editor.css +15 -3
  558. package/build-style/navigation/editor-rtl.css +15 -9
  559. package/build-style/navigation/editor.css +15 -9
  560. package/build-style/navigation/style-rtl.css +15 -4
  561. package/build-style/navigation/style.css +15 -4
  562. package/build-style/navigation-link/editor-rtl.css +15 -3
  563. package/build-style/navigation-link/editor.css +15 -3
  564. package/build-style/navigation-link/style-rtl.css +15 -3
  565. package/build-style/navigation-link/style.css +15 -3
  566. package/build-style/navigation-submenu/editor-rtl.css +15 -3
  567. package/build-style/navigation-submenu/editor.css +15 -3
  568. package/build-style/nextpage/editor-rtl.css +15 -3
  569. package/build-style/nextpage/editor.css +15 -3
  570. package/build-style/page-list/editor-rtl.css +19 -3
  571. package/build-style/page-list/editor.css +19 -3
  572. package/build-style/page-list/style-rtl.css +15 -3
  573. package/build-style/page-list/style.css +15 -3
  574. package/build-style/paragraph/editor-rtl.css +15 -3
  575. package/build-style/paragraph/editor.css +15 -3
  576. package/build-style/paragraph/style-rtl.css +15 -3
  577. package/build-style/paragraph/style.css +15 -3
  578. package/build-style/post-author/style-rtl.css +15 -3
  579. package/build-style/post-author/style.css +15 -3
  580. package/build-style/post-comments-form/editor-rtl.css +15 -3
  581. package/build-style/post-comments-form/editor.css +15 -3
  582. package/build-style/post-comments-form/style-rtl.css +15 -3
  583. package/build-style/post-comments-form/style.css +15 -3
  584. package/build-style/post-date/style-rtl.css +15 -3
  585. package/build-style/post-date/style.css +15 -3
  586. package/build-style/post-excerpt/editor-rtl.css +15 -3
  587. package/build-style/post-excerpt/editor.css +15 -3
  588. package/build-style/post-excerpt/style-rtl.css +15 -3
  589. package/build-style/post-excerpt/style.css +15 -3
  590. package/build-style/post-featured-image/editor-rtl.css +15 -3
  591. package/build-style/post-featured-image/editor.css +15 -3
  592. package/build-style/post-featured-image/style-rtl.css +15 -3
  593. package/build-style/post-featured-image/style.css +15 -3
  594. package/build-style/post-navigation-link/style-rtl.css +15 -3
  595. package/build-style/post-navigation-link/style.css +15 -3
  596. package/build-style/post-template/editor-rtl.css +15 -3
  597. package/build-style/post-template/editor.css +15 -3
  598. package/build-style/post-template/style-rtl.css +15 -3
  599. package/build-style/post-template/style.css +15 -3
  600. package/build-style/post-terms/style-rtl.css +15 -3
  601. package/build-style/post-terms/style.css +15 -3
  602. package/build-style/post-title/style-rtl.css +15 -3
  603. package/build-style/post-title/style.css +15 -3
  604. package/build-style/preformatted/style-rtl.css +15 -3
  605. package/build-style/preformatted/style.css +15 -3
  606. package/build-style/pullquote/editor-rtl.css +15 -3
  607. package/build-style/pullquote/editor.css +15 -3
  608. package/build-style/pullquote/style-rtl.css +15 -3
  609. package/build-style/pullquote/style.css +15 -3
  610. package/build-style/pullquote/theme-rtl.css +15 -3
  611. package/build-style/pullquote/theme.css +15 -3
  612. package/build-style/query/editor-rtl.css +15 -3
  613. package/build-style/query/editor.css +15 -3
  614. package/build-style/query-pagination/editor-rtl.css +15 -3
  615. package/build-style/query-pagination/editor.css +15 -3
  616. package/build-style/query-pagination/style-rtl.css +15 -3
  617. package/build-style/query-pagination/style.css +15 -3
  618. package/build-style/query-pagination-numbers/editor-rtl.css +15 -3
  619. package/build-style/query-pagination-numbers/editor.css +15 -3
  620. package/build-style/query-title/style-rtl.css +15 -3
  621. package/build-style/query-title/style.css +15 -3
  622. package/build-style/quote/style-rtl.css +15 -3
  623. package/build-style/quote/style.css +15 -3
  624. package/build-style/quote/theme-rtl.css +15 -3
  625. package/build-style/quote/theme.css +15 -3
  626. package/build-style/read-more/style-rtl.css +15 -3
  627. package/build-style/read-more/style.css +15 -3
  628. package/build-style/reset-rtl.css +15 -3
  629. package/build-style/reset.css +15 -3
  630. package/build-style/rss/editor-rtl.css +15 -3
  631. package/build-style/rss/editor.css +15 -3
  632. package/build-style/rss/style-rtl.css +15 -3
  633. package/build-style/rss/style.css +15 -3
  634. package/build-style/search/editor-rtl.css +15 -3
  635. package/build-style/search/editor.css +15 -3
  636. package/build-style/search/style-rtl.css +15 -3
  637. package/build-style/search/style.css +15 -3
  638. package/build-style/search/theme-rtl.css +15 -3
  639. package/build-style/search/theme.css +15 -3
  640. package/build-style/separator/editor-rtl.css +15 -3
  641. package/build-style/separator/editor.css +15 -3
  642. package/build-style/separator/style-rtl.css +15 -3
  643. package/build-style/separator/style.css +15 -3
  644. package/build-style/separator/theme-rtl.css +15 -3
  645. package/build-style/separator/theme.css +15 -3
  646. package/build-style/shortcode/editor-rtl.css +16 -4
  647. package/build-style/shortcode/editor.css +16 -4
  648. package/build-style/site-logo/editor-rtl.css +15 -3
  649. package/build-style/site-logo/editor.css +15 -3
  650. package/build-style/site-logo/style-rtl.css +15 -3
  651. package/build-style/site-logo/style.css +15 -3
  652. package/build-style/site-tagline/editor-rtl.css +15 -3
  653. package/build-style/site-tagline/editor.css +15 -3
  654. package/build-style/site-title/editor-rtl.css +15 -3
  655. package/build-style/site-title/editor.css +15 -3
  656. package/build-style/site-title/style-rtl.css +15 -3
  657. package/build-style/site-title/style.css +15 -3
  658. package/build-style/social-link/editor-rtl.css +15 -3
  659. package/build-style/social-link/editor.css +15 -3
  660. package/build-style/social-links/editor-rtl.css +15 -3
  661. package/build-style/social-links/editor.css +15 -3
  662. package/build-style/social-links/style-rtl.css +15 -3
  663. package/build-style/social-links/style.css +15 -3
  664. package/build-style/spacer/editor-rtl.css +15 -3
  665. package/build-style/spacer/editor.css +15 -3
  666. package/build-style/spacer/style-rtl.css +15 -3
  667. package/build-style/spacer/style.css +15 -3
  668. package/build-style/style-rtl.css +36 -10
  669. package/build-style/style.css +36 -10
  670. package/build-style/table/editor-rtl.css +15 -11
  671. package/build-style/table/editor.css +15 -11
  672. package/build-style/table/style-rtl.css +21 -3
  673. package/build-style/table/style.css +21 -3
  674. package/build-style/table/theme-rtl.css +15 -9
  675. package/build-style/table/theme.css +15 -9
  676. package/build-style/tag-cloud/style-rtl.css +15 -3
  677. package/build-style/tag-cloud/style.css +15 -3
  678. package/build-style/template-part/editor-rtl.css +30 -4
  679. package/build-style/template-part/editor.css +30 -4
  680. package/build-style/template-part/theme-rtl.css +15 -3
  681. package/build-style/template-part/theme.css +15 -3
  682. package/build-style/text-columns/editor-rtl.css +15 -3
  683. package/build-style/text-columns/editor.css +15 -3
  684. package/build-style/text-columns/style-rtl.css +15 -3
  685. package/build-style/text-columns/style.css +15 -3
  686. package/build-style/theme-rtl.css +15 -9
  687. package/build-style/theme.css +15 -9
  688. package/build-style/verse/style-rtl.css +19 -4
  689. package/build-style/verse/style.css +19 -4
  690. package/build-style/video/editor-rtl.css +15 -3
  691. package/build-style/video/editor.css +15 -3
  692. package/build-style/video/style-rtl.css +17 -4
  693. package/build-style/video/style.css +17 -4
  694. package/build-style/video/theme-rtl.css +15 -3
  695. package/build-style/video/theme.css +15 -3
  696. package/package.json +32 -30
  697. package/src/audio/edit.native.js +1 -2
  698. package/src/audio/index.js +1 -0
  699. package/src/avatar/edit.js +1 -0
  700. package/src/avatar/user-control.js +1 -0
  701. package/src/block/block.json +1 -2
  702. package/src/block/edit.js +14 -3
  703. package/src/block/edit.native.js +24 -12
  704. package/src/block/editor.scss +17 -0
  705. package/src/block/index.php +1 -2
  706. package/src/block/test/edit.native.js +28 -32
  707. package/src/button/edit.native.js +1 -0
  708. package/src/buttons/test/edit.native.js +40 -51
  709. package/src/categories/edit.js +1 -1
  710. package/src/code/transforms.js +3 -1
  711. package/src/columns/edit.js +1 -0
  712. package/src/columns/edit.native.js +18 -26
  713. package/src/comment-author-avatar/edit.js +1 -0
  714. package/src/comments/index.php +0 -1
  715. package/src/cover/edit/inspector-controls.js +6 -4
  716. package/src/cover/edit.native.js +32 -19
  717. package/src/cover/test/edit.native.js +73 -126
  718. package/src/embed/embed-controls.native.js +1 -0
  719. package/src/embed/embed-preview.native.js +1 -2
  720. package/src/embed/test/index.native.js +237 -231
  721. package/src/file/inspector.js +1 -0
  722. package/src/file/test/__snapshots__/edit.native.js.snap +2 -6
  723. package/src/freeform/edit.js +48 -29
  724. package/src/freeform/modal.js +111 -0
  725. package/src/gallery/edit.js +32 -7
  726. package/src/gallery/gallery.js +3 -13
  727. package/src/gallery/gallery.native.js +1 -2
  728. package/src/gallery/shared.js +7 -11
  729. package/src/gallery/transforms.js +1 -6
  730. package/src/gallery/use-get-media.js +1 -1
  731. package/src/gallery/use-get-media.native.js +2 -1
  732. package/src/gallery/v1/edit.js +8 -7
  733. package/src/gallery/v1/gallery.native.js +1 -2
  734. package/src/gallery/v1/shared.js +7 -2
  735. package/src/group/block.json +3 -1
  736. package/src/group/edit.js +2 -6
  737. package/src/group/placeholder.js +6 -25
  738. package/src/group/test/__snapshots__/edit.native.js.snap +1 -1
  739. package/src/heading/block.json +1 -2
  740. package/src/heading/deprecated.js +209 -136
  741. package/src/heading/index.php +52 -0
  742. package/src/heading/test/__snapshots__/index.native.js.snap +7 -0
  743. package/src/heading/test/index.native.js +44 -0
  744. package/src/home-link/index.php +1 -1
  745. package/src/html/block.json +1 -1
  746. package/src/image/edit.js +7 -2
  747. package/src/image/edit.native.js +2 -1
  748. package/src/image/editor.scss +0 -11
  749. package/src/image/image.js +14 -8
  750. package/src/image/test/edit.native.js +14 -10
  751. package/src/index.js +2 -0
  752. package/src/latest-comments/edit.js +1 -0
  753. package/src/latest-posts/edit.js +2 -0
  754. package/src/latest-posts/test/__snapshots__/edit.native.js.snap +3 -0
  755. package/src/latest-posts/test/edit.native.js +49 -0
  756. package/src/list/test/edit.native.js +53 -45
  757. package/src/list/transforms.js +0 -11
  758. package/src/list/utils.js +6 -2
  759. package/src/list-item/index.js +2 -0
  760. package/src/list-item/transforms.js +17 -0
  761. package/src/list-item/utils.js +10 -1
  762. package/src/media-text/edit.js +6 -3
  763. package/src/missing/edit.native.js +13 -6
  764. package/src/missing/test/edit-integration.native.js +10 -12
  765. package/src/more/test/__snapshots__/edit.native.js.snap +7 -0
  766. package/src/more/test/edit.native.js +41 -0
  767. package/src/navigation/edit/are-blocks-dirty.js +51 -0
  768. package/src/navigation/edit/index.js +229 -298
  769. package/src/navigation/edit/menu-inspector-controls.js +119 -0
  770. package/src/navigation/edit/navigation-menu-selector.js +6 -7
  771. package/src/navigation/edit/test/are-blocks-dirty.js +121 -0
  772. package/src/navigation/edit/unsaved-inner-blocks.js +12 -7
  773. package/src/navigation/edit/utils.js +82 -0
  774. package/src/navigation/editor.scss +0 -7
  775. package/src/navigation/index.php +89 -10
  776. package/src/navigation/style.scss +0 -1
  777. package/src/navigation/view-modal.js +11 -1
  778. package/src/navigation-link/edit.js +62 -386
  779. package/src/navigation-link/index.php +64 -0
  780. package/src/navigation-link/link-ui.js +213 -0
  781. package/src/navigation-link/test/edit.js +23 -82
  782. package/src/navigation-link/transforms.js +14 -0
  783. package/src/navigation-link/update-attributes.js +99 -0
  784. package/src/navigation-submenu/edit.js +85 -276
  785. package/src/navigation-submenu/index.php +72 -0
  786. package/src/page-list/block.json +24 -2
  787. package/src/page-list/constants.js +8 -0
  788. package/src/page-list/convert-to-links-modal.js +19 -76
  789. package/src/page-list/convert-to-navigation-links.js +60 -0
  790. package/src/page-list/edit.js +187 -118
  791. package/src/page-list/editor.scss +4 -0
  792. package/src/page-list/index.js +8 -2
  793. package/src/page-list/index.php +18 -10
  794. package/src/page-list/test/convert-to-links-modal.js +28 -34
  795. package/src/page-list-item/block.json +51 -0
  796. package/src/page-list-item/edit.js +102 -0
  797. package/src/page-list-item/index.js +24 -0
  798. package/src/page-list-item/init.js +6 -0
  799. package/src/paragraph/index.js +0 -6
  800. package/src/post-author/edit.js +3 -2
  801. package/src/post-content/index.php +1 -2
  802. package/src/post-featured-image/index.php +7 -2
  803. package/src/post-featured-image/overlay.js +1 -1
  804. package/src/post-template/block.json +8 -0
  805. package/src/preformatted/transforms.js +4 -1
  806. package/src/query/block.json +0 -8
  807. package/src/query/deprecated.js +257 -86
  808. package/src/query/edit/index.js +1 -0
  809. package/src/query/edit/inspector-controls/index.js +50 -38
  810. package/src/query/edit/inspector-controls/taxonomy-controls.js +102 -38
  811. package/src/query/edit/query-content.js +2 -1
  812. package/src/query/edit/query-placeholder.js +14 -25
  813. package/src/query/utils.js +59 -1
  814. package/src/rss/edit.js +3 -0
  815. package/src/search/edit.js +2 -2
  816. package/src/search/edit.native.js +31 -27
  817. package/src/search/index.js +5 -1
  818. package/src/separator/test/__snapshots__/edit.native.js.snap +7 -0
  819. package/src/separator/test/edit.native.js +41 -0
  820. package/src/shortcode/test/edit.native.js +15 -18
  821. package/src/site-logo/edit.js +13 -5
  822. package/src/site-logo/index.js +1 -0
  823. package/src/site-title/index.js +1 -0
  824. package/src/social-link/edit.js +3 -3
  825. package/src/social-link/social-list.js +2 -7
  826. package/src/social-link/test/index.native.js +10 -16
  827. package/src/social-links/edit.js +0 -1
  828. package/src/social-links/test/edit.native.js +4 -3
  829. package/src/spacer/test/index.native.js +39 -36
  830. package/src/table/block.json +15 -0
  831. package/src/table/edit.js +2 -1
  832. package/src/table/editor.scss +0 -4
  833. package/src/table/index.js +1 -0
  834. package/src/table/save.js +5 -1
  835. package/src/table/state.js +22 -7
  836. package/src/table/style.scss +8 -0
  837. package/src/table/theme.scss +0 -8
  838. package/src/table/transforms.js +2 -1
  839. package/src/table-of-contents/edit.js +3 -3
  840. package/src/tag-cloud/edit.js +3 -2
  841. package/src/template-part/edit/advanced-controls.js +12 -0
  842. package/src/template-part/edit/import-controls.js +180 -0
  843. package/src/template-part/edit/index.js +1 -0
  844. package/src/template-part/edit/selection-modal.js +4 -3
  845. package/src/template-part/edit/utils/hooks.js +7 -3
  846. package/src/template-part/edit/utils/transformers.js +37 -0
  847. package/src/template-part/editor.scss +20 -2
  848. package/src/template-part/index.php +1 -2
  849. package/src/text-columns/edit.js +1 -0
  850. package/src/utils/transformation-categories.native.js +1 -0
  851. package/src/verse/style.scss +4 -1
  852. package/src/verse/test/__snapshots__/edit.native.js.snap +13 -0
  853. package/src/verse/test/edit.native.js +40 -33
  854. package/src/video/edit.js +1 -1
  855. package/src/video/edit.native.js +1 -2
  856. package/test/babel-plugin.js +35 -35
  857. package/tsconfig.tsbuildinfo +1 -1
  858. package/build/query/constants.js +0 -16
  859. package/build/query/constants.js.map +0 -1
  860. package/build-module/query/constants.js +0 -7
  861. package/build-module/query/constants.js.map +0 -1
  862. package/src/query/constants.js +0 -7
@@ -28,12 +28,11 @@ afterAll( () => {
28
28
 
29
29
  describe( 'Spacer block', () => {
30
30
  it( 'inserts block', async () => {
31
- const { getByLabelText, getByTestId, getByText } =
32
- await initializeEditor();
31
+ const screen = await initializeEditor();
33
32
 
34
- fireEvent.press( getByLabelText( 'Add block' ) );
33
+ fireEvent.press( screen.getByLabelText( 'Add block' ) );
35
34
 
36
- const blockList = getByTestId( 'InserterUI-Blocks' );
35
+ const blockList = screen.getByTestId( 'InserterUI-Blocks' );
37
36
  // onScroll event used to force the FlatList to render all items
38
37
  fireEvent.scroll( blockList, {
39
38
  nativeEvent: {
@@ -43,9 +42,11 @@ describe( 'Spacer block', () => {
43
42
  },
44
43
  } );
45
44
 
46
- fireEvent.press( await waitFor( () => getByText( 'Spacer' ) ) );
45
+ fireEvent.press( screen.getByText( 'Spacer' ) );
47
46
 
48
- expect( getByLabelText( /Spacer Block\. Row 1/ ) ).toBeVisible();
47
+ const [ spacerBlock ] =
48
+ screen.getAllByLabelText( /Spacer Block\. Row 1/ );
49
+ expect( spacerBlock ).toBeVisible();
49
50
  expect( getEditorHtml() ).toMatchSnapshot();
50
51
  } );
51
52
 
@@ -53,24 +54,24 @@ describe( 'Spacer block', () => {
53
54
  const initialHtml = `<!-- wp:spacer -->
54
55
  <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
55
56
  <!-- /wp:spacer -->`;
56
- const { getByLabelText, getByDisplayValue, getByTestId, getByText } =
57
- await initializeEditor( {
58
- initialHtml,
59
- } );
57
+ const screen = await initializeEditor( {
58
+ initialHtml,
59
+ } );
60
60
 
61
61
  // Select Spacer block
62
- const spacerBlock = getByLabelText( /Spacer Block\. Row 1/ );
62
+ const [ spacerBlock ] =
63
+ screen.getAllByLabelText( /Spacer Block\. Row 1/ );
63
64
  fireEvent.press( spacerBlock );
64
65
 
65
66
  // Open block settings
66
- fireEvent.press( getByLabelText( 'Open Settings' ) );
67
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
67
68
  await waitFor(
68
- () => getByTestId( 'block-settings-modal' ).props.isVisible
69
+ () => screen.getByTestId( 'block-settings-modal' ).props.isVisible
69
70
  );
70
71
 
71
72
  // Update height attribute
72
- fireEvent.press( getByText( '100' ) );
73
- const heightTextInput = getByDisplayValue( '100' );
73
+ fireEvent.press( screen.getByText( '100' ) );
74
+ const heightTextInput = screen.getByDisplayValue( '100' );
74
75
  fireEvent.changeText( heightTextInput, '50' );
75
76
 
76
77
  expect( getEditorHtml() ).toMatchSnapshot();
@@ -80,28 +81,28 @@ describe( 'Spacer block', () => {
80
81
  const initialHtml = `<!-- wp:spacer -->
81
82
  <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
82
83
  <!-- /wp:spacer -->`;
83
- const { getByLabelText, getByDisplayValue, getByTestId, getByText } =
84
- await initializeEditor( {
85
- initialHtml,
86
- } );
84
+ const screen = await initializeEditor( {
85
+ initialHtml,
86
+ } );
87
87
 
88
88
  // Select Spacer block
89
- const spacerBlock = getByLabelText( /Spacer Block\. Row 1/ );
89
+ const [ spacerBlock ] =
90
+ screen.getAllByLabelText( /Spacer Block\. Row 1/ );
90
91
  fireEvent.press( spacerBlock );
91
92
 
92
93
  // Open block settings
93
- fireEvent.press( getByLabelText( 'Open Settings' ) );
94
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
94
95
  await waitFor(
95
- () => getByTestId( 'block-settings-modal' ).props.isVisible
96
+ () => screen.getByTestId( 'block-settings-modal' ).props.isVisible
96
97
  );
97
98
 
98
99
  // Set vh unit
99
- fireEvent.press( getByText( 'px' ) );
100
- fireEvent.press( getByText( 'Viewport height (vh)' ) );
100
+ fireEvent.press( screen.getByText( 'px' ) );
101
+ fireEvent.press( screen.getByText( 'Viewport height (vh)' ) );
101
102
 
102
103
  // Update height attribute
103
- fireEvent.press( getByText( '100' ) );
104
- const heightTextInput = getByDisplayValue( '100' );
104
+ fireEvent.press( screen.getByText( '100' ) );
105
+ const heightTextInput = screen.getByDisplayValue( '100' );
105
106
  fireEvent.changeText( heightTextInput, '25' );
106
107
 
107
108
  expect( getEditorHtml() ).toMatchSnapshot();
@@ -111,23 +112,24 @@ describe( 'Spacer block', () => {
111
112
  const initialHtml = `<!-- wp:spacer -->
112
113
  <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
113
114
  <!-- /wp:spacer -->`;
114
- const { getByLabelText, getByTestId } = await initializeEditor( {
115
+ const screen = await initializeEditor( {
115
116
  initialHtml,
116
117
  } );
117
118
 
118
119
  // Select Spacer block
119
- const spacerBlock = getByLabelText( /Spacer Block\. Row 1/ );
120
+ const [ spacerBlock ] =
121
+ screen.getAllByLabelText( /Spacer Block\. Row 1/ );
120
122
  fireEvent.press( spacerBlock );
121
123
 
122
124
  // Open block settings
123
- fireEvent.press( getByLabelText( 'Open Settings' ) );
125
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
124
126
  await waitFor(
125
- () => getByTestId( 'block-settings-modal' ).props.isVisible
127
+ () => screen.getByTestId( 'block-settings-modal' ).props.isVisible
126
128
  );
127
129
 
128
130
  // Increment height
129
131
  fireEvent(
130
- getByLabelText( /Height\. Value is 100 Pixels \(px\)/ ),
132
+ screen.getByLabelText( /Height\. Value is 100 Pixels \(px\)/ ),
131
133
  'accessibilityAction',
132
134
  {
133
135
  nativeEvent: { actionName: 'increment' },
@@ -141,23 +143,24 @@ describe( 'Spacer block', () => {
141
143
  const initialHtml = `<!-- wp:spacer -->
142
144
  <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
143
145
  <!-- /wp:spacer -->`;
144
- const { getByLabelText, getByTestId } = await initializeEditor( {
146
+ const screen = await initializeEditor( {
145
147
  initialHtml,
146
148
  } );
147
149
 
148
150
  // Select Spacer block
149
- const spacerBlock = getByLabelText( /Spacer Block\. Row 1/ );
151
+ const [ spacerBlock ] =
152
+ screen.getAllByLabelText( /Spacer Block\. Row 1/ );
150
153
  fireEvent.press( spacerBlock );
151
154
 
152
155
  // Open block settings
153
- fireEvent.press( getByLabelText( 'Open Settings' ) );
156
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
154
157
  await waitFor(
155
- () => getByTestId( 'block-settings-modal' ).props.isVisible
158
+ () => screen.getByTestId( 'block-settings-modal' ).props.isVisible
156
159
  );
157
160
 
158
161
  // Increment height
159
162
  fireEvent(
160
- getByLabelText( /Height\. Value is 100 Pixels \(px\)/ ),
163
+ screen.getByLabelText( /Height\. Value is 100 Pixels \(px\)/ ),
161
164
  'accessibilityAction',
162
165
  {
163
166
  nativeEvent: { actionName: 'decrement' },
@@ -47,6 +47,11 @@
47
47
  "type": "string",
48
48
  "source": "attribute",
49
49
  "attribute": "data-align"
50
+ },
51
+ "colspan": {
52
+ "type": "string",
53
+ "source": "attribute",
54
+ "attribute": "colspan"
50
55
  }
51
56
  }
52
57
  }
@@ -82,6 +87,11 @@
82
87
  "type": "string",
83
88
  "source": "attribute",
84
89
  "attribute": "data-align"
90
+ },
91
+ "colspan": {
92
+ "type": "string",
93
+ "source": "attribute",
94
+ "attribute": "colspan"
85
95
  }
86
96
  }
87
97
  }
@@ -117,6 +127,11 @@
117
127
  "type": "string",
118
128
  "source": "attribute",
119
129
  "attribute": "data-align"
130
+ },
131
+ "colspan": {
132
+ "type": "string",
133
+ "source": "attribute",
134
+ "attribute": "colspan"
120
135
  }
121
136
  }
122
137
  }
package/src/table/edit.js CHANGED
@@ -404,7 +404,7 @@ function TableEdit( {
404
404
  <tr key={ rowIndex }>
405
405
  { cells.map(
406
406
  (
407
- { content, tag: CellTag, scope, align },
407
+ { content, tag: CellTag, scope, align, colspan },
408
408
  columnIndex
409
409
  ) => (
410
410
  <RichText
@@ -417,6 +417,7 @@ function TableEdit( {
417
417
  'wp-block-table__cell-content'
418
418
  ) }
419
419
  scope={ CellTag === 'th' ? scope : undefined }
420
+ colSpan={ colspan }
420
421
  value={ content }
421
422
  onChange={ onChange }
422
423
  unstableOnFocus={ () => {
@@ -41,10 +41,6 @@
41
41
  border-style: double;
42
42
  }
43
43
 
44
- figcaption {
45
- @include caption-style-theme();
46
- }
47
-
48
44
  // This is only required in the editor to overcome the fact the editor
49
45
  // rewrites border width styles into shorthand.
50
46
  table.has-individual-borders {
@@ -91,6 +91,7 @@ export const settings = {
91
91
  },
92
92
  ],
93
93
  },
94
+ viewportWidth: 450,
94
95
  },
95
96
  transforms,
96
97
  edit,
package/src/table/save.js CHANGED
@@ -43,7 +43,10 @@ export default function save( { attributes } ) {
43
43
  { rows.map( ( { cells }, rowIndex ) => (
44
44
  <tr key={ rowIndex }>
45
45
  { cells.map(
46
- ( { content, tag, scope, align }, cellIndex ) => {
46
+ (
47
+ { content, tag, scope, align, colspan },
48
+ cellIndex
49
+ ) => {
47
50
  const cellClasses = classnames( {
48
51
  [ `has-text-align-${ align }` ]: align,
49
52
  } );
@@ -62,6 +65,7 @@ export default function save( { attributes } ) {
62
65
  scope={
63
66
  tag === 'th' ? scope : undefined
64
67
  }
68
+ colSpan={ colspan }
65
69
  />
66
70
  );
67
71
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { get, mapValues, pick } from 'lodash';
4
+ import { get, mapValues } from 'lodash';
5
5
 
6
6
  const INHERITED_COLUMN_ATTRIBUTES = [ 'align' ];
7
7
 
@@ -78,7 +78,11 @@ export function updateSelectedCell( state, selection, updateCell ) {
78
78
  return state;
79
79
  }
80
80
 
81
- const tableSections = pick( state, [ 'head', 'body', 'foot' ] );
81
+ const tableSections = Object.fromEntries(
82
+ Object.entries( state ).filter( ( [ key ] ) =>
83
+ [ 'head', 'body', 'foot' ].includes( key )
84
+ )
85
+ );
82
86
  const { sectionName: selectionSectionName, rowIndex: selectionRowIndex } =
83
87
  selection;
84
88
 
@@ -174,9 +178,12 @@ export function insertRow( state, { sectionName, rowIndex, columnCount } ) {
174
178
  [ 'cells', index ],
175
179
  {}
176
180
  );
177
- const inheritedAttributes = pick(
178
- firstCellInColumn,
179
- INHERITED_COLUMN_ATTRIBUTES
181
+
182
+ const inheritedAttributes = Object.fromEntries(
183
+ Object.entries( firstCellInColumn ).filter(
184
+ ( [ key ] ) =>
185
+ INHERITED_COLUMN_ATTRIBUTES.includes( key )
186
+ )
180
187
  );
181
188
 
182
189
  return {
@@ -220,7 +227,11 @@ export function deleteRow( state, { sectionName, rowIndex } ) {
220
227
  * @return {Object} New table state.
221
228
  */
222
229
  export function insertColumn( state, { columnIndex } ) {
223
- const tableSections = pick( state, [ 'head', 'body', 'foot' ] );
230
+ const tableSections = Object.fromEntries(
231
+ Object.entries( state ).filter( ( [ key ] ) =>
232
+ [ 'head', 'body', 'foot' ].includes( key )
233
+ )
234
+ );
224
235
 
225
236
  return mapValues( tableSections, ( section, sectionName ) => {
226
237
  // Bail early if the table section is empty.
@@ -259,7 +270,11 @@ export function insertColumn( state, { columnIndex } ) {
259
270
  * @return {Object} New table state.
260
271
  */
261
272
  export function deleteColumn( state, { columnIndex } ) {
262
- const tableSections = pick( state, [ 'head', 'body', 'foot' ] );
273
+ const tableSections = Object.fromEntries(
274
+ Object.entries( state ).filter( ( [ key ] ) =>
275
+ [ 'head', 'body', 'foot' ].includes( key )
276
+ )
277
+ );
263
278
 
264
279
  return mapValues( tableSections, ( section ) => {
265
280
  // Bail early if the table section is empty.
@@ -11,6 +11,14 @@
11
11
  width: 100%;
12
12
  }
13
13
 
14
+ thead {
15
+ border-bottom: 3px solid;
16
+ }
17
+
18
+ tfoot {
19
+ border-top: 3px solid;
20
+ }
21
+
14
22
  // Match default border style to default style in editor
15
23
  td,
16
24
  th {
@@ -1,14 +1,6 @@
1
1
  .wp-block-table {
2
2
  margin: 0 0 1em 0;
3
3
 
4
- thead {
5
- border-bottom: 3px solid;
6
- }
7
-
8
- tfoot {
9
- border-top: 3px solid;
10
- }
11
-
12
4
  td,
13
5
  th {
14
6
  word-break: normal;
@@ -5,11 +5,12 @@ const tableContentPasteSchema = ( { phrasingContentSchema } ) => ( {
5
5
  th: {
6
6
  allowEmpty: true,
7
7
  children: phrasingContentSchema,
8
- attributes: [ 'scope' ],
8
+ attributes: [ 'scope', 'colspan' ],
9
9
  },
10
10
  td: {
11
11
  allowEmpty: true,
12
12
  children: phrasingContentSchema,
13
+ attributes: [ 'colspan' ],
13
14
  },
14
15
  },
15
16
  },
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { isEqual } from 'lodash';
4
+ import fastDeepEqual from 'fast-deep-equal/es6';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -204,7 +204,7 @@ export default function TableOfContentsEdit( {
204
204
  }
205
205
  }
206
206
 
207
- if ( isEqual( headings, _latestHeadings ) ) {
207
+ if ( fastDeepEqual( headings, _latestHeadings ) ) {
208
208
  return null;
209
209
  }
210
210
  return _latestHeadings;
@@ -279,7 +279,7 @@ export default function TableOfContentsEdit( {
279
279
  <div { ...blockProps }>
280
280
  <Placeholder
281
281
  icon={ <BlockIcon icon={ icon } /> }
282
- label="Table of Contents"
282
+ label={ __( 'Table of Contents' ) }
283
283
  instructions={ __(
284
284
  'Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.'
285
285
  ) }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { map, filter } from 'lodash';
4
+ import { map } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -69,7 +69,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
69
69
  disabled: true,
70
70
  };
71
71
  const taxonomyOptions = map(
72
- filter( taxonomies, 'show_cloud' ),
72
+ taxonomies?.filter( ( tax ) => !! tax.show_cloud ),
73
73
  ( item ) => {
74
74
  return {
75
75
  value: item.slug,
@@ -124,6 +124,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
124
124
  }
125
125
  />
126
126
  <RangeControl
127
+ __nextHasNoMarginBottom
127
128
  label={ __( 'Number of tags' ) }
128
129
  value={ numberOfTags }
129
130
  onChange={ ( value ) =>
@@ -7,12 +7,18 @@ import { sprintf, __ } from '@wordpress/i18n';
7
7
  import { InspectorControls } from '@wordpress/block-editor';
8
8
  import { useSelect } from '@wordpress/data';
9
9
 
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import { TemplatePartImportControls } from './import-controls';
14
+
10
15
  export function TemplatePartAdvancedControls( {
11
16
  tagName,
12
17
  setAttributes,
13
18
  isEntityAvailable,
14
19
  templatePartId,
15
20
  defaultWrapper,
21
+ hasInnerBlocks,
16
22
  } ) {
17
23
  const [ area, setArea ] = useEntityProp(
18
24
  'postType',
@@ -87,6 +93,12 @@ export function TemplatePartAdvancedControls( {
87
93
  value={ tagName || '' }
88
94
  onChange={ ( value ) => setAttributes( { tagName: value } ) }
89
95
  />
96
+ { ! hasInnerBlocks && (
97
+ <TemplatePartImportControls
98
+ area={ area }
99
+ setAttributes={ setAttributes }
100
+ />
101
+ ) }
90
102
  </InspectorControls>
91
103
  );
92
104
  }
@@ -0,0 +1,180 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __, sprintf } from '@wordpress/i18n';
5
+ import { useMemo, useState } from '@wordpress/element';
6
+ import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
7
+ import {
8
+ Button,
9
+ FlexBlock,
10
+ FlexItem,
11
+ SelectControl,
12
+ __experimentalHStack as HStack,
13
+ __experimentalSpacer as Spacer,
14
+ } from '@wordpress/components';
15
+ import {
16
+ switchToBlockType,
17
+ getPossibleBlockTransformations,
18
+ } from '@wordpress/blocks';
19
+ import { store as coreStore } from '@wordpress/core-data';
20
+ import { store as noticesStore } from '@wordpress/notices';
21
+
22
+ /**
23
+ * Internal dependencies
24
+ */
25
+ import { useCreateTemplatePartFromBlocks } from './utils/hooks';
26
+ import { transformWidgetToBlock } from './utils/transformers';
27
+
28
+ export function TemplatePartImportControls( { area, setAttributes } ) {
29
+ const [ selectedSidebar, setSelectedSidebar ] = useState( '' );
30
+ const [ isBusy, setIsBusy ] = useState( false );
31
+
32
+ const registry = useRegistry();
33
+ const sidebars = useSelect( ( select ) => {
34
+ return select( coreStore ).getSidebars( {
35
+ per_page: -1,
36
+ _fields: 'id,name,description,status,widgets',
37
+ } );
38
+ }, [] );
39
+ const { createErrorNotice } = useDispatch( noticesStore );
40
+
41
+ const createFromBlocks = useCreateTemplatePartFromBlocks(
42
+ area,
43
+ setAttributes
44
+ );
45
+
46
+ const options = useMemo( () => {
47
+ const sidebarOptions = ( sidebars ?? [] )
48
+ .filter(
49
+ ( widgetArea ) =>
50
+ widgetArea.id !== 'wp_inactive_widgets' &&
51
+ widgetArea.widgets.length > 0
52
+ )
53
+ .map( ( widgetArea ) => {
54
+ return {
55
+ value: widgetArea.id,
56
+ label: widgetArea.name,
57
+ };
58
+ } );
59
+
60
+ if ( ! sidebarOptions.length ) {
61
+ return [];
62
+ }
63
+
64
+ return [
65
+ { value: '', label: __( 'Select widget area' ) },
66
+ ...sidebarOptions,
67
+ ];
68
+ }, [ sidebars ] );
69
+
70
+ async function createFromWidgets( event ) {
71
+ event.preventDefault();
72
+
73
+ if ( isBusy || ! selectedSidebar ) {
74
+ return;
75
+ }
76
+
77
+ setIsBusy( true );
78
+
79
+ const sidebar = options.find(
80
+ ( { value } ) => value === selectedSidebar
81
+ );
82
+ const { getWidgets } = registry.resolveSelect( coreStore );
83
+
84
+ // The widgets API always returns a successful response.
85
+ const widgets = await getWidgets( {
86
+ sidebar: sidebar.value,
87
+ _embed: 'about',
88
+ } );
89
+
90
+ const skippedWidgets = new Set();
91
+ const blocks = widgets.flatMap( ( widget ) => {
92
+ const block = transformWidgetToBlock( widget );
93
+
94
+ if ( block.name !== 'core/legacy-widget' ) {
95
+ return block;
96
+ }
97
+
98
+ const transforms = getPossibleBlockTransformations( [
99
+ block,
100
+ ] ).filter( ( item ) => {
101
+ // The block without any transformations can't be a wildcard.
102
+ if ( ! item.transforms ) {
103
+ return true;
104
+ }
105
+
106
+ const hasWildCardFrom = item.transforms?.from?.find(
107
+ ( from ) => from.blocks && from.blocks.includes( '*' )
108
+ );
109
+ const hasWildCardTo = item.transforms?.to?.find(
110
+ ( to ) => to.blocks && to.blocks.includes( '*' )
111
+ );
112
+
113
+ return ! hasWildCardFrom && ! hasWildCardTo;
114
+ } );
115
+
116
+ // Skip the block if we have no matching transformations.
117
+ if ( ! transforms.length ) {
118
+ skippedWidgets.add( widget.id_base );
119
+ return [];
120
+ }
121
+
122
+ // Try transforming the Legacy Widget into a first matching block.
123
+ return switchToBlockType( block, transforms[ 0 ].name );
124
+ } );
125
+
126
+ await createFromBlocks(
127
+ blocks,
128
+ /* translators: %s: name of the widget area */
129
+ sprintf( __( 'Widget area: %s' ), sidebar.label )
130
+ );
131
+
132
+ if ( skippedWidgets.size ) {
133
+ createErrorNotice(
134
+ sprintf(
135
+ /* translators: %s: the list of widgets */
136
+ __( 'Unable to import the following widgets: %s.' ),
137
+ Array.from( skippedWidgets ).join( ', ' )
138
+ ),
139
+ {
140
+ type: 'snackbar',
141
+ }
142
+ );
143
+ }
144
+
145
+ setIsBusy( false );
146
+ }
147
+
148
+ return (
149
+ <Spacer marginBottom="4">
150
+ <HStack as="form" onSubmit={ createFromWidgets }>
151
+ <FlexBlock>
152
+ <SelectControl
153
+ label={ __( 'Import widget area' ) }
154
+ value={ selectedSidebar }
155
+ options={ options }
156
+ onChange={ ( value ) => setSelectedSidebar( value ) }
157
+ disabled={ ! options.length }
158
+ __next36pxDefaultSize
159
+ __nextHasNoMarginBottom
160
+ />
161
+ </FlexBlock>
162
+ <FlexItem
163
+ style={ {
164
+ marginBottom: '8px',
165
+ marginTop: 'auto',
166
+ } }
167
+ >
168
+ <Button
169
+ variant="primary"
170
+ type="submit"
171
+ isBusy={ isBusy }
172
+ aria-disabled={ isBusy || ! selectedSidebar }
173
+ >
174
+ { __( 'Import' ) }
175
+ </Button>
176
+ </FlexItem>
177
+ </HStack>
178
+ </Spacer>
179
+ );
180
+ }
@@ -141,6 +141,7 @@ export default function TemplatePartEdit( {
141
141
  isEntityAvailable={ isEntityAvailable }
142
142
  templatePartId={ templatePartId }
143
143
  defaultWrapper={ areaObject.tagName }
144
+ hasInnerBlocks={ innerBlocks.length > 0 }
144
145
  />
145
146
  { isPlaceholder && (
146
147
  <TagName { ...blockProps }>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useCallback, useMemo, useState } from '@wordpress/element';
4
+ import { useMemo, useState } from '@wordpress/element';
5
5
  import { __, sprintf } from '@wordpress/i18n';
6
6
  import { store as noticesStore } from '@wordpress/notices';
7
7
  import { useDispatch } from '@wordpress/data';
@@ -57,7 +57,7 @@ export default function TemplatePartSelectionModal( {
57
57
 
58
58
  const { createSuccessNotice } = useDispatch( noticesStore );
59
59
 
60
- const onTemplatePartSelect = useCallback( ( templatePart ) => {
60
+ const onTemplatePartSelect = ( templatePart ) => {
61
61
  setAttributes( {
62
62
  slug: templatePart.slug,
63
63
  theme: templatePart.theme,
@@ -74,7 +74,7 @@ export default function TemplatePartSelectionModal( {
74
74
  }
75
75
  );
76
76
  onClose();
77
- }, [] );
77
+ };
78
78
 
79
79
  const createFromBlocks = useCreateTemplatePartFromBlocks(
80
80
  area,
@@ -88,6 +88,7 @@ export default function TemplatePartSelectionModal( {
88
88
  <div className="block-library-template-part__selection-content">
89
89
  <div className="block-library-template-part__selection-search">
90
90
  <SearchControl
91
+ __nextHasNoMarginBottom
91
92
  onChange={ setSearchValue }
92
93
  value={ searchValue }
93
94
  label={ __( 'Search for replacements' ) }