@wordpress/block-library 9.3.0 → 9.4.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 (392) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/block/edit.js +38 -23
  3. package/build/block/edit.js.map +1 -1
  4. package/build/button/edit.js +1 -1
  5. package/build/button/edit.js.map +1 -1
  6. package/build/buttons/index.js +26 -0
  7. package/build/buttons/index.js.map +1 -1
  8. package/build/categories/edit.js +20 -3
  9. package/build/categories/edit.js.map +1 -1
  10. package/build/categories/index.js +8 -0
  11. package/build/categories/index.js.map +1 -1
  12. package/build/columns/index.js +2 -2
  13. package/build/columns/index.js.map +1 -1
  14. package/build/cover/edit/inspector-controls.js +2 -1
  15. package/build/cover/edit/inspector-controls.js.map +1 -1
  16. package/build/embed/variations.js +39 -34
  17. package/build/embed/variations.js.map +1 -1
  18. package/build/footnotes/index.js +1 -1
  19. package/build/footnotes/index.js.map +1 -1
  20. package/build/form-input/edit.js +2 -0
  21. package/build/form-input/edit.js.map +1 -1
  22. package/build/gallery/index.js +10 -0
  23. package/build/gallery/index.js.map +1 -1
  24. package/build/group/deprecated.js +2 -5
  25. package/build/group/deprecated.js.map +1 -1
  26. package/build/heading/index.js +14 -1
  27. package/build/heading/index.js.map +1 -1
  28. package/build/image/edit.js +1 -1
  29. package/build/image/edit.js.map +1 -1
  30. package/build/image/image.js +24 -11
  31. package/build/image/image.js.map +1 -1
  32. package/build/image/index.js +3 -0
  33. package/build/image/index.js.map +1 -1
  34. package/build/image/view.js +65 -49
  35. package/build/image/view.js.map +1 -1
  36. package/build/latest-comments/index.js +9 -0
  37. package/build/latest-comments/index.js.map +1 -1
  38. package/build/list/edit.js +3 -3
  39. package/build/list/edit.js.map +1 -1
  40. package/build/list-item/edit.js +2 -2
  41. package/build/list-item/edit.js.map +1 -1
  42. package/build/list-item/hooks/index.js +0 -7
  43. package/build/list-item/hooks/index.js.map +1 -1
  44. package/build/media-text/index.js +12 -0
  45. package/build/media-text/index.js.map +1 -1
  46. package/build/navigation/edit/navigation-menu-delete-control.js +1 -0
  47. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  48. package/build/navigation/use-navigation-menu.js +5 -1
  49. package/build/navigation/use-navigation-menu.js.map +1 -1
  50. package/build/navigation-link/link-ui.js +13 -17
  51. package/build/navigation-link/link-ui.js.map +1 -1
  52. package/build/navigation-submenu/edit.js +0 -11
  53. package/build/navigation-submenu/edit.js.map +1 -1
  54. package/build/page-list/edit.js +1 -0
  55. package/build/page-list/edit.js.map +1 -1
  56. package/build/page-list-item/edit.js +4 -1
  57. package/build/page-list-item/edit.js.map +1 -1
  58. package/build/paragraph/index.js +6 -0
  59. package/build/paragraph/index.js.map +1 -1
  60. package/build/paragraph/transforms.js +6 -0
  61. package/build/paragraph/transforms.js.map +1 -1
  62. package/build/post-author/index.js +8 -0
  63. package/build/post-author/index.js.map +1 -1
  64. package/build/post-author-biography/index.js +3 -0
  65. package/build/post-author-biography/index.js.map +1 -1
  66. package/build/post-author-name/index.js +3 -0
  67. package/build/post-author-name/index.js.map +1 -1
  68. package/build/post-date/index.js +3 -0
  69. package/build/post-date/index.js.map +1 -1
  70. package/build/post-excerpt/edit.js +1 -0
  71. package/build/post-excerpt/edit.js.map +1 -1
  72. package/build/post-featured-image/index.js +3 -0
  73. package/build/post-featured-image/index.js.map +1 -1
  74. package/build/post-terms/index.js +3 -0
  75. package/build/post-terms/index.js.map +1 -1
  76. package/build/post-title/edit.js +5 -1
  77. package/build/post-title/edit.js.map +1 -1
  78. package/build/query/edit/inspector-controls/author-control.js +3 -1
  79. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  80. package/build/query/edit/inspector-controls/index.js +24 -6
  81. package/build/query/edit/inspector-controls/index.js.map +1 -1
  82. package/build/query/edit/inspector-controls/order-control.js +1 -0
  83. package/build/query/edit/inspector-controls/order-control.js.map +1 -1
  84. package/build/query/edit/inspector-controls/parent-control.js +2 -1
  85. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  86. package/build/query/edit/inspector-controls/sticky-control.js +1 -0
  87. package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
  88. package/build/query/edit/inspector-controls/taxonomy-controls.js +5 -2
  89. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  90. package/build/query/edit/query-content.js +11 -2
  91. package/build/query/edit/query-content.js.map +1 -1
  92. package/build/query/edit/query-placeholder.js +1 -14
  93. package/build/query/edit/query-placeholder.js.map +1 -1
  94. package/build/query/utils.js +5 -1
  95. package/build/query/utils.js.map +1 -1
  96. package/build/query/variations.js +9 -55
  97. package/build/query/variations.js.map +1 -1
  98. package/build/query-pagination-numbers/edit.js +1 -0
  99. package/build/query-pagination-numbers/edit.js.map +1 -1
  100. package/build/query-title/edit.js +11 -19
  101. package/build/query-title/edit.js.map +1 -1
  102. package/build/query-title/use-archive-label.js +95 -0
  103. package/build/query-title/use-archive-label.js.map +1 -0
  104. package/build/quote/index.js +15 -1
  105. package/build/quote/index.js.map +1 -1
  106. package/build/search/index.js +3 -0
  107. package/build/search/index.js.map +1 -1
  108. package/build/site-logo/edit.js +4 -1
  109. package/build/site-logo/edit.js.map +1 -1
  110. package/build/site-tagline/edit.js +5 -2
  111. package/build/site-tagline/edit.js.map +1 -1
  112. package/build/site-tagline/index.js +6 -1
  113. package/build/site-tagline/index.js.map +1 -1
  114. package/build/site-title/edit.js +4 -1
  115. package/build/site-title/edit.js.map +1 -1
  116. package/build/site-title/index.js +6 -1
  117. package/build/site-title/index.js.map +1 -1
  118. package/build/social-link/icons/soundcloud.js +1 -1
  119. package/build/social-link/icons/soundcloud.js.map +1 -1
  120. package/build/social-links/index.js +12 -0
  121. package/build/social-links/index.js.map +1 -1
  122. package/build/tag-cloud/edit.js +4 -1
  123. package/build/tag-cloud/edit.js.map +1 -1
  124. package/build/template-part/edit/index.js +5 -3
  125. package/build/template-part/edit/index.js.map +1 -1
  126. package/build/template-part/edit/inner-blocks.js +8 -3
  127. package/build/template-part/edit/inner-blocks.js.map +1 -1
  128. package/build/template-part/edit/placeholder.js +23 -3
  129. package/build/template-part/edit/placeholder.js.map +1 -1
  130. package/build/template-part/edit/title-modal.js +20 -8
  131. package/build/template-part/edit/title-modal.js.map +1 -1
  132. package/build/term-description/index.js +12 -0
  133. package/build/term-description/index.js.map +1 -1
  134. package/build/utils/hooks.js +5 -1
  135. package/build/utils/hooks.js.map +1 -1
  136. package/build-module/block/edit.js +38 -23
  137. package/build-module/block/edit.js.map +1 -1
  138. package/build-module/button/edit.js +1 -1
  139. package/build-module/button/edit.js.map +1 -1
  140. package/build-module/buttons/index.js +26 -0
  141. package/build-module/buttons/index.js.map +1 -1
  142. package/build-module/categories/edit.js +21 -4
  143. package/build-module/categories/edit.js.map +1 -1
  144. package/build-module/categories/index.js +8 -0
  145. package/build-module/categories/index.js.map +1 -1
  146. package/build-module/columns/index.js +2 -2
  147. package/build-module/columns/index.js.map +1 -1
  148. package/build-module/cover/edit/inspector-controls.js +2 -1
  149. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  150. package/build-module/embed/variations.js +40 -35
  151. package/build-module/embed/variations.js.map +1 -1
  152. package/build-module/footnotes/index.js +1 -1
  153. package/build-module/footnotes/index.js.map +1 -1
  154. package/build-module/form-input/edit.js +2 -0
  155. package/build-module/form-input/edit.js.map +1 -1
  156. package/build-module/gallery/index.js +10 -0
  157. package/build-module/gallery/index.js.map +1 -1
  158. package/build-module/group/deprecated.js +2 -5
  159. package/build-module/group/deprecated.js.map +1 -1
  160. package/build-module/heading/index.js +14 -1
  161. package/build-module/heading/index.js.map +1 -1
  162. package/build-module/image/edit.js +1 -1
  163. package/build-module/image/edit.js.map +1 -1
  164. package/build-module/image/image.js +25 -12
  165. package/build-module/image/image.js.map +1 -1
  166. package/build-module/image/index.js +3 -0
  167. package/build-module/image/index.js.map +1 -1
  168. package/build-module/image/view.js +65 -49
  169. package/build-module/image/view.js.map +1 -1
  170. package/build-module/latest-comments/index.js +9 -0
  171. package/build-module/latest-comments/index.js.map +1 -1
  172. package/build-module/list/edit.js +3 -3
  173. package/build-module/list/edit.js.map +1 -1
  174. package/build-module/list-item/edit.js +2 -2
  175. package/build-module/list-item/edit.js.map +1 -1
  176. package/build-module/list-item/hooks/index.js +0 -1
  177. package/build-module/list-item/hooks/index.js.map +1 -1
  178. package/build-module/media-text/index.js +12 -0
  179. package/build-module/media-text/index.js.map +1 -1
  180. package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -0
  181. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  182. package/build-module/navigation/use-navigation-menu.js +5 -1
  183. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  184. package/build-module/navigation-link/link-ui.js +13 -17
  185. package/build-module/navigation-link/link-ui.js.map +1 -1
  186. package/build-module/navigation-submenu/edit.js +0 -11
  187. package/build-module/navigation-submenu/edit.js.map +1 -1
  188. package/build-module/page-list/edit.js +1 -0
  189. package/build-module/page-list/edit.js.map +1 -1
  190. package/build-module/page-list-item/edit.js +4 -1
  191. package/build-module/page-list-item/edit.js.map +1 -1
  192. package/build-module/paragraph/index.js +6 -0
  193. package/build-module/paragraph/index.js.map +1 -1
  194. package/build-module/paragraph/transforms.js +6 -0
  195. package/build-module/paragraph/transforms.js.map +1 -1
  196. package/build-module/post-author/index.js +8 -0
  197. package/build-module/post-author/index.js.map +1 -1
  198. package/build-module/post-author-biography/index.js +3 -0
  199. package/build-module/post-author-biography/index.js.map +1 -1
  200. package/build-module/post-author-name/index.js +3 -0
  201. package/build-module/post-author-name/index.js.map +1 -1
  202. package/build-module/post-date/index.js +3 -0
  203. package/build-module/post-date/index.js.map +1 -1
  204. package/build-module/post-excerpt/edit.js +1 -0
  205. package/build-module/post-excerpt/edit.js.map +1 -1
  206. package/build-module/post-featured-image/index.js +3 -0
  207. package/build-module/post-featured-image/index.js.map +1 -1
  208. package/build-module/post-terms/index.js +3 -0
  209. package/build-module/post-terms/index.js.map +1 -1
  210. package/build-module/post-title/edit.js +5 -1
  211. package/build-module/post-title/edit.js.map +1 -1
  212. package/build-module/query/edit/inspector-controls/author-control.js +3 -1
  213. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  214. package/build-module/query/edit/inspector-controls/index.js +25 -7
  215. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  216. package/build-module/query/edit/inspector-controls/order-control.js +1 -0
  217. package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
  218. package/build-module/query/edit/inspector-controls/parent-control.js +2 -1
  219. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  220. package/build-module/query/edit/inspector-controls/sticky-control.js +1 -0
  221. package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
  222. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +6 -4
  223. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  224. package/build-module/query/edit/query-content.js +11 -2
  225. package/build-module/query/edit/query-content.js.map +1 -1
  226. package/build-module/query/edit/query-placeholder.js +1 -14
  227. package/build-module/query/edit/query-placeholder.js.map +1 -1
  228. package/build-module/query/utils.js +5 -1
  229. package/build-module/query/utils.js.map +1 -1
  230. package/build-module/query/variations.js +4 -50
  231. package/build-module/query/variations.js.map +1 -1
  232. package/build-module/query-pagination-numbers/edit.js +1 -0
  233. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  234. package/build-module/query-title/edit.js +12 -20
  235. package/build-module/query-title/edit.js.map +1 -1
  236. package/build-module/query-title/use-archive-label.js +88 -0
  237. package/build-module/query-title/use-archive-label.js.map +1 -0
  238. package/build-module/quote/index.js +15 -1
  239. package/build-module/quote/index.js.map +1 -1
  240. package/build-module/search/index.js +3 -0
  241. package/build-module/search/index.js.map +1 -1
  242. package/build-module/site-logo/edit.js +4 -1
  243. package/build-module/site-logo/edit.js.map +1 -1
  244. package/build-module/site-tagline/edit.js +5 -2
  245. package/build-module/site-tagline/edit.js.map +1 -1
  246. package/build-module/site-tagline/index.js +6 -1
  247. package/build-module/site-tagline/index.js.map +1 -1
  248. package/build-module/site-title/edit.js +4 -1
  249. package/build-module/site-title/edit.js.map +1 -1
  250. package/build-module/site-title/index.js +6 -1
  251. package/build-module/site-title/index.js.map +1 -1
  252. package/build-module/social-link/icons/soundcloud.js +1 -1
  253. package/build-module/social-link/icons/soundcloud.js.map +1 -1
  254. package/build-module/social-links/index.js +12 -0
  255. package/build-module/social-links/index.js.map +1 -1
  256. package/build-module/tag-cloud/edit.js +4 -1
  257. package/build-module/tag-cloud/edit.js.map +1 -1
  258. package/build-module/template-part/edit/index.js +5 -3
  259. package/build-module/template-part/edit/index.js.map +1 -1
  260. package/build-module/template-part/edit/inner-blocks.js +8 -3
  261. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  262. package/build-module/template-part/edit/placeholder.js +23 -3
  263. package/build-module/template-part/edit/placeholder.js.map +1 -1
  264. package/build-module/template-part/edit/title-modal.js +20 -8
  265. package/build-module/template-part/edit/title-modal.js.map +1 -1
  266. package/build-module/term-description/index.js +12 -0
  267. package/build-module/term-description/index.js.map +1 -1
  268. package/build-module/utils/hooks.js +5 -1
  269. package/build-module/utils/hooks.js.map +1 -1
  270. package/build-style/categories/editor-rtl.css +4 -0
  271. package/build-style/categories/editor.css +4 -0
  272. package/build-style/categories/style-rtl.css +4 -0
  273. package/build-style/categories/style.css +4 -0
  274. package/build-style/editor-rtl.css +13 -12
  275. package/build-style/editor.css +13 -12
  276. package/build-style/image/editor-rtl.css +8 -4
  277. package/build-style/image/editor.css +8 -4
  278. package/build-style/image/style-rtl.css +19 -0
  279. package/build-style/image/style.css +19 -0
  280. package/build-style/list/style-rtl.css +1 -1
  281. package/build-style/list/style.css +1 -1
  282. package/build-style/navigation/style-rtl.css +1 -4
  283. package/build-style/navigation/style.css +1 -4
  284. package/build-style/post-comments-form/style-rtl.css +1 -1
  285. package/build-style/post-comments-form/style.css +1 -1
  286. package/build-style/query/editor-rtl.css +0 -7
  287. package/build-style/query/editor.css +0 -7
  288. package/build-style/search/editor-rtl.css +1 -1
  289. package/build-style/search/editor.css +1 -1
  290. package/build-style/social-links/style-rtl.css +2 -2
  291. package/build-style/social-links/style.css +2 -2
  292. package/build-style/style-rtl.css +29 -8
  293. package/build-style/style.css +29 -8
  294. package/build-style/term-description/style-rtl.css +1 -0
  295. package/build-style/term-description/style.css +1 -0
  296. package/package.json +35 -35
  297. package/src/block/edit.js +58 -27
  298. package/src/block/test/edit.native.js +6 -2
  299. package/src/button/edit.js +1 -1
  300. package/src/button/index.php +2 -2
  301. package/src/buttons/block.json +20 -0
  302. package/src/buttons/index.js +6 -0
  303. package/src/categories/block.json +8 -0
  304. package/src/categories/edit.js +32 -4
  305. package/src/categories/editor.scss +4 -0
  306. package/src/categories/index.php +4 -1
  307. package/src/categories/style.scss +4 -0
  308. package/src/columns/index.js +1 -1
  309. package/src/cover/edit/inspector-controls.js +1 -0
  310. package/src/embed/test/__snapshots__/index.native.js.snap +8 -8
  311. package/src/embed/test/index.js +1 -1
  312. package/src/embed/test/index.native.js +24 -23
  313. package/src/embed/variations.js +43 -35
  314. package/src/footnotes/index.js +1 -2
  315. package/src/form-input/edit.js +2 -0
  316. package/src/gallery/block.json +10 -0
  317. package/src/group/deprecated.js +3 -7
  318. package/src/heading/block.json +12 -0
  319. package/src/heading/index.js +1 -0
  320. package/src/image/block.json +3 -0
  321. package/src/image/edit.js +1 -1
  322. package/src/image/editor.scss +6 -1
  323. package/src/image/image.js +55 -35
  324. package/src/image/index.php +32 -15
  325. package/src/image/style.scss +22 -0
  326. package/src/image/test/edit.native.js +1 -0
  327. package/src/image/view.js +69 -49
  328. package/src/latest-comments/block.json +9 -0
  329. package/src/list/edit.js +3 -3
  330. package/src/list/style.scss +1 -1
  331. package/src/list-item/edit.js +2 -2
  332. package/src/list-item/hooks/index.js +0 -1
  333. package/src/media-text/block.json +12 -0
  334. package/src/navigation/edit/navigation-menu-delete-control.js +1 -0
  335. package/src/navigation/index.php +1 -1
  336. package/src/navigation/style.scss +4 -9
  337. package/src/navigation/test/use-navigation-menu.js +54 -15
  338. package/src/navigation/use-navigation-menu.js +5 -1
  339. package/src/navigation-link/link-ui.js +8 -14
  340. package/src/navigation-submenu/edit.js +1 -13
  341. package/src/page-list/edit.js +1 -0
  342. package/src/page-list-item/edit.js +4 -4
  343. package/src/paragraph/block.json +6 -0
  344. package/src/post-author/index.js +8 -0
  345. package/src/post-author-biography/block.json +3 -0
  346. package/src/post-author-name/block.json +3 -0
  347. package/src/post-comments-form/style.scss +1 -1
  348. package/src/post-date/block.json +3 -0
  349. package/src/post-excerpt/edit.js +1 -0
  350. package/src/post-featured-image/block.json +3 -0
  351. package/src/post-terms/block.json +3 -0
  352. package/src/post-title/edit.js +5 -5
  353. package/src/query/edit/inspector-controls/author-control.js +2 -0
  354. package/src/query/edit/inspector-controls/index.js +41 -14
  355. package/src/query/edit/inspector-controls/order-control.js +1 -0
  356. package/src/query/edit/inspector-controls/parent-control.js +1 -0
  357. package/src/query/edit/inspector-controls/sticky-control.js +1 -0
  358. package/src/query/edit/inspector-controls/taxonomy-controls.js +8 -3
  359. package/src/query/edit/query-content.js +17 -3
  360. package/src/query/edit/query-placeholder.js +1 -21
  361. package/src/query/editor.scss +0 -9
  362. package/src/query/utils.js +4 -0
  363. package/src/query/variations.js +4 -46
  364. package/src/query-pagination-numbers/edit.js +1 -0
  365. package/src/query-title/edit.js +10 -17
  366. package/src/query-title/use-archive-label.js +99 -0
  367. package/src/quote/block.json +15 -1
  368. package/src/search/block.json +3 -0
  369. package/src/search/editor.scss +1 -1
  370. package/src/site-logo/edit.js +4 -1
  371. package/src/site-tagline/block.json +6 -1
  372. package/src/site-tagline/edit.js +5 -2
  373. package/src/site-title/edit.js +4 -1
  374. package/src/site-title/index.js +6 -1
  375. package/src/social-link/icons/soundcloud.js +1 -1
  376. package/src/social-link/socials-with-bg.scss +1 -1
  377. package/src/social-link/socials-without-bg.scss +1 -1
  378. package/src/social-links/block.json +12 -0
  379. package/src/tag-cloud/edit.js +7 -1
  380. package/src/template-part/edit/index.js +5 -3
  381. package/src/template-part/edit/inner-blocks.js +8 -5
  382. package/src/template-part/edit/placeholder.js +31 -6
  383. package/src/template-part/edit/title-modal.js +18 -4
  384. package/src/term-description/block.json +12 -0
  385. package/src/term-description/style.scss +2 -0
  386. package/src/utils/hooks.js +5 -1
  387. package/tsconfig.tsbuildinfo +1 -1
  388. package/build/list-item/hooks/use-split.js +0 -39
  389. package/build/list-item/hooks/use-split.js.map +0 -1
  390. package/build-module/list-item/hooks/use-split.js +0 -32
  391. package/build-module/list-item/hooks/use-split.js.map +0 -1
  392. package/src/list-item/hooks/use-split.js +0 -33
@@ -2,7 +2,6 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { postList } from '@wordpress/icons';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
@@ -14,53 +13,12 @@ import {
14
13
  imageDateTitle,
15
14
  } from './icons';
16
15
 
17
- const QUERY_DEFAULT_ATTRIBUTES = {
18
- query: {
19
- perPage: 3,
20
- pages: 0,
21
- offset: 0,
22
- postType: 'post',
23
- order: 'desc',
24
- orderBy: 'date',
25
- author: '',
26
- search: '',
27
- exclude: [],
28
- sticky: '',
29
- inherit: false,
30
- },
31
- };
32
-
33
16
  const variations = [
34
- {
35
- name: 'posts-list',
36
- title: __( 'Posts List' ),
37
- description: __(
38
- 'Display a list of your most recent posts, excluding sticky posts.'
39
- ),
40
- icon: postList,
41
- attributes: {
42
- namespace: 'core/posts-list',
43
- query: {
44
- perPage: 4,
45
- pages: 1,
46
- offset: 0,
47
- postType: 'post',
48
- order: 'desc',
49
- orderBy: 'date',
50
- author: '',
51
- search: '',
52
- sticky: 'exclude',
53
- inherit: false,
54
- },
55
- },
56
- scope: [ 'inserter' ],
57
- isActive: [ 'namespace', 'query.postType' ],
58
- },
59
17
  {
60
18
  name: 'title-date',
61
19
  title: __( 'Title & Date' ),
62
20
  icon: titleDate,
63
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
21
+ attributes: {},
64
22
  innerBlocks: [
65
23
  [
66
24
  'core/post-template',
@@ -76,7 +34,7 @@ const variations = [
76
34
  name: 'title-excerpt',
77
35
  title: __( 'Title & Excerpt' ),
78
36
  icon: titleExcerpt,
79
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
37
+ attributes: {},
80
38
  innerBlocks: [
81
39
  [
82
40
  'core/post-template',
@@ -92,7 +50,7 @@ const variations = [
92
50
  name: 'title-date-excerpt',
93
51
  title: __( 'Title, Date, & Excerpt' ),
94
52
  icon: titleDateExcerpt,
95
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
53
+ attributes: {},
96
54
  innerBlocks: [
97
55
  [
98
56
  'core/post-template',
@@ -112,7 +70,7 @@ const variations = [
112
70
  name: 'image-date-title',
113
71
  title: __( 'Image, Date, & Title' ),
114
72
  icon: imageDateTitle,
115
- attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
73
+ attributes: {},
116
74
  innerBlocks: [
117
75
  [
118
76
  'core/post-template',
@@ -51,6 +51,7 @@ export default function QueryPaginationNumbersEdit( {
51
51
  <InspectorControls>
52
52
  <PanelBody title={ __( 'Settings' ) }>
53
53
  <RangeControl
54
+ __nextHasNoMarginBottom
54
55
  label={ __( 'Number of links' ) }
55
56
  help={ __(
56
57
  'Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'
@@ -13,11 +13,14 @@ import {
13
13
  useBlockProps,
14
14
  Warning,
15
15
  HeadingLevelDropdown,
16
- store as blockEditorStore,
17
16
  } from '@wordpress/block-editor';
18
17
  import { ToggleControl, PanelBody } from '@wordpress/components';
19
18
  import { __, sprintf } from '@wordpress/i18n';
20
- import { useSelect } from '@wordpress/data';
19
+
20
+ /**
21
+ * Internal dependencies
22
+ */
23
+ import { useArchiveLabel } from './use-archive-label';
21
24
 
22
25
  const SUPPORTED_TYPES = [ 'archive', 'search' ];
23
26
 
@@ -25,17 +28,7 @@ export default function QueryTitleEdit( {
25
28
  attributes: { type, level, textAlign, showPrefix, showSearchTerm },
26
29
  setAttributes,
27
30
  } ) {
28
- const { archiveTypeTitle, archiveNameLabel } = useSelect( ( select ) => {
29
- const { getSettings } = select( blockEditorStore );
30
- const {
31
- __experimentalArchiveTitleNameLabel,
32
- __experimentalArchiveTitleTypeLabel,
33
- } = getSettings();
34
- return {
35
- archiveTypeTitle: __experimentalArchiveTitleTypeLabel,
36
- archiveNameLabel: __experimentalArchiveTitleNameLabel,
37
- };
38
- } );
31
+ const { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();
39
32
 
40
33
  const TagName = `h${ level }`;
41
34
  const blockProps = useBlockProps( {
@@ -55,20 +48,20 @@ export default function QueryTitleEdit( {
55
48
  let titleElement;
56
49
  if ( type === 'archive' ) {
57
50
  let title;
58
- if ( archiveTypeTitle ) {
51
+ if ( archiveTypeLabel ) {
59
52
  if ( showPrefix ) {
60
53
  if ( archiveNameLabel ) {
61
54
  title = sprintf(
62
55
  /* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */
63
56
  __( '%1$s: %2$s' ),
64
- archiveTypeTitle,
57
+ archiveTypeLabel,
65
58
  archiveNameLabel
66
59
  );
67
60
  } else {
68
61
  title = sprintf(
69
62
  /* translators: %s: Archive type title e.g: "Category", "Tag"... */
70
63
  __( '%s: Name' ),
71
- archiveTypeTitle
64
+ archiveTypeLabel
72
65
  );
73
66
  }
74
67
  } else if ( archiveNameLabel ) {
@@ -77,7 +70,7 @@ export default function QueryTitleEdit( {
77
70
  title = sprintf(
78
71
  /* translators: %s: Archive type title e.g: "Category", "Tag"... */
79
72
  __( '%s name' ),
80
- archiveTypeTitle
73
+ archiveTypeLabel
81
74
  );
82
75
  }
83
76
  } else {
@@ -0,0 +1,99 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store as coreStore } from '@wordpress/core-data';
5
+ import { useSelect } from '@wordpress/data';
6
+
7
+ export function useArchiveLabel() {
8
+ const templateSlug = useSelect( ( select ) => {
9
+ // @wordpress/block-library should not depend on @wordpress/editor.
10
+ // Blocks can be loaded into a *non-post* block editor, so to avoid
11
+ // declaring @wordpress/editor as a dependency, we must access its
12
+ // store by string.
13
+ // The solution here is to split WP specific blocks from generic blocks.
14
+ // eslint-disable-next-line @wordpress/data-no-store-string-literals
15
+ const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId } =
16
+ select( 'core/editor' );
17
+ const currentPostType = getCurrentPostType();
18
+ const templateId =
19
+ getCurrentTemplateId() ||
20
+ ( currentPostType === 'wp_template' ? getCurrentPostId() : null );
21
+
22
+ return templateId
23
+ ? select( coreStore ).getEditedEntityRecord(
24
+ 'postType',
25
+ 'wp_template',
26
+ templateId
27
+ )?.slug
28
+ : null;
29
+ }, [] );
30
+ const taxonomyMatches = templateSlug?.match(
31
+ /^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/
32
+ );
33
+ let taxonomy;
34
+ let term;
35
+ let isAuthor = false;
36
+ let authorSlug;
37
+ if ( taxonomyMatches ) {
38
+ // If is for a all taxonomies of a type
39
+ if ( taxonomyMatches[ 1 ] ) {
40
+ taxonomy = taxonomyMatches[ 2 ]
41
+ ? taxonomyMatches[ 2 ]
42
+ : taxonomyMatches[ 1 ];
43
+ }
44
+ // If is for a all taxonomies of a type
45
+ else if ( taxonomyMatches[ 3 ] ) {
46
+ taxonomy = taxonomyMatches[ 6 ]
47
+ ? taxonomyMatches[ 6 ]
48
+ : taxonomyMatches[ 4 ];
49
+ term = taxonomyMatches[ 7 ];
50
+ }
51
+ taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;
52
+
53
+ //getTaxonomy( 'category' );
54
+ //wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );
55
+ } else {
56
+ const authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );
57
+ if ( authorMatches ) {
58
+ isAuthor = true;
59
+ if ( authorMatches[ 2 ] ) {
60
+ authorSlug = authorMatches[ 2 ];
61
+ }
62
+ }
63
+ }
64
+ return useSelect(
65
+ ( select ) => {
66
+ const { getEntityRecords, getTaxonomy, getAuthors } =
67
+ select( coreStore );
68
+ let archiveTypeLabel;
69
+ let archiveNameLabel;
70
+ if ( taxonomy ) {
71
+ archiveTypeLabel =
72
+ getTaxonomy( taxonomy )?.labels?.singular_name;
73
+ }
74
+ if ( term ) {
75
+ const records = getEntityRecords( 'taxonomy', taxonomy, {
76
+ slug: term,
77
+ per_page: 1,
78
+ } );
79
+ if ( records && records[ 0 ] ) {
80
+ archiveNameLabel = records[ 0 ].name;
81
+ }
82
+ }
83
+ if ( isAuthor ) {
84
+ archiveTypeLabel = 'Author';
85
+ if ( authorSlug ) {
86
+ const authorRecords = getAuthors( { slug: authorSlug } );
87
+ if ( authorRecords && authorRecords[ 0 ] ) {
88
+ archiveNameLabel = authorRecords[ 0 ].name;
89
+ }
90
+ }
91
+ }
92
+ return {
93
+ archiveTypeLabel,
94
+ archiveNameLabel,
95
+ };
96
+ },
97
+ [ authorSlug, isAuthor, taxonomy, term ]
98
+ );
99
+ }
@@ -36,6 +36,18 @@
36
36
  "backgroundImage": true
37
37
  }
38
38
  },
39
+ "__experimentalBorder": {
40
+ "color": true,
41
+ "radius": true,
42
+ "style": true,
43
+ "width": true,
44
+ "__experimentalDefaultControls": {
45
+ "color": true,
46
+ "radius": true,
47
+ "style": true,
48
+ "width": true
49
+ }
50
+ },
39
51
  "dimensions": {
40
52
  "minHeight": true,
41
53
  "__experimentalDefaultControls": {
@@ -70,7 +82,9 @@
70
82
  "allowEditing": false
71
83
  },
72
84
  "spacing": {
73
- "blockGap": true
85
+ "blockGap": true,
86
+ "padding": true,
87
+ "margin": true
74
88
  },
75
89
  "interactivity": {
76
90
  "clientNavigation": true
@@ -85,6 +85,9 @@
85
85
  "width": true
86
86
  }
87
87
  },
88
+ "spacing": {
89
+ "margin": true
90
+ },
88
91
  "html": false
89
92
  },
90
93
  "editorStyle": "wp-block-search-editor",
@@ -7,7 +7,7 @@
7
7
  }
8
8
 
9
9
  .wp-block-search {
10
- .wp-block-search__button {
10
+ :where(.wp-block-search__button) {
11
11
  height: auto;
12
12
  border-radius: initial;
13
13
  display: flex;
@@ -403,7 +403,10 @@ export default function LogoEdit( {
403
403
  } = useSelect( ( select ) => {
404
404
  const { canUser, getEntityRecord, getEditedEntityRecord } =
405
405
  select( coreStore );
406
- const _canUserEdit = canUser( 'update', 'settings' );
406
+ const _canUserEdit = canUser( 'update', {
407
+ kind: 'root',
408
+ name: 'site',
409
+ } );
407
410
  const siteSettings = _canUserEdit
408
411
  ? getEditedEntityRecord( 'root', 'site' )
409
412
  : undefined;
@@ -16,7 +16,12 @@
16
16
  "default": 0
17
17
  }
18
18
  },
19
- "example": {},
19
+ "example": {
20
+ "viewportWidth": 350,
21
+ "attributes": {
22
+ "textAlign": "center"
23
+ }
24
+ },
20
25
  "supports": {
21
26
  "align": [ "wide", "full" ],
22
27
  "html": false,
@@ -29,12 +29,15 @@ export default function SiteTaglineEdit( {
29
29
  const { canUserEdit, tagline } = useSelect( ( select ) => {
30
30
  const { canUser, getEntityRecord, getEditedEntityRecord } =
31
31
  select( coreStore );
32
- const canEdit = canUser( 'update', 'settings' );
32
+ const canEdit = canUser( 'update', {
33
+ kind: 'root',
34
+ name: 'site',
35
+ } );
33
36
  const settings = canEdit ? getEditedEntityRecord( 'root', 'site' ) : {};
34
37
  const readOnlySettings = getEntityRecord( 'root', '__unstableBase' );
35
38
 
36
39
  return {
37
- canUserEdit: canUser( 'update', 'settings' ),
40
+ canUserEdit: canEdit,
38
41
  tagline: canEdit
39
42
  ? settings?.description
40
43
  : readOnlySettings?.description,
@@ -32,7 +32,10 @@ export default function SiteTitleEdit( {
32
32
  const { canUserEdit, title } = useSelect( ( select ) => {
33
33
  const { canUser, getEntityRecord, getEditedEntityRecord } =
34
34
  select( coreStore );
35
- const canEdit = canUser( 'update', 'settings' );
35
+ const canEdit = canUser( 'update', {
36
+ kind: 'root',
37
+ name: 'site',
38
+ } );
36
39
  const settings = canEdit ? getEditedEntityRecord( 'root', 'site' ) : {};
37
40
  const readOnlySettings = getEntityRecord( 'root', '__unstableBase' );
38
41
 
@@ -17,7 +17,12 @@ export { metadata, name };
17
17
 
18
18
  export const settings = {
19
19
  icon,
20
- example: {},
20
+ example: {
21
+ viewportWidth: 350,
22
+ attributes: {
23
+ textAlign: 'center',
24
+ },
25
+ },
21
26
  edit,
22
27
  transforms,
23
28
  deprecated,
@@ -5,6 +5,6 @@ import { Path, SVG } from '@wordpress/primitives';
5
5
 
6
6
  export const SoundCloudIcon = () => (
7
7
  <SVG width="24" height="24" viewBox="0 0 24 24" version="1.1">
8
- <Path d="M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z" />
8
+ <Path d="M23.994 14.552a3.36 3.36 0 01-3.401 3.171h-8.176a.685.685 0 01-.679-.681V8.238a.749.749 0 01.452-.716S12.942 7 14.526 7a5.357 5.357 0 012.748.755 5.44 5.44 0 012.56 3.546c.282-.08.574-.12.868-.119a3.273 3.273 0 013.292 3.37zM10.718 8.795a.266.266 0 10-.528 0c-.224 2.96-.397 5.735 0 8.685a.265.265 0 00.528 0c.425-2.976.246-5.7 0-8.685zM9.066 9.82a.278.278 0 00-.553 0 33.183 33.183 0 000 7.663.278.278 0 00.55 0c.33-2.544.332-5.12.003-7.664zM7.406 9.56a.269.269 0 00-.535 0c-.253 2.7-.38 5.222 0 7.917a.266.266 0 10.531 0c.394-2.73.272-5.181.004-7.917zM5.754 10.331a.275.275 0 10-.55 0 28.035 28.035 0 000 7.155.272.272 0 00.54 0c.332-2.373.335-4.78.01-7.155zM4.087 12.12a.272.272 0 00-.544 0c-.393 1.843-.208 3.52.016 5.386a.26.26 0 00.512 0c.247-1.892.435-3.53.016-5.386zM2.433 11.838a.282.282 0 00-.56 0c-.349 1.882-.234 3.54.01 5.418.025.285.508.282.54 0 .269-1.907.394-3.517.01-5.418zM.762 12.76a.282.282 0 00-.56 0c-.32 1.264-.22 2.31.023 3.578a.262.262 0 00.521 0c.282-1.293.42-2.317.016-3.578z" />
9
9
  </SVG>
10
10
  );
@@ -49,7 +49,7 @@
49
49
  }
50
50
 
51
51
  .wp-social-link-facebook {
52
- background-color: #1778f2;
52
+ background-color: #0866ff;
53
53
  color: #fff;
54
54
  }
55
55
 
@@ -35,7 +35,7 @@
35
35
  }
36
36
 
37
37
  .wp-social-link-facebook {
38
- color: #1778f2;
38
+ color: #0866ff;
39
39
  }
40
40
 
41
41
  .wp-social-link-fivehundredpx {
@@ -81,6 +81,18 @@
81
81
  },
82
82
  "interactivity": {
83
83
  "clientNavigation": true
84
+ },
85
+ "__experimentalBorder": {
86
+ "radius": true,
87
+ "color": true,
88
+ "width": true,
89
+ "style": true,
90
+ "__experimentalDefaultControls": {
91
+ "radius": true,
92
+ "color": true,
93
+ "width": true,
94
+ "style": true
95
+ }
84
96
  }
85
97
  },
86
98
  "styles": [
@@ -50,9 +50,15 @@ function TagCloudEdit( { attributes, setAttributes } ) {
50
50
  } = attributes;
51
51
 
52
52
  const [ availableUnits ] = useSettings( 'spacing.units' );
53
+
54
+ // The `pt` unit is used as the default value and is therefore
55
+ // always considered an available unit.
53
56
  const units = useCustomUnits( {
54
- availableUnits: availableUnits || [ '%', 'px', 'em', 'rem' ],
57
+ availableUnits: availableUnits
58
+ ? [ ...availableUnits, 'pt' ]
59
+ : [ '%', 'px', 'em', 'rem', 'pt' ],
55
60
  } );
61
+
56
62
  const taxonomies = useSelect(
57
63
  ( select ) => select( coreStore ).getTaxonomies( { per_page: -1 } ),
58
64
  []
@@ -151,8 +151,10 @@ export default function TemplatePartEdit( {
151
151
  )
152
152
  : false;
153
153
 
154
- const _canEditTemplate =
155
- select( coreStore ).canUser( 'create', 'templates' ) ?? false;
154
+ const _canEditTemplate = select( coreStore ).canUser( 'create', {
155
+ kind: 'postType',
156
+ name: 'wp_template_part',
157
+ } );
156
158
 
157
159
  return {
158
160
  hasInnerBlocks: getBlockCount( clientId ) > 0,
@@ -165,7 +167,7 @@ export default function TemplatePartEdit( {
165
167
  onNavigateToEntityRecord:
166
168
  getSettings().onNavigateToEntityRecord,
167
169
  title: entityRecord?.title,
168
- canEditTemplate: _canEditTemplate,
170
+ canEditTemplate: !! _canEditTemplate,
169
171
  };
170
172
  },
171
173
  [ templatePartId, attributes.area, clientId ]
@@ -127,11 +127,14 @@ export default function TemplatePartInnerBlocks( {
127
127
  const { canViewTemplatePart, canEditTemplatePart } = useSelect(
128
128
  ( select ) => {
129
129
  return {
130
- canViewTemplatePart:
131
- select( coreStore ).canUser( 'read', 'templates' ) ?? false,
132
- canEditTemplatePart:
133
- select( coreStore ).canUser( 'create', 'templates' ) ??
134
- false,
130
+ canViewTemplatePart: !! select( coreStore ).canUser( 'read', {
131
+ kind: 'postType',
132
+ name: 'wp_template',
133
+ } ),
134
+ canEditTemplatePart: !! select( coreStore ).canUser( 'create', {
135
+ kind: 'postType',
136
+ name: 'wp_template',
137
+ } ),
135
138
  };
136
139
  },
137
140
  []
@@ -4,6 +4,8 @@
4
4
  import { __, sprintf } from '@wordpress/i18n';
5
5
  import { Placeholder, Button, Spinner } from '@wordpress/components';
6
6
  import { useState } from '@wordpress/element';
7
+ import { useSelect } from '@wordpress/data';
8
+ import { store as coreStore } from '@wordpress/core-data';
7
9
 
8
10
  /**
9
11
  * Internal dependencies
@@ -28,6 +30,21 @@ export default function TemplatePartPlaceholder( {
28
30
  templatePartId
29
31
  );
30
32
  const blockPatterns = useAlternativeBlockPatterns( area, clientId );
33
+
34
+ const { isBlockBasedTheme, canCreateTemplatePart } = useSelect(
35
+ ( select ) => {
36
+ const { getCurrentTheme, canUser } = select( coreStore );
37
+ return {
38
+ isBlockBasedTheme: getCurrentTheme()?.is_block_theme,
39
+ canCreateTemplatePart: canUser( 'create', {
40
+ kind: 'postType',
41
+ name: 'wp_template_part',
42
+ } ),
43
+ };
44
+ },
45
+ []
46
+ );
47
+
31
48
  const [ showTitleModal, setShowTitleModal ] = useState( false );
32
49
  const areaObject = useTemplatePartArea( area );
33
50
  const createFromBlocks = useCreateTemplatePartFromBlocks(
@@ -39,11 +56,19 @@ export default function TemplatePartPlaceholder( {
39
56
  <Placeholder
40
57
  icon={ areaObject.icon }
41
58
  label={ areaObject.label }
42
- instructions={ sprintf(
43
- // Translators: %s as template part area title ("Header", "Footer", etc.).
44
- __( 'Choose an existing %s or create a new one.' ),
45
- areaObject.label.toLowerCase()
46
- ) }
59
+ instructions={
60
+ isBlockBasedTheme
61
+ ? sprintf(
62
+ // Translators: %s as template part area title ("Header", "Footer", etc.).
63
+ __( 'Choose an existing %s or create a new one.' ),
64
+ areaObject.label.toLowerCase()
65
+ )
66
+ : sprintf(
67
+ // Translators: %s as template part area title ("Header", "Footer", etc.).
68
+ __( 'Choose an existing %s.' ),
69
+ areaObject.label.toLowerCase()
70
+ )
71
+ }
47
72
  >
48
73
  { isResolving && <Spinner /> }
49
74
 
@@ -54,7 +79,7 @@ export default function TemplatePartPlaceholder( {
54
79
  </Button>
55
80
  ) }
56
81
 
57
- { ! isResolving && (
82
+ { ! isResolving && isBlockBasedTheme && canCreateTemplatePart && (
58
83
  <Button
59
84
  variant="secondary"
60
85
  onClick={ () => {
@@ -14,7 +14,7 @@ import {
14
14
  export default function TitleModal( { areaLabel, onClose, onSubmit } ) {
15
15
  // Restructure onCreate to set the blocks on local state.
16
16
  // Add modal to confirm title and trigger onCreate.
17
- const [ title, setTitle ] = useState( __( 'Untitled Template Part' ) );
17
+ const [ title, setTitle ] = useState( '' );
18
18
 
19
19
  const submitForCreation = ( event ) => {
20
20
  event.preventDefault();
@@ -25,26 +25,40 @@ export default function TitleModal( { areaLabel, onClose, onSubmit } ) {
25
25
  <Modal
26
26
  title={ sprintf(
27
27
  // Translators: %s as template part area title ("Header", "Footer", etc.).
28
- __( 'Name and create your new %s' ),
28
+ __( 'Create new %s' ),
29
29
  areaLabel.toLowerCase()
30
30
  ) }
31
- overlayClassName="wp-block-template-part__placeholder-create-new__title-form"
32
31
  onRequestClose={ onClose }
32
+ focusOnMount="firstContentElement"
33
+ size="small"
33
34
  >
34
35
  <form onSubmit={ submitForCreation }>
35
36
  <VStack spacing="5">
36
37
  <TextControl
37
- __nextHasNoMarginBottom
38
38
  label={ __( 'Name' ) }
39
39
  value={ title }
40
40
  onChange={ setTitle }
41
+ placeholder={ __( 'Custom Template Part' ) }
42
+ __nextHasNoMarginBottom
43
+ __next40pxDefaultSize
41
44
  />
42
45
  <HStack justify="right">
46
+ <Button
47
+ __next40pxDefaultSize
48
+ variant="tertiary"
49
+ onClick={ () => {
50
+ onClose();
51
+ setTitle( '' );
52
+ } }
53
+ >
54
+ { __( 'Cancel' ) }
55
+ </Button>
43
56
  <Button
44
57
  variant="primary"
45
58
  type="submit"
46
59
  accessibleWhenDisabled
47
60
  disabled={ ! title.length }
61
+ __next40pxDefaultSize
48
62
  >
49
63
  { __( 'Create' ) }
50
64
  </Button>
@@ -40,6 +40,18 @@
40
40
  },
41
41
  "interactivity": {
42
42
  "clientNavigation": true
43
+ },
44
+ "__experimentalBorder": {
45
+ "radius": true,
46
+ "color": true,
47
+ "width": true,
48
+ "style": true,
49
+ "__experimentalDefaultControls": {
50
+ "radius": true,
51
+ "color": true,
52
+ "width": true,
53
+ "style": true
54
+ }
43
55
  }
44
56
  }
45
57
  }
@@ -1,5 +1,7 @@
1
1
  // Lowest specificity on wrapper margins to avoid overriding layout styles.
2
2
  :where(.wp-block-term-description) {
3
+ // This block has customizable padding, border-box makes that more predictable.
4
+ box-sizing: border-box;
3
5
  margin-top: var(--wp--style--block-gap);
4
6
  margin-bottom: var(--wp--style--block-gap);
5
7
  }