@wordpress/block-library 6.0.1 → 6.0.5

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 (1093) hide show
  1. package/build/block/edit.js +1 -1
  2. package/build/block/edit.js.map +1 -1
  3. package/build/button/deprecated.js +155 -10
  4. package/build/button/deprecated.js.map +1 -1
  5. package/build/button/edit.native.js +257 -330
  6. package/build/button/edit.native.js.map +1 -1
  7. package/build/button/index.js +4 -1
  8. package/build/button/index.js.map +1 -1
  9. package/build/buttons/deprecated.js +84 -2
  10. package/build/buttons/deprecated.js.map +1 -1
  11. package/build/buttons/edit.js +6 -42
  12. package/build/buttons/edit.js.map +1 -1
  13. package/build/buttons/index.js +16 -14
  14. package/build/buttons/index.js.map +1 -1
  15. package/build/buttons/save.js +4 -20
  16. package/build/buttons/save.js.map +1 -1
  17. package/build/buttons/transforms.js +15 -10
  18. package/build/buttons/transforms.js.map +1 -1
  19. package/build/categories/edit.js +16 -6
  20. package/build/categories/edit.js.map +1 -1
  21. package/build/categories/index.js +4 -0
  22. package/build/categories/index.js.map +1 -1
  23. package/build/code/edit.native.js +8 -5
  24. package/build/code/edit.native.js.map +1 -1
  25. package/build/code/index.js +24 -1
  26. package/build/code/index.js.map +1 -1
  27. package/build/column/edit.js +4 -2
  28. package/build/column/edit.js.map +1 -1
  29. package/build/column/index.js +4 -0
  30. package/build/column/index.js.map +1 -1
  31. package/build/column/save.js +7 -3
  32. package/build/column/save.js.map +1 -1
  33. package/build/columns/edit.js +1 -1
  34. package/build/columns/edit.js.map +1 -1
  35. package/build/columns/index.js +1 -0
  36. package/build/columns/index.js.map +1 -1
  37. package/build/columns/save.js +7 -2
  38. package/build/columns/save.js.map +1 -1
  39. package/build/comment-author-avatar/edit.js +83 -0
  40. package/build/comment-author-avatar/edit.js.map +1 -0
  41. package/build/{post-comment-date → comment-author-avatar}/index.js +25 -9
  42. package/build/comment-author-avatar/index.js.map +1 -0
  43. package/build/comment-author-name/deprecated.js +69 -0
  44. package/build/comment-author-name/deprecated.js.map +1 -0
  45. package/build/comment-author-name/edit.js +112 -0
  46. package/build/comment-author-name/edit.js.map +1 -0
  47. package/build/comment-author-name/index.js +77 -0
  48. package/build/comment-author-name/index.js.map +1 -0
  49. package/build/comment-content/edit.js +74 -0
  50. package/build/comment-content/edit.js.map +1 -0
  51. package/build/comment-content/index.js +68 -0
  52. package/build/comment-content/index.js.map +1 -0
  53. package/build/comment-date/deprecated.js +68 -0
  54. package/build/comment-date/deprecated.js.map +1 -0
  55. package/build/comment-date/edit.js +95 -0
  56. package/build/comment-date/edit.js.map +1 -0
  57. package/build/comment-date/index.js +72 -0
  58. package/build/comment-date/index.js.map +1 -0
  59. package/build/comment-edit-link/edit.js +61 -0
  60. package/build/comment-edit-link/edit.js.map +1 -0
  61. package/build/comment-edit-link/index.js +67 -0
  62. package/build/comment-edit-link/index.js.map +1 -0
  63. package/build/comment-reply-link/edit.js +63 -0
  64. package/build/comment-reply-link/edit.js.map +1 -0
  65. package/build/comment-reply-link/index.js +63 -0
  66. package/build/comment-reply-link/index.js.map +1 -0
  67. package/build/comment-template/edit.js +82 -0
  68. package/build/comment-template/edit.js.map +1 -0
  69. package/build/{post-comment-content → comment-template}/index.js +13 -8
  70. package/build/comment-template/index.js.map +1 -0
  71. package/build/comment-template/save.js +18 -0
  72. package/build/comment-template/save.js.map +1 -0
  73. package/build/comments-query-loop/edit.js +64 -0
  74. package/build/comments-query-loop/edit.js.map +1 -0
  75. package/build/comments-query-loop/index.js +67 -0
  76. package/build/comments-query-loop/index.js.map +1 -0
  77. package/build/comments-query-loop/save.js +22 -0
  78. package/build/comments-query-loop/save.js.map +1 -0
  79. package/build/comments-query-loop/toolbar.js +54 -0
  80. package/build/comments-query-loop/toolbar.js.map +1 -0
  81. package/build/cover/deprecated.js +180 -20
  82. package/build/cover/deprecated.js.map +1 -1
  83. package/build/cover/edit.js +62 -28
  84. package/build/cover/edit.js.map +1 -1
  85. package/build/cover/edit.native.js +6 -2
  86. package/build/cover/edit.native.js.map +1 -1
  87. package/build/cover/index.js +12 -1
  88. package/build/cover/index.js.map +1 -1
  89. package/build/cover/save.js +17 -14
  90. package/build/cover/save.js.map +1 -1
  91. package/build/cover/shared.js +3 -2
  92. package/build/cover/shared.js.map +1 -1
  93. package/build/embed/edit.native.js +4 -8
  94. package/build/embed/edit.native.js.map +1 -1
  95. package/build/embed/embed-bottom-sheet.native.js +4 -5
  96. package/build/embed/embed-bottom-sheet.native.js.map +1 -1
  97. package/build/embed/embed-no-preview.native.js +2 -1
  98. package/build/embed/embed-no-preview.native.js.map +1 -1
  99. package/build/embed/icons.js +16 -1
  100. package/build/embed/icons.js.map +1 -1
  101. package/build/embed/transforms.native.js +3 -1
  102. package/build/embed/transforms.native.js.map +1 -1
  103. package/build/embed/variations.js +20 -0
  104. package/build/embed/variations.js.map +1 -1
  105. package/build/freeform/edit.js +16 -4
  106. package/build/freeform/edit.js.map +1 -1
  107. package/build/gallery/edit.js +7 -0
  108. package/build/gallery/edit.js.map +1 -1
  109. package/build/gallery/gallery.js +1 -1
  110. package/build/gallery/gallery.js.map +1 -1
  111. package/build/gallery/gallery.native.js +1 -1
  112. package/build/gallery/gallery.native.js.map +1 -1
  113. package/build/gallery/index.js +6 -1
  114. package/build/gallery/index.js.map +1 -1
  115. package/build/gallery/save.js +7 -2
  116. package/build/gallery/save.js.map +1 -1
  117. package/build/gallery/shared.js +0 -7
  118. package/build/gallery/shared.js.map +1 -1
  119. package/build/gallery/use-get-media.js +4 -10
  120. package/build/gallery/use-get-media.js.map +1 -1
  121. package/build/gallery/use-mobile-warning.js +43 -0
  122. package/build/gallery/use-mobile-warning.js.map +1 -0
  123. package/build/group/edit.js +1 -1
  124. package/build/group/edit.js.map +1 -1
  125. package/build/group/index.js +1 -0
  126. package/build/group/index.js.map +1 -1
  127. package/build/group/save.js +4 -5
  128. package/build/group/save.js.map +1 -1
  129. package/build/group/variations.js +2 -1
  130. package/build/group/variations.js.map +1 -1
  131. package/build/heading/autogenerate-anchors.js +90 -0
  132. package/build/heading/autogenerate-anchors.js.map +1 -0
  133. package/build/heading/edit.js +42 -5
  134. package/build/heading/edit.js.map +1 -1
  135. package/build/heading/index.js +14 -2
  136. package/build/heading/index.js.map +1 -1
  137. package/build/heading/transforms.js +14 -2
  138. package/build/heading/transforms.js.map +1 -1
  139. package/build/image/edit.native.js +126 -60
  140. package/build/image/edit.native.js.map +1 -1
  141. package/build/image/index.js +1 -1
  142. package/build/image/transforms.js +2 -1
  143. package/build/image/transforms.js.map +1 -1
  144. package/build/index.js +83 -70
  145. package/build/index.js.map +1 -1
  146. package/build/index.native.js +3 -1
  147. package/build/index.native.js.map +1 -1
  148. package/build/list/deprecated.js +111 -0
  149. package/build/list/deprecated.js.map +1 -0
  150. package/build/list/index.js +15 -3
  151. package/build/list/index.js.map +1 -1
  152. package/build/media-text/edit.js +1 -1
  153. package/build/media-text/edit.js.map +1 -1
  154. package/build/media-text/save.js +3 -3
  155. package/build/media-text/save.js.map +1 -1
  156. package/build/navigation/deprecated.js +340 -23
  157. package/build/navigation/deprecated.js.map +1 -1
  158. package/build/navigation/edit/index.js +372 -0
  159. package/build/navigation/edit/index.js.map +1 -0
  160. package/build/navigation/edit/inner-blocks.js +100 -0
  161. package/build/navigation/edit/inner-blocks.js.map +1 -0
  162. package/build/navigation/edit/navigation-menu-delete-control.js +60 -0
  163. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -0
  164. package/build/navigation/edit/navigation-menu-name-control.js +27 -0
  165. package/build/navigation/edit/navigation-menu-name-control.js.map +1 -0
  166. package/build/navigation/edit/navigation-menu-name-modal.js +54 -0
  167. package/build/navigation/edit/navigation-menu-name-modal.js.map +1 -0
  168. package/build/navigation/edit/navigation-menu-publish-button.js +53 -0
  169. package/build/navigation/edit/navigation-menu-publish-button.js.map +1 -0
  170. package/build/navigation/edit/navigation-menu-selector.js +49 -0
  171. package/build/navigation/edit/navigation-menu-selector.js.map +1 -0
  172. package/build/navigation/edit/placeholder/index.js +207 -0
  173. package/build/navigation/edit/placeholder/index.js.map +1 -0
  174. package/build/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +14 -2
  175. package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
  176. package/build/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +9 -5
  177. package/build/navigation/edit/responsive-wrapper.js.map +1 -0
  178. package/build/navigation/edit/unsaved-inner-blocks.js +153 -0
  179. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -0
  180. package/build/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +34 -3
  181. package/build/navigation/edit/use-list-view-modal.js.map +1 -0
  182. package/build/navigation/index.js +25 -13
  183. package/build/navigation/index.js.map +1 -1
  184. package/build/navigation/save.js +10 -1
  185. package/build/navigation/save.js.map +1 -1
  186. package/build/navigation/use-navigation-menu.js +40 -0
  187. package/build/navigation/use-navigation-menu.js.map +1 -0
  188. package/build/navigation/use-template-part-area-label.js +74 -0
  189. package/build/navigation/use-template-part-area-label.js.map +1 -0
  190. package/build/navigation/view.js +29 -26
  191. package/build/navigation/view.js.map +1 -1
  192. package/build/navigation-area/edit.js +97 -0
  193. package/build/navigation-area/edit.js.map +1 -0
  194. package/build/navigation-area/index.js +61 -0
  195. package/build/navigation-area/index.js.map +1 -0
  196. package/build/navigation-area/inner-blocks.js +33 -0
  197. package/build/navigation-area/inner-blocks.js.map +1 -0
  198. package/build/navigation-area/save.js +18 -0
  199. package/build/navigation-area/save.js.map +1 -0
  200. package/build/navigation-link/edit.js +69 -7
  201. package/build/navigation-link/edit.js.map +1 -1
  202. package/build/navigation-link/transforms.js +5 -1
  203. package/build/navigation-link/transforms.js.map +1 -1
  204. package/build/navigation-submenu/edit.js +2 -2
  205. package/build/navigation-submenu/edit.js.map +1 -1
  206. package/build/page-list/edit.js +125 -84
  207. package/build/page-list/edit.js.map +1 -1
  208. package/build/page-list/index.js +1 -35
  209. package/build/page-list/index.js.map +1 -1
  210. package/build/paragraph/edit.native.js +2 -1
  211. package/build/paragraph/edit.native.js.map +1 -1
  212. package/build/paragraph/index.js +8 -1
  213. package/build/paragraph/index.js.map +1 -1
  214. package/build/paragraph/transforms.js +8 -1
  215. package/build/paragraph/transforms.js.map +1 -1
  216. package/build/pattern/edit.js +43 -0
  217. package/build/pattern/edit.js.map +1 -0
  218. package/build/{post-comment-author → pattern}/index.js +11 -10
  219. package/build/pattern/index.js.map +1 -0
  220. package/build/post-author/index.js +12 -1
  221. package/build/post-author/index.js.map +1 -1
  222. package/build/post-comment/edit.js +7 -8
  223. package/build/post-comment/edit.js.map +1 -1
  224. package/build/post-comment/index.js +4 -3
  225. package/build/post-comment/index.js.map +1 -1
  226. package/build/post-comment/save.js +5 -1
  227. package/build/post-comment/save.js.map +1 -1
  228. package/build/post-comments/index.js +8 -1
  229. package/build/post-comments/index.js.map +1 -1
  230. package/build/post-comments-count/index.js +7 -1
  231. package/build/post-comments-count/index.js.map +1 -1
  232. package/build/post-comments-form/index.js +9 -2
  233. package/build/post-comments-form/index.js.map +1 -1
  234. package/build/post-comments-link/index.js +8 -1
  235. package/build/post-comments-link/index.js.map +1 -1
  236. package/build/post-content/edit.js +2 -2
  237. package/build/post-content/edit.js.map +1 -1
  238. package/build/post-date/deprecated.js +71 -0
  239. package/build/post-date/deprecated.js.map +1 -0
  240. package/build/post-date/edit.js +1 -1
  241. package/build/post-date/edit.js.map +1 -1
  242. package/build/post-date/index.js +12 -2
  243. package/build/post-date/index.js.map +1 -1
  244. package/build/post-excerpt/edit.js +1 -1
  245. package/build/post-excerpt/edit.js.map +1 -1
  246. package/build/post-excerpt/index.js +12 -1
  247. package/build/post-excerpt/index.js.map +1 -1
  248. package/build/post-featured-image/index.js +5 -1
  249. package/build/post-featured-image/index.js.map +1 -1
  250. package/build/post-navigation-link/index.js +8 -1
  251. package/build/post-navigation-link/index.js.map +1 -1
  252. package/build/post-template/edit.js +8 -4
  253. package/build/post-template/edit.js.map +1 -1
  254. package/build/post-terms/edit.js +2 -6
  255. package/build/post-terms/edit.js.map +1 -1
  256. package/build/post-terms/index.js +7 -1
  257. package/build/post-terms/index.js.map +1 -1
  258. package/build/post-terms/use-post-terms.js +3 -1
  259. package/build/post-terms/use-post-terms.js.map +1 -1
  260. package/build/post-title/deprecated.js +84 -0
  261. package/build/post-title/deprecated.js.map +1 -0
  262. package/build/post-title/edit.js +1 -1
  263. package/build/post-title/edit.js.map +1 -1
  264. package/build/post-title/index.js +14 -2
  265. package/build/post-title/index.js.map +1 -1
  266. package/build/preformatted/edit.js +5 -2
  267. package/build/preformatted/edit.js.map +1 -1
  268. package/build/preformatted/edit.native.js +16 -6
  269. package/build/preformatted/edit.native.js.map +1 -1
  270. package/build/preformatted/index.js +9 -1
  271. package/build/preformatted/index.js.map +1 -1
  272. package/build/pullquote/blockquote.native.js +14 -2
  273. package/build/pullquote/blockquote.native.js.map +1 -1
  274. package/build/pullquote/edit.native.js +124 -0
  275. package/build/pullquote/edit.native.js.map +1 -0
  276. package/build/pullquote/figure.native.js +20 -8
  277. package/build/pullquote/figure.native.js.map +1 -1
  278. package/build/pullquote/index.js +12 -0
  279. package/build/pullquote/index.js.map +1 -1
  280. package/build/query/edit/index.js +1 -1
  281. package/build/query/edit/index.js.map +1 -1
  282. package/build/query/save.js +5 -1
  283. package/build/query/save.js.map +1 -1
  284. package/build/query-pagination/edit.js +1 -1
  285. package/build/query-pagination/edit.js.map +1 -1
  286. package/build/query-pagination-next/index.js +8 -1
  287. package/build/query-pagination-next/index.js.map +1 -1
  288. package/build/query-pagination-previous/index.js +8 -1
  289. package/build/query-pagination-previous/index.js.map +1 -1
  290. package/build/query-title/deprecated.js +70 -0
  291. package/build/query-title/deprecated.js.map +1 -0
  292. package/build/query-title/index.js +17 -2
  293. package/build/query-title/index.js.map +1 -1
  294. package/build/quote/deprecated.js +9 -0
  295. package/build/quote/deprecated.js.map +1 -1
  296. package/build/quote/index.js +17 -1
  297. package/build/quote/index.js.map +1 -1
  298. package/build/search/edit.js +27 -1
  299. package/build/search/edit.js.map +1 -1
  300. package/build/search/edit.native.js +38 -7
  301. package/build/search/edit.native.js.map +1 -1
  302. package/build/separator/separator-settings.js +1 -0
  303. package/build/separator/separator-settings.js.map +1 -1
  304. package/build/site-logo/edit.js +46 -21
  305. package/build/site-logo/edit.js.map +1 -1
  306. package/build/site-logo/index.js +6 -0
  307. package/build/site-logo/index.js.map +1 -1
  308. package/build/site-tagline/deprecated.js +68 -0
  309. package/build/site-tagline/deprecated.js.map +1 -0
  310. package/build/site-tagline/index.js +11 -3
  311. package/build/site-tagline/index.js.map +1 -1
  312. package/build/site-title/deprecated.js +81 -0
  313. package/build/site-title/deprecated.js.map +1 -0
  314. package/build/site-title/index.js +15 -2
  315. package/build/site-title/index.js.map +1 -1
  316. package/build/social-links/edit.js +2 -1
  317. package/build/social-links/edit.js.map +1 -1
  318. package/build/social-links/index.js +1 -0
  319. package/build/social-links/index.js.map +1 -1
  320. package/build/social-links/save.js +7 -2
  321. package/build/social-links/save.js.map +1 -1
  322. package/build/table/index.js +11 -0
  323. package/build/table/index.js.map +1 -1
  324. package/build/template-part/edit/inner-blocks.js +1 -1
  325. package/build/template-part/edit/inner-blocks.js.map +1 -1
  326. package/build/template-part/edit/placeholder/index.js +3 -3
  327. package/build/template-part/edit/placeholder/index.js.map +1 -1
  328. package/build/template-part/edit/placeholder/patterns-setup.js +3 -2
  329. package/build/template-part/edit/placeholder/patterns-setup.js.map +1 -1
  330. package/build/template-part/edit/selection/template-part-previews.js +1 -1
  331. package/build/template-part/edit/selection/template-part-previews.js.map +1 -1
  332. package/build/template-part/variations.js +1 -1
  333. package/build/template-part/variations.js.map +1 -1
  334. package/build/term-description/edit.js +1 -1
  335. package/build/term-description/edit.js.map +1 -1
  336. package/build/term-description/index.js +4 -1
  337. package/build/term-description/index.js.map +1 -1
  338. package/build/utils/clean-empty-object.js +31 -0
  339. package/build/utils/clean-empty-object.js.map +1 -0
  340. package/build/utils/migrate-font-family.js +49 -0
  341. package/build/utils/migrate-font-family.js.map +1 -0
  342. package/build/verse/deprecated.js +93 -14
  343. package/build/verse/deprecated.js.map +1 -1
  344. package/build/verse/index.js +10 -1
  345. package/build/verse/index.js.map +1 -1
  346. package/build-module/block/edit.js +1 -1
  347. package/build-module/block/edit.js.map +1 -1
  348. package/build-module/button/deprecated.js +155 -11
  349. package/build-module/button/deprecated.js.map +1 -1
  350. package/build-module/button/edit.native.js +259 -331
  351. package/build-module/button/edit.native.js.map +1 -1
  352. package/build-module/button/index.js +4 -1
  353. package/build-module/button/index.js.map +1 -1
  354. package/build-module/buttons/deprecated.js +82 -3
  355. package/build-module/buttons/deprecated.js.map +1 -1
  356. package/build-module/buttons/edit.js +6 -39
  357. package/build-module/buttons/edit.js.map +1 -1
  358. package/build-module/buttons/index.js +16 -13
  359. package/build-module/buttons/index.js.map +1 -1
  360. package/build-module/buttons/save.js +4 -18
  361. package/build-module/buttons/save.js.map +1 -1
  362. package/build-module/buttons/transforms.js +15 -10
  363. package/build-module/buttons/transforms.js.map +1 -1
  364. package/build-module/categories/edit.js +16 -6
  365. package/build-module/categories/edit.js.map +1 -1
  366. package/build-module/categories/index.js +4 -0
  367. package/build-module/categories/index.js.map +1 -1
  368. package/build-module/code/edit.native.js +9 -5
  369. package/build-module/code/edit.native.js.map +1 -1
  370. package/build-module/code/index.js +24 -1
  371. package/build-module/code/index.js.map +1 -1
  372. package/build-module/column/edit.js +4 -2
  373. package/build-module/column/edit.js.map +1 -1
  374. package/build-module/column/index.js +4 -0
  375. package/build-module/column/index.js.map +1 -1
  376. package/build-module/column/save.js +6 -4
  377. package/build-module/column/save.js.map +1 -1
  378. package/build-module/columns/edit.js +1 -1
  379. package/build-module/columns/edit.js.map +1 -1
  380. package/build-module/columns/index.js +1 -0
  381. package/build-module/columns/index.js.map +1 -1
  382. package/build-module/columns/save.js +5 -3
  383. package/build-module/columns/save.js.map +1 -1
  384. package/build-module/comment-author-avatar/edit.js +69 -0
  385. package/build-module/comment-author-avatar/edit.js.map +1 -0
  386. package/build-module/comment-author-avatar/index.js +52 -0
  387. package/build-module/comment-author-avatar/index.js.map +1 -0
  388. package/build-module/comment-author-name/deprecated.js +58 -0
  389. package/build-module/comment-author-name/deprecated.js.map +1 -0
  390. package/build-module/comment-author-name/edit.js +97 -0
  391. package/build-module/comment-author-name/edit.js.map +1 -0
  392. package/build-module/comment-author-name/index.js +63 -0
  393. package/build-module/comment-author-name/index.js.map +1 -0
  394. package/build-module/comment-content/edit.js +61 -0
  395. package/build-module/comment-content/edit.js.map +1 -0
  396. package/build-module/comment-content/index.js +55 -0
  397. package/build-module/comment-content/index.js.map +1 -0
  398. package/build-module/comment-date/deprecated.js +57 -0
  399. package/build-module/comment-date/deprecated.js.map +1 -0
  400. package/build-module/comment-date/edit.js +85 -0
  401. package/build-module/comment-date/edit.js.map +1 -0
  402. package/build-module/comment-date/index.js +58 -0
  403. package/build-module/comment-date/index.js.map +1 -0
  404. package/build-module/comment-edit-link/edit.js +48 -0
  405. package/build-module/comment-edit-link/edit.js.map +1 -0
  406. package/build-module/comment-edit-link/index.js +54 -0
  407. package/build-module/comment-edit-link/index.js.map +1 -0
  408. package/build-module/comment-reply-link/edit.js +50 -0
  409. package/build-module/comment-reply-link/edit.js.map +1 -0
  410. package/build-module/comment-reply-link/index.js +50 -0
  411. package/build-module/comment-reply-link/index.js.map +1 -0
  412. package/build-module/comment-template/edit.js +71 -0
  413. package/build-module/comment-template/edit.js.map +1 -0
  414. package/build-module/comment-template/index.js +35 -0
  415. package/build-module/comment-template/index.js.map +1 -0
  416. package/build-module/comment-template/save.js +10 -0
  417. package/build-module/comment-template/save.js.map +1 -0
  418. package/build-module/comments-query-loop/edit.js +50 -0
  419. package/build-module/comments-query-loop/edit.js.map +1 -0
  420. package/build-module/comments-query-loop/index.js +53 -0
  421. package/build-module/comments-query-loop/index.js.map +1 -0
  422. package/build-module/comments-query-loop/save.js +14 -0
  423. package/build-module/comments-query-loop/save.js.map +1 -0
  424. package/build-module/comments-query-loop/toolbar.js +44 -0
  425. package/build-module/comments-query-loop/toolbar.js.map +1 -0
  426. package/build-module/cover/deprecated.js +183 -21
  427. package/build-module/cover/deprecated.js.map +1 -1
  428. package/build-module/cover/edit.js +62 -28
  429. package/build-module/cover/edit.js.map +1 -1
  430. package/build-module/cover/edit.native.js +6 -2
  431. package/build-module/cover/edit.native.js.map +1 -1
  432. package/build-module/cover/index.js +12 -1
  433. package/build-module/cover/index.js.map +1 -1
  434. package/build-module/cover/save.js +18 -15
  435. package/build-module/cover/save.js.map +1 -1
  436. package/build-module/cover/shared.js +3 -2
  437. package/build-module/cover/shared.js.map +1 -1
  438. package/build-module/embed/edit.native.js +4 -8
  439. package/build-module/embed/edit.native.js.map +1 -1
  440. package/build-module/embed/embed-bottom-sheet.native.js +4 -5
  441. package/build-module/embed/embed-bottom-sheet.native.js.map +1 -1
  442. package/build-module/embed/embed-no-preview.native.js +2 -1
  443. package/build-module/embed/embed-no-preview.native.js.map +1 -1
  444. package/build-module/embed/icons.js +13 -0
  445. package/build-module/embed/icons.js.map +1 -1
  446. package/build-module/embed/transforms.native.js +2 -1
  447. package/build-module/embed/transforms.native.js.map +1 -1
  448. package/build-module/embed/variations.js +21 -1
  449. package/build-module/embed/variations.js.map +1 -1
  450. package/build-module/freeform/edit.js +16 -5
  451. package/build-module/freeform/edit.js.map +1 -1
  452. package/build-module/gallery/edit.js +6 -0
  453. package/build-module/gallery/edit.js.map +1 -1
  454. package/build-module/gallery/gallery.js +1 -1
  455. package/build-module/gallery/gallery.js.map +1 -1
  456. package/build-module/gallery/gallery.native.js +1 -1
  457. package/build-module/gallery/gallery.native.js.map +1 -1
  458. package/build-module/gallery/index.js +6 -1
  459. package/build-module/gallery/index.js.map +1 -1
  460. package/build-module/gallery/save.js +5 -3
  461. package/build-module/gallery/save.js.map +1 -1
  462. package/build-module/gallery/shared.js +0 -6
  463. package/build-module/gallery/shared.js.map +1 -1
  464. package/build-module/gallery/use-get-media.js +4 -10
  465. package/build-module/gallery/use-get-media.js.map +1 -1
  466. package/build-module/gallery/use-mobile-warning.js +32 -0
  467. package/build-module/gallery/use-mobile-warning.js.map +1 -0
  468. package/build-module/group/edit.js +1 -1
  469. package/build-module/group/edit.js.map +1 -1
  470. package/build-module/group/index.js +1 -0
  471. package/build-module/group/index.js.map +1 -1
  472. package/build-module/group/save.js +5 -6
  473. package/build-module/group/save.js.map +1 -1
  474. package/build-module/group/variations.js +2 -1
  475. package/build-module/group/variations.js.map +1 -1
  476. package/build-module/heading/autogenerate-anchors.js +77 -0
  477. package/build-module/heading/autogenerate-anchors.js.map +1 -0
  478. package/build-module/heading/edit.js +43 -7
  479. package/build-module/heading/edit.js.map +1 -1
  480. package/build-module/heading/index.js +14 -2
  481. package/build-module/heading/index.js.map +1 -1
  482. package/build-module/heading/transforms.js +14 -2
  483. package/build-module/heading/transforms.js.map +1 -1
  484. package/build-module/image/edit.native.js +128 -63
  485. package/build-module/image/edit.native.js.map +1 -1
  486. package/build-module/image/index.js +1 -1
  487. package/build-module/image/transforms.js +2 -1
  488. package/build-module/image/transforms.js.map +1 -1
  489. package/build-module/index.js +59 -53
  490. package/build-module/index.js.map +1 -1
  491. package/build-module/index.native.js +1 -2
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/list/deprecated.js +99 -0
  494. package/build-module/list/deprecated.js.map +1 -0
  495. package/build-module/list/index.js +14 -3
  496. package/build-module/list/index.js.map +1 -1
  497. package/build-module/media-text/edit.js +1 -1
  498. package/build-module/media-text/edit.js.map +1 -1
  499. package/build-module/media-text/save.js +4 -4
  500. package/build-module/media-text/save.js.map +1 -1
  501. package/build-module/navigation/deprecated.js +336 -23
  502. package/build-module/navigation/deprecated.js.map +1 -1
  503. package/build-module/navigation/edit/index.js +346 -0
  504. package/build-module/navigation/edit/index.js.map +1 -0
  505. package/build-module/navigation/edit/inner-blocks.js +87 -0
  506. package/build-module/navigation/edit/inner-blocks.js.map +1 -0
  507. package/build-module/navigation/edit/navigation-menu-delete-control.js +50 -0
  508. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -0
  509. package/build-module/navigation/edit/navigation-menu-name-control.js +17 -0
  510. package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -0
  511. package/build-module/navigation/edit/navigation-menu-name-modal.js +46 -0
  512. package/build-module/navigation/edit/navigation-menu-name-modal.js.map +1 -0
  513. package/build-module/navigation/edit/navigation-menu-publish-button.js +40 -0
  514. package/build-module/navigation/edit/navigation-menu-publish-button.js.map +1 -0
  515. package/build-module/navigation/edit/navigation-menu-selector.js +36 -0
  516. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -0
  517. package/build-module/navigation/edit/placeholder/index.js +189 -0
  518. package/build-module/navigation/edit/placeholder/index.js.map +1 -0
  519. package/build-module/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +11 -2
  520. package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
  521. package/build-module/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +9 -5
  522. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -0
  523. package/build-module/navigation/edit/unsaved-inner-blocks.js +136 -0
  524. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -0
  525. package/build-module/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +31 -2
  526. package/build-module/navigation/edit/use-list-view-modal.js.map +1 -0
  527. package/build-module/navigation/index.js +25 -12
  528. package/build-module/navigation/index.js.map +1 -1
  529. package/build-module/navigation/save.js +10 -1
  530. package/build-module/navigation/save.js.map +1 -1
  531. package/build-module/navigation/use-navigation-menu.js +31 -0
  532. package/build-module/navigation/use-navigation-menu.js.map +1 -0
  533. package/build-module/navigation/use-template-part-area-label.js +63 -0
  534. package/build-module/navigation/use-template-part-area-label.js.map +1 -0
  535. package/build-module/navigation/view.js +28 -26
  536. package/build-module/navigation/view.js.map +1 -1
  537. package/build-module/navigation-area/edit.js +82 -0
  538. package/build-module/navigation-area/edit.js.map +1 -0
  539. package/build-module/navigation-area/index.js +47 -0
  540. package/build-module/navigation-area/index.js.map +1 -0
  541. package/build-module/navigation-area/inner-blocks.js +25 -0
  542. package/build-module/navigation-area/inner-blocks.js.map +1 -0
  543. package/build-module/navigation-area/save.js +10 -0
  544. package/build-module/navigation-area/save.js.map +1 -0
  545. package/build-module/navigation-link/edit.js +72 -10
  546. package/build-module/navigation-link/edit.js.map +1 -1
  547. package/build-module/navigation-link/transforms.js +5 -1
  548. package/build-module/navigation-link/transforms.js.map +1 -1
  549. package/build-module/navigation-submenu/edit.js +2 -2
  550. package/build-module/navigation-submenu/edit.js.map +1 -1
  551. package/build-module/page-list/edit.js +127 -86
  552. package/build-module/page-list/edit.js.map +1 -1
  553. package/build-module/page-list/index.js +1 -35
  554. package/build-module/page-list/index.js.map +1 -1
  555. package/build-module/paragraph/edit.native.js +2 -1
  556. package/build-module/paragraph/edit.native.js.map +1 -1
  557. package/build-module/paragraph/index.js +8 -1
  558. package/build-module/paragraph/index.js.map +1 -1
  559. package/build-module/paragraph/transforms.js +8 -1
  560. package/build-module/paragraph/transforms.js.map +1 -1
  561. package/build-module/pattern/edit.js +35 -0
  562. package/build-module/pattern/edit.js.map +1 -0
  563. package/build-module/pattern/index.js +29 -0
  564. package/build-module/pattern/index.js.map +1 -0
  565. package/build-module/post-author/index.js +12 -1
  566. package/build-module/post-author/index.js.map +1 -1
  567. package/build-module/post-comment/edit.js +8 -9
  568. package/build-module/post-comment/edit.js.map +1 -1
  569. package/build-module/post-comment/index.js +4 -3
  570. package/build-module/post-comment/index.js.map +1 -1
  571. package/build-module/post-comment/save.js +4 -2
  572. package/build-module/post-comment/save.js.map +1 -1
  573. package/build-module/post-comments/index.js +8 -1
  574. package/build-module/post-comments/index.js.map +1 -1
  575. package/build-module/post-comments-count/index.js +7 -1
  576. package/build-module/post-comments-count/index.js.map +1 -1
  577. package/build-module/post-comments-form/index.js +9 -2
  578. package/build-module/post-comments-form/index.js.map +1 -1
  579. package/build-module/post-comments-link/index.js +8 -1
  580. package/build-module/post-comments-link/index.js.map +1 -1
  581. package/build-module/post-content/edit.js +2 -2
  582. package/build-module/post-content/edit.js.map +1 -1
  583. package/build-module/post-date/deprecated.js +60 -0
  584. package/build-module/post-date/deprecated.js.map +1 -0
  585. package/build-module/post-date/edit.js +1 -1
  586. package/build-module/post-date/edit.js.map +1 -1
  587. package/build-module/post-date/index.js +11 -2
  588. package/build-module/post-date/index.js.map +1 -1
  589. package/build-module/post-excerpt/edit.js +1 -1
  590. package/build-module/post-excerpt/edit.js.map +1 -1
  591. package/build-module/post-excerpt/index.js +12 -1
  592. package/build-module/post-excerpt/index.js.map +1 -1
  593. package/build-module/post-featured-image/index.js +5 -1
  594. package/build-module/post-featured-image/index.js.map +1 -1
  595. package/build-module/post-navigation-link/index.js +8 -1
  596. package/build-module/post-navigation-link/index.js.map +1 -1
  597. package/build-module/post-template/edit.js +10 -5
  598. package/build-module/post-template/edit.js.map +1 -1
  599. package/build-module/post-terms/edit.js +2 -6
  600. package/build-module/post-terms/edit.js.map +1 -1
  601. package/build-module/post-terms/index.js +7 -1
  602. package/build-module/post-terms/index.js.map +1 -1
  603. package/build-module/post-terms/use-post-terms.js +3 -1
  604. package/build-module/post-terms/use-post-terms.js.map +1 -1
  605. package/build-module/post-title/deprecated.js +73 -0
  606. package/build-module/post-title/deprecated.js.map +1 -0
  607. package/build-module/post-title/edit.js +1 -1
  608. package/build-module/post-title/edit.js.map +1 -1
  609. package/build-module/post-title/index.js +13 -2
  610. package/build-module/post-title/index.js.map +1 -1
  611. package/build-module/preformatted/edit.js +5 -2
  612. package/build-module/preformatted/edit.js.map +1 -1
  613. package/build-module/preformatted/edit.native.js +17 -6
  614. package/build-module/preformatted/edit.native.js.map +1 -1
  615. package/build-module/preformatted/index.js +9 -1
  616. package/build-module/preformatted/index.js.map +1 -1
  617. package/build-module/pullquote/blockquote.native.js +14 -2
  618. package/build-module/pullquote/blockquote.native.js.map +1 -1
  619. package/build-module/pullquote/edit.native.js +112 -0
  620. package/build-module/pullquote/edit.native.js.map +1 -0
  621. package/build-module/pullquote/figure.native.js +20 -9
  622. package/build-module/pullquote/figure.native.js.map +1 -1
  623. package/build-module/pullquote/index.js +12 -0
  624. package/build-module/pullquote/index.js.map +1 -1
  625. package/build-module/query/edit/index.js +1 -1
  626. package/build-module/query/edit/index.js.map +1 -1
  627. package/build-module/query/save.js +4 -2
  628. package/build-module/query/save.js.map +1 -1
  629. package/build-module/query-pagination/edit.js +1 -1
  630. package/build-module/query-pagination/edit.js.map +1 -1
  631. package/build-module/query-pagination-next/index.js +8 -1
  632. package/build-module/query-pagination-next/index.js.map +1 -1
  633. package/build-module/query-pagination-previous/index.js +8 -1
  634. package/build-module/query-pagination-previous/index.js.map +1 -1
  635. package/build-module/query-title/deprecated.js +59 -0
  636. package/build-module/query-title/deprecated.js.map +1 -0
  637. package/build-module/query-title/index.js +16 -2
  638. package/build-module/query-title/index.js.map +1 -1
  639. package/build-module/quote/deprecated.js +9 -0
  640. package/build-module/quote/deprecated.js.map +1 -1
  641. package/build-module/quote/index.js +17 -1
  642. package/build-module/quote/index.js.map +1 -1
  643. package/build-module/search/edit.js +28 -2
  644. package/build-module/search/edit.js.map +1 -1
  645. package/build-module/search/edit.native.js +38 -7
  646. package/build-module/search/edit.native.js.map +1 -1
  647. package/build-module/separator/separator-settings.js +1 -0
  648. package/build-module/separator/separator-settings.js.map +1 -1
  649. package/build-module/site-logo/edit.js +49 -26
  650. package/build-module/site-logo/edit.js.map +1 -1
  651. package/build-module/site-logo/index.js +6 -0
  652. package/build-module/site-logo/index.js.map +1 -1
  653. package/build-module/site-tagline/deprecated.js +57 -0
  654. package/build-module/site-tagline/deprecated.js.map +1 -0
  655. package/build-module/site-tagline/index.js +10 -3
  656. package/build-module/site-tagline/index.js.map +1 -1
  657. package/build-module/site-title/deprecated.js +70 -0
  658. package/build-module/site-title/deprecated.js.map +1 -0
  659. package/build-module/site-title/index.js +14 -2
  660. package/build-module/site-title/index.js.map +1 -1
  661. package/build-module/social-links/edit.js +2 -1
  662. package/build-module/social-links/edit.js.map +1 -1
  663. package/build-module/social-links/index.js +1 -0
  664. package/build-module/social-links/index.js.map +1 -1
  665. package/build-module/social-links/save.js +5 -3
  666. package/build-module/social-links/save.js.map +1 -1
  667. package/build-module/table/index.js +11 -0
  668. package/build-module/table/index.js.map +1 -1
  669. package/build-module/template-part/edit/inner-blocks.js +1 -1
  670. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  671. package/build-module/template-part/edit/placeholder/index.js +3 -3
  672. package/build-module/template-part/edit/placeholder/index.js.map +1 -1
  673. package/build-module/template-part/edit/placeholder/patterns-setup.js +3 -2
  674. package/build-module/template-part/edit/placeholder/patterns-setup.js.map +1 -1
  675. package/build-module/template-part/edit/selection/template-part-previews.js +1 -1
  676. package/build-module/template-part/edit/selection/template-part-previews.js.map +1 -1
  677. package/build-module/template-part/variations.js +2 -2
  678. package/build-module/template-part/variations.js.map +1 -1
  679. package/build-module/term-description/edit.js +1 -1
  680. package/build-module/term-description/edit.js.map +1 -1
  681. package/build-module/term-description/index.js +4 -1
  682. package/build-module/term-description/index.js.map +1 -1
  683. package/build-module/utils/clean-empty-object.js +22 -0
  684. package/build-module/utils/clean-empty-object.js.map +1 -0
  685. package/build-module/utils/migrate-font-family.js +38 -0
  686. package/build-module/utils/migrate-font-family.js.map +1 -0
  687. package/build-module/verse/deprecated.js +90 -15
  688. package/build-module/verse/deprecated.js.map +1 -1
  689. package/build-module/verse/index.js +10 -1
  690. package/build-module/verse/index.js.map +1 -1
  691. package/build-style/button/editor-rtl.css +0 -1
  692. package/build-style/button/editor.css +0 -1
  693. package/build-style/button/style-rtl.css +15 -27
  694. package/build-style/button/style.css +15 -27
  695. package/build-style/buttons/editor-rtl.css +4 -8
  696. package/build-style/buttons/editor.css +4 -8
  697. package/build-style/buttons/style-rtl.css +1 -35
  698. package/build-style/buttons/style.css +1 -48
  699. package/build-style/columns/style-rtl.css +1 -1
  700. package/build-style/columns/style.css +1 -1
  701. package/build-style/common-rtl.css +2 -16
  702. package/build-style/common.css +2 -16
  703. package/build-style/cover/editor-rtl.css +14 -32
  704. package/build-style/cover/editor.css +14 -32
  705. package/build-style/cover/style-rtl.css +28 -40
  706. package/build-style/cover/style.css +28 -40
  707. package/build-style/editor-rtl.css +198 -145
  708. package/build-style/editor.css +198 -145
  709. package/build-style/image/editor-rtl.css +1 -0
  710. package/build-style/image/editor.css +1 -0
  711. package/build-style/image/style-rtl.css +4 -0
  712. package/build-style/image/style.css +4 -0
  713. package/build-style/media-text/style-rtl.css +1 -0
  714. package/build-style/media-text/style.css +1 -0
  715. package/build-style/navigation/editor-rtl.css +58 -16
  716. package/build-style/navigation/editor.css +58 -16
  717. package/build-style/navigation/style-rtl.css +51 -112
  718. package/build-style/navigation/style.css +51 -112
  719. package/build-style/navigation-link/editor-rtl.css +31 -14
  720. package/build-style/navigation-link/editor.css +31 -14
  721. package/build-style/navigation-link/style-rtl.css +1 -1
  722. package/build-style/navigation-link/style.css +1 -1
  723. package/build-style/navigation-submenu/editor-rtl.css +1 -1
  724. package/build-style/navigation-submenu/editor.css +1 -1
  725. package/build-style/navigation-submenu/style-rtl.css +2 -0
  726. package/build-style/navigation-submenu/style.css +2 -0
  727. package/build-style/page-list/style-rtl.css +4 -16
  728. package/build-style/page-list/style.css +4 -16
  729. package/build-style/post-author/style-rtl.css +0 -1
  730. package/build-style/post-author/style.css +0 -1
  731. package/build-style/post-comments/style-rtl.css +21 -1
  732. package/build-style/post-comments/style.css +21 -1
  733. package/build-style/post-comments-form/style-rtl.css +29 -0
  734. package/build-style/post-comments-form/style.css +29 -0
  735. package/build-style/post-featured-image/editor-rtl.css +1 -1
  736. package/build-style/post-featured-image/editor.css +1 -1
  737. package/build-style/post-featured-image/style-rtl.css +1 -1
  738. package/build-style/post-featured-image/style.css +1 -1
  739. package/build-style/quote/theme-rtl.css +1 -1
  740. package/build-style/quote/theme.css +1 -1
  741. package/build-style/reset-rtl.css +0 -5
  742. package/build-style/reset.css +0 -5
  743. package/build-style/search/style-rtl.css +18 -6
  744. package/build-style/search/style.css +18 -6
  745. package/build-style/separator/style-rtl.css +0 -1
  746. package/build-style/separator/style.css +0 -1
  747. package/build-style/site-logo/editor-rtl.css +82 -14
  748. package/build-style/site-logo/editor.css +82 -14
  749. package/build-style/site-logo/style-rtl.css +6 -2
  750. package/build-style/site-logo/style.css +6 -2
  751. package/build-style/social-link/editor-rtl.css +4 -0
  752. package/build-style/social-link/editor.css +4 -0
  753. package/build-style/social-links/editor-rtl.css +4 -0
  754. package/build-style/social-links/editor.css +4 -0
  755. package/build-style/social-links/style-rtl.css +7 -1
  756. package/build-style/social-links/style.css +7 -1
  757. package/build-style/style-rtl.css +192 -261
  758. package/build-style/style.css +192 -274
  759. package/build-style/template-part/editor-rtl.css +0 -7
  760. package/build-style/template-part/editor.css +0 -7
  761. package/build-style/theme-rtl.css +1 -1
  762. package/build-style/theme.css +1 -1
  763. package/package.json +20 -19
  764. package/src/audio/test/edit.native.js +4 -0
  765. package/src/block/edit.js +1 -1
  766. package/src/button/block.json +4 -1
  767. package/src/button/deprecated.js +149 -4
  768. package/src/button/edit.native.js +319 -366
  769. package/src/button/editor.scss +0 -1
  770. package/src/button/style.scss +18 -41
  771. package/src/buttons/block.json +15 -10
  772. package/src/buttons/deprecated.js +76 -3
  773. package/src/buttons/edit.js +4 -49
  774. package/src/buttons/editor.scss +8 -9
  775. package/src/buttons/index.js +0 -2
  776. package/src/buttons/save.js +4 -21
  777. package/src/buttons/style.scss +1 -51
  778. package/src/categories/block.json +4 -0
  779. package/src/categories/edit.js +36 -18
  780. package/src/categories/index.php +3 -0
  781. package/src/code/block.json +24 -1
  782. package/src/code/edit.native.js +12 -14
  783. package/src/column/block.json +4 -0
  784. package/src/column/edit.js +8 -2
  785. package/src/column/save.js +9 -12
  786. package/src/columns/block.json +1 -0
  787. package/src/columns/edit.js +1 -1
  788. package/src/columns/save.js +5 -6
  789. package/src/columns/style.scss +1 -1
  790. package/src/comment-author-avatar/block.json +34 -0
  791. package/src/comment-author-avatar/edit.js +96 -0
  792. package/src/comment-author-avatar/index.js +18 -0
  793. package/src/comment-author-avatar/index.php +62 -0
  794. package/src/comment-author-name/block.json +43 -0
  795. package/src/comment-author-name/deprecated.js +50 -0
  796. package/src/comment-author-name/edit.js +124 -0
  797. package/src/comment-author-name/index.js +20 -0
  798. package/src/comment-author-name/index.php +57 -0
  799. package/src/comment-content/block.json +37 -0
  800. package/src/comment-content/edit.js +80 -0
  801. package/src/{post-comment-content → comment-content}/index.js +1 -1
  802. package/src/comment-content/index.php +56 -0
  803. package/src/comment-date/block.json +38 -0
  804. package/src/comment-date/deprecated.js +49 -0
  805. package/src/comment-date/edit.js +106 -0
  806. package/src/{post-comment-date → comment-date}/index.js +2 -0
  807. package/src/comment-date/index.php +56 -0
  808. package/src/comment-edit-link/block.json +36 -0
  809. package/src/comment-edit-link/edit.js +68 -0
  810. package/src/{post-comment-author → comment-edit-link}/index.js +5 -5
  811. package/src/comment-edit-link/index.php +58 -0
  812. package/src/comment-reply-link/block.json +32 -0
  813. package/src/comment-reply-link/edit.js +59 -0
  814. package/src/comment-reply-link/index.js +18 -0
  815. package/src/comment-reply-link/index.php +80 -0
  816. package/src/comment-template/block.json +15 -0
  817. package/src/comment-template/edit.js +100 -0
  818. package/src/comment-template/index.js +20 -0
  819. package/src/comment-template/index.php +65 -0
  820. package/src/comment-template/save.js +8 -0
  821. package/src/comments-query-loop/block.json +33 -0
  822. package/src/comments-query-loop/edit.js +53 -0
  823. package/src/comments-query-loop/index.js +20 -0
  824. package/src/comments-query-loop/save.js +14 -0
  825. package/src/comments-query-loop/toolbar.js +57 -0
  826. package/src/common.scss +3 -17
  827. package/src/cover/block.json +12 -1
  828. package/src/cover/deprecated.js +707 -510
  829. package/src/cover/edit.js +70 -42
  830. package/src/cover/edit.native.js +5 -1
  831. package/src/cover/editor.scss +20 -38
  832. package/src/cover/save.js +30 -26
  833. package/src/cover/shared.js +3 -2
  834. package/src/cover/style.scss +9 -7
  835. package/src/editor.scss +4 -20
  836. package/src/embed/edit.native.js +6 -9
  837. package/src/embed/embed-bottom-sheet.native.js +4 -5
  838. package/src/embed/embed-no-preview.native.js +1 -0
  839. package/src/embed/icons.js +11 -0
  840. package/src/embed/test/__snapshots__/index.native.js.snap +181 -0
  841. package/src/embed/test/index.native.js +991 -0
  842. package/src/embed/transforms.native.js +2 -0
  843. package/src/embed/variations.js +21 -0
  844. package/src/file/test/__snapshots__/edit.native.js.snap +6 -3
  845. package/src/file/test/edit.native.js +4 -0
  846. package/src/freeform/edit.js +14 -4
  847. package/src/gallery/block.json +6 -1
  848. package/src/gallery/edit.js +7 -0
  849. package/src/gallery/editor.scss +0 -1
  850. package/src/gallery/gallery.js +1 -4
  851. package/src/gallery/gallery.native.js +1 -4
  852. package/src/gallery/index.php +52 -0
  853. package/src/gallery/save.js +9 -3
  854. package/src/gallery/shared.js +0 -7
  855. package/src/gallery/use-get-media.js +6 -11
  856. package/src/gallery/use-mobile-warning.js +28 -0
  857. package/src/group/block.json +1 -0
  858. package/src/group/edit.js +1 -1
  859. package/src/group/save.js +3 -8
  860. package/src/group/variations.js +1 -1
  861. package/src/heading/autogenerate-anchors.js +81 -0
  862. package/src/heading/block.json +14 -2
  863. package/src/heading/edit.js +42 -4
  864. package/src/home-link/index.php +3 -1
  865. package/src/image/block.json +1 -1
  866. package/src/image/edit.native.js +120 -64
  867. package/src/image/editor.scss +1 -0
  868. package/src/image/index.php +42 -0
  869. package/src/image/style.scss +8 -2
  870. package/src/image/test/edit.native.js +225 -40
  871. package/src/image/transforms.js +4 -0
  872. package/src/index.js +96 -88
  873. package/src/index.native.js +1 -1
  874. package/src/list/block.json +11 -2
  875. package/src/list/deprecated.js +79 -0
  876. package/src/list/index.js +2 -0
  877. package/src/media-text/edit.js +1 -1
  878. package/src/media-text/save.js +6 -4
  879. package/src/media-text/style.scss +1 -0
  880. package/src/navigation/block.json +41 -13
  881. package/src/navigation/deprecated.js +336 -27
  882. package/src/navigation/edit/index.js +510 -0
  883. package/src/navigation/edit/inner-blocks.js +134 -0
  884. package/src/navigation/edit/navigation-menu-delete-control.js +81 -0
  885. package/src/navigation/edit/navigation-menu-name-control.js +22 -0
  886. package/src/navigation/edit/navigation-menu-name-modal.js +69 -0
  887. package/src/navigation/edit/navigation-menu-publish-button.js +57 -0
  888. package/src/navigation/edit/navigation-menu-selector.js +42 -0
  889. package/src/navigation/edit/placeholder/index.js +257 -0
  890. package/src/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +13 -2
  891. package/src/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +8 -6
  892. package/src/navigation/edit/unsaved-inner-blocks.js +197 -0
  893. package/src/navigation/edit/use-list-view-modal.js +72 -0
  894. package/src/navigation/editor.scss +86 -31
  895. package/src/navigation/index.js +0 -2
  896. package/src/navigation/index.php +54 -107
  897. package/src/navigation/save.js +7 -1
  898. package/src/navigation/style.scss +81 -155
  899. package/src/navigation/use-navigation-menu.js +60 -0
  900. package/src/navigation/use-template-part-area-label.js +78 -0
  901. package/src/navigation/view.js +33 -32
  902. package/src/navigation-area/block.json +27 -0
  903. package/src/navigation-area/edit.js +105 -0
  904. package/src/navigation-area/index.js +26 -0
  905. package/src/navigation-area/index.php +21 -0
  906. package/src/navigation-area/inner-blocks.js +24 -0
  907. package/src/navigation-area/save.js +8 -0
  908. package/src/navigation-link/edit.js +97 -12
  909. package/src/navigation-link/editor.scss +30 -19
  910. package/src/navigation-link/index.php +8 -10
  911. package/src/navigation-link/style.scss +1 -1
  912. package/src/navigation-link/transforms.js +5 -1
  913. package/src/navigation-submenu/edit.js +2 -2
  914. package/src/navigation-submenu/editor.scss +1 -1
  915. package/src/navigation-submenu/index.php +10 -9
  916. package/src/navigation-submenu/style.scss +5 -0
  917. package/src/page-list/block.json +0 -33
  918. package/src/page-list/edit.js +168 -110
  919. package/src/page-list/index.php +27 -26
  920. package/src/page-list/style.scss +4 -23
  921. package/src/paragraph/block.json +8 -1
  922. package/src/paragraph/edit.native.js +1 -0
  923. package/src/pattern/block.json +17 -0
  924. package/src/pattern/edit.js +41 -0
  925. package/src/pattern/index.js +12 -0
  926. package/src/pattern/index.php +44 -0
  927. package/src/post-author/block.json +12 -1
  928. package/src/post-author/style.scss +0 -1
  929. package/src/post-comment/block.json +4 -3
  930. package/src/post-comment/edit.js +16 -13
  931. package/src/post-comment/save.js +4 -6
  932. package/src/post-comments/block.json +8 -1
  933. package/src/post-comments/index.php +12 -3
  934. package/src/post-comments/style.scss +27 -1
  935. package/src/post-comments-count/block.json +7 -1
  936. package/src/post-comments-form/block.json +9 -2
  937. package/src/post-comments-form/index.php +0 -14
  938. package/src/post-comments-form/style.scss +47 -7
  939. package/src/post-comments-link/block.json +8 -1
  940. package/src/post-content/edit.js +2 -2
  941. package/src/post-date/block.json +8 -1
  942. package/src/post-date/deprecated.js +52 -0
  943. package/src/post-date/edit.js +1 -1
  944. package/src/post-date/index.js +2 -0
  945. package/src/post-excerpt/block.json +12 -1
  946. package/src/post-excerpt/edit.js +1 -7
  947. package/src/post-excerpt/index.php +7 -1
  948. package/src/post-featured-image/block.json +5 -1
  949. package/src/post-featured-image/editor.scss +1 -1
  950. package/src/post-featured-image/style.scss +1 -1
  951. package/src/post-navigation-link/block.json +8 -1
  952. package/src/post-navigation-link/index.php +1 -2
  953. package/src/post-template/edit.js +8 -3
  954. package/src/post-template/index.php +0 -11
  955. package/src/post-terms/block.json +7 -1
  956. package/src/post-terms/edit.js +2 -14
  957. package/src/post-terms/use-post-terms.js +1 -1
  958. package/src/post-title/block.json +10 -1
  959. package/src/post-title/deprecated.js +65 -0
  960. package/src/post-title/edit.js +1 -1
  961. package/src/post-title/index.js +2 -0
  962. package/src/post-title/index.php +7 -2
  963. package/src/preformatted/block.json +9 -1
  964. package/src/preformatted/edit.js +2 -1
  965. package/src/preformatted/edit.native.js +20 -6
  966. package/src/preformatted/styles.native.scss +5 -0
  967. package/src/preformatted/test/__snapshots__/edit.native.js.snap +20 -2
  968. package/src/pullquote/block.json +12 -0
  969. package/src/pullquote/blockquote.native.js +12 -2
  970. package/src/pullquote/edit.native.js +129 -0
  971. package/src/pullquote/figure.native.js +17 -7
  972. package/src/query/edit/index.js +1 -1
  973. package/src/query/save.js +4 -6
  974. package/src/query-pagination/edit.js +1 -1
  975. package/src/query-pagination-next/block.json +8 -1
  976. package/src/query-pagination-previous/block.json +8 -1
  977. package/src/query-title/block.json +13 -1
  978. package/src/query-title/deprecated.js +51 -0
  979. package/src/query-title/index.js +2 -0
  980. package/src/quote/block.json +15 -1
  981. package/src/quote/deprecated.js +10 -0
  982. package/src/quote/theme.scss +1 -0
  983. package/src/reset.scss +0 -9
  984. package/src/search/edit.js +29 -0
  985. package/src/search/edit.native.js +46 -12
  986. package/src/search/style.scss +54 -52
  987. package/src/search/test/__snapshots__/edit.native.js.snap +33 -5
  988. package/src/search/test/edit.native.js +4 -0
  989. package/src/separator/separator-settings.js +1 -0
  990. package/src/separator/style.scss +0 -1
  991. package/src/site-logo/block.json +6 -0
  992. package/src/site-logo/edit.js +59 -34
  993. package/src/site-logo/editor.scss +101 -16
  994. package/src/site-logo/index.php +20 -19
  995. package/src/site-logo/style.scss +8 -2
  996. package/src/site-tagline/block.json +7 -2
  997. package/src/site-tagline/deprecated.js +49 -0
  998. package/src/site-tagline/index.js +2 -0
  999. package/src/site-title/block.json +11 -1
  1000. package/src/site-title/deprecated.js +62 -0
  1001. package/src/site-title/index.js +2 -0
  1002. package/src/site-title/index.php +3 -0
  1003. package/src/social-link/editor.scss +4 -0
  1004. package/src/social-links/block.json +1 -0
  1005. package/src/social-links/edit.js +2 -1
  1006. package/src/social-links/editor.scss +4 -0
  1007. package/src/social-links/save.js +4 -6
  1008. package/src/social-links/style.scss +8 -1
  1009. package/src/table/block.json +11 -0
  1010. package/src/template-part/edit/inner-blocks.js +1 -1
  1011. package/src/template-part/edit/placeholder/index.js +5 -3
  1012. package/src/template-part/edit/placeholder/patterns-setup.js +3 -2
  1013. package/src/template-part/edit/selection/template-part-previews.js +3 -1
  1014. package/src/template-part/editor.scss +0 -16
  1015. package/src/template-part/index.php +6 -3
  1016. package/src/template-part/variations.js +2 -2
  1017. package/src/term-description/block.json +4 -1
  1018. package/src/term-description/edit.js +1 -1
  1019. package/src/utils/clean-empty-object.js +23 -0
  1020. package/src/utils/migrate-font-family.js +37 -0
  1021. package/src/verse/block.json +10 -1
  1022. package/src/verse/deprecated.js +86 -25
  1023. package/build/buttons/variations.js +0 -33
  1024. package/build/buttons/variations.js.map +0 -1
  1025. package/build/navigation/block-navigation-list.js.map +0 -1
  1026. package/build/navigation/edit.js +0 -304
  1027. package/build/navigation/edit.js.map +0 -1
  1028. package/build/navigation/placeholder-preview.js.map +0 -1
  1029. package/build/navigation/placeholder.js +0 -129
  1030. package/build/navigation/placeholder.js.map +0 -1
  1031. package/build/navigation/responsive-wrapper.js.map +0 -1
  1032. package/build/navigation/use-block-navigator.js +0 -51
  1033. package/build/navigation/use-block-navigator.js.map +0 -1
  1034. package/build/navigation/variations.js +0 -32
  1035. package/build/navigation/variations.js.map +0 -1
  1036. package/build/post-comment-author/edit.js +0 -51
  1037. package/build/post-comment-author/edit.js.map +0 -1
  1038. package/build/post-comment-author/index.js.map +0 -1
  1039. package/build/post-comment-content/edit.js +0 -37
  1040. package/build/post-comment-content/edit.js.map +0 -1
  1041. package/build/post-comment-content/index.js.map +0 -1
  1042. package/build/post-comment-date/edit.js +0 -62
  1043. package/build/post-comment-date/edit.js.map +0 -1
  1044. package/build/post-comment-date/index.js.map +0 -1
  1045. package/build-module/buttons/variations.js +0 -24
  1046. package/build-module/buttons/variations.js.map +0 -1
  1047. package/build-module/navigation/block-navigation-list.js.map +0 -1
  1048. package/build-module/navigation/edit.js +0 -284
  1049. package/build-module/navigation/edit.js.map +0 -1
  1050. package/build-module/navigation/placeholder-preview.js.map +0 -1
  1051. package/build-module/navigation/placeholder.js +0 -113
  1052. package/build-module/navigation/placeholder.js.map +0 -1
  1053. package/build-module/navigation/responsive-wrapper.js.map +0 -1
  1054. package/build-module/navigation/use-block-navigator.js +0 -39
  1055. package/build-module/navigation/use-block-navigator.js.map +0 -1
  1056. package/build-module/navigation/variations.js +0 -23
  1057. package/build-module/navigation/variations.js.map +0 -1
  1058. package/build-module/post-comment-author/edit.js +0 -40
  1059. package/build-module/post-comment-author/edit.js.map +0 -1
  1060. package/build-module/post-comment-author/index.js +0 -31
  1061. package/build-module/post-comment-author/index.js.map +0 -1
  1062. package/build-module/post-comment-content/edit.js +0 -27
  1063. package/build-module/post-comment-content/edit.js.map +0 -1
  1064. package/build-module/post-comment-content/index.js +0 -31
  1065. package/build-module/post-comment-content/index.js.map +0 -1
  1066. package/build-module/post-comment-date/edit.js +0 -52
  1067. package/build-module/post-comment-date/edit.js.map +0 -1
  1068. package/build-module/post-comment-date/index.js +0 -36
  1069. package/build-module/post-comment-date/index.js.map +0 -1
  1070. package/build-style/post-author/editor-rtl.css +0 -104
  1071. package/build-style/post-author/editor.css +0 -104
  1072. package/build-style/query-title/editor-rtl.css +0 -80
  1073. package/build-style/query-title/editor.css +0 -80
  1074. package/build-style/term-description/editor-rtl.css +0 -80
  1075. package/build-style/term-description/editor.css +0 -80
  1076. package/src/buttons/variations.js +0 -24
  1077. package/src/navigation/block-navigation-list.js +0 -38
  1078. package/src/navigation/edit.js +0 -411
  1079. package/src/navigation/placeholder.js +0 -154
  1080. package/src/navigation/use-block-navigator.js +0 -46
  1081. package/src/navigation/variations.js +0 -23
  1082. package/src/post-author/editor.scss +0 -35
  1083. package/src/post-comment-author/block.json +0 -13
  1084. package/src/post-comment-author/edit.js +0 -35
  1085. package/src/post-comment-author/index.php +0 -41
  1086. package/src/post-comment-content/block.json +0 -13
  1087. package/src/post-comment-content/edit.js +0 -32
  1088. package/src/post-comment-content/index.php +0 -42
  1089. package/src/post-comment-date/block.json +0 -18
  1090. package/src/post-comment-date/edit.js +0 -54
  1091. package/src/post-comment-date/index.php +0 -44
  1092. package/src/query-title/editor.scss +0 -4
  1093. package/src/term-description/editor.scss +0 -4
@@ -96,8 +96,8 @@ function TemplatePartPlaceholder({
96
96
  icon: areaIcon,
97
97
  label: areaLabel,
98
98
  instructions: enableSelection ? (0, _i18n.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
99
- 'Choose an existing %s or create a new one.', areaLabel.toLowerCase()) : (0, _i18n.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
100
- 'Create a new %s.', areaLabel.toLowerCase())
99
+ (0, _i18n.__)('Choose an existing %s or create a new one.'), areaLabel.toLowerCase()) : (0, _i18n.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
100
+ (0, _i18n.__)('Create a new %s.'), areaLabel.toLowerCase())
101
101
  }, !hasResolvedReplacements ? (0, _element.createElement)(_components.Spinner, null) : (0, _element.createElement)(_components.Dropdown, {
102
102
  contentClassName: "wp-block-template-part__placeholder-preview-dropdown-content",
103
103
  position: "bottom right left",
@@ -112,7 +112,7 @@ function TemplatePartPlaceholder({
112
112
  variant: enableSelection ? 'tertiary' : 'primary',
113
113
  onClick: () => setStep(PLACEHOLDER_STEPS.patterns)
114
114
  }, (0, _i18n.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
115
- 'New %s', areaLabel.toLowerCase()))),
115
+ (0, _i18n.__)('New %s'), areaLabel.toLowerCase()))),
116
116
  renderContent: ({
117
117
  onClose
118
118
  }) => (0, _element.createElement)(_selection.default, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/placeholder/index.js"],"names":["PLACEHOLDER_STEPS","initial","patterns","TemplatePartPlaceholder","area","clientId","setAttributes","enableSelection","hasResolvedReplacements","saveEntityRecord","coreStore","step","setStep","areaIcon","areaLabel","select","definedAreas","__experimentalGetDefaultTemplatePartAreas","selectedArea","defaultArea","icon","label","onCreate","startingBlocks","title","record","slug","content","templatePart","theme","undefined","toLowerCase","isOpen","onToggle","onClose"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AACA;;A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AAA,OAAO,EACNzB,eAAe,GACZ,UADY,GAEZ,SAJL;AAMC,MAAA,OAAO,EAAG,MACTK,OAAO,CACNZ,iBAAiB,CAACE,QADZ;AAPT,OAYG,oBACD;AACA,YAFC,EAGDY,SAAS,CAACiB,WAAV,EAHC,CAZH,CAVD,CAJF;AAkCC,IAAA,aAAa,EAAG,CAAE;AAAEG,MAAAA;AAAF,KAAF,KACf,4BAAC,kBAAD;AACC,MAAA,aAAa,EAAG5B,aADjB;AAEC,MAAA,OAAO,EAAG4B,OAFX;AAGC,MAAA,IAAI,EAAG9B;AAHR;AAnCF,IApBF,CAFF,EAmEGO,IAAI,KAAKX,iBAAiB,CAACE,QAA3B,IACD,4BAAC,sBAAD;AACC,IAAA,IAAI,EAAGE,IADR;AAEC,IAAA,SAAS,EAAGU,SAFb;AAGC,IAAA,QAAQ,EAAGD,QAHZ;AAIC,IAAA,QAAQ,EAAGS,QAJZ;AAKC,IAAA,QAAQ,EAAGjB,QALZ;AAMC,IAAA,gBAAgB,EAAG,MAClBO,OAAO,CAAEZ,iBAAiB,CAACC,OAApB;AAPT,IApEF,CADD;AAkFA","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useState } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Placeholder, Dropdown, Button, Spinner } from '@wordpress/components';\nimport { serialize } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartSelection from '../selection';\nimport PatternsSetup from './patterns-setup';\n\nconst PLACEHOLDER_STEPS = {\n\tinitial: 1,\n\tpatterns: 2,\n};\n\nexport default function TemplatePartPlaceholder( {\n\tarea,\n\tclientId,\n\tsetAttributes,\n\tenableSelection,\n\thasResolvedReplacements,\n} ) {\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ step, setStep ] = useState( PLACEHOLDER_STEPS.initial );\n\n\tconst { areaIcon, areaLabel } = useSelect(\n\t\t( select ) => {\n\t\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t\t// Blocks can be loaded into a *non-post* block editor.\n\t\t\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\t\t\tconst definedAreas = select(\n\t\t\t\t'core/editor'\n\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\n\t\t\tconst selectedArea = find( definedAreas, { area } );\n\t\t\tconst defaultArea = find( definedAreas, { area: 'uncategorized' } );\n\n\t\t\treturn {\n\t\t\t\tareaIcon: selectedArea?.icon || defaultArea?.icon,\n\t\t\t\tareaLabel: selectedArea?.label || __( 'Template Part' ),\n\t\t\t};\n\t\t},\n\t\t[ area ]\n\t);\n\n\tconst onCreate = useCallback(\n\t\tasync (\n\t\t\tstartingBlocks = [],\n\t\t\ttitle = __( 'Untitled Template Part' )\n\t\t) => {\n\t\t\t// If we have `area` set from block attributes, means an exposed\n\t\t\t// block variation was inserted. So add this prop to the template\n\t\t\t// part entity on creation. Afterwards remove `area` value from\n\t\t\t// block attributes.\n\t\t\tconst record = {\n\t\t\t\ttitle,\n\t\t\t\tslug: 'template-part',\n\t\t\t\tcontent: serialize( startingBlocks ),\n\t\t\t\t// `area` is filterable on the server and defaults to `UNCATEGORIZED`\n\t\t\t\t// if provided value is not allowed.\n\t\t\t\tarea,\n\t\t\t};\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\trecord\n\t\t\t);\n\t\t\tsetAttributes( {\n\t\t\t\tslug: templatePart.slug,\n\t\t\t\ttheme: templatePart.theme,\n\t\t\t\tarea: undefined,\n\t\t\t} );\n\t\t},\n\t\t[ setAttributes, area ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ step === PLACEHOLDER_STEPS.initial && (\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ areaIcon }\n\t\t\t\t\tlabel={ areaLabel }\n\t\t\t\t\tinstructions={\n\t\t\t\t\t\tenableSelection\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t\t\t'Choose an existing %s or create a new one.',\n\t\t\t\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t\t\t'Create a new %s.',\n\t\t\t\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ ! hasResolvedReplacements ? (\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"wp-block-template-part__placeholder-preview-dropdown-content\"\n\t\t\t\t\t\t\tposition=\"bottom right left\"\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ enableSelection && (\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Choose existing' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\tenableSelection\n\t\t\t\t\t\t\t\t\t\t\t\t? 'tertiary'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'primary'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetStep(\n\t\t\t\t\t\t\t\t\t\t\t\tPLACEHOLDER_STEPS.patterns\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t\t\t\t\t'New %s',\n\t\t\t\t\t\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<TemplatePartSelection\n\t\t\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ step === PLACEHOLDER_STEPS.patterns && (\n\t\t\t\t<PatternsSetup\n\t\t\t\t\tarea={ area }\n\t\t\t\t\tareaLabel={ areaLabel }\n\t\t\t\t\tareaIcon={ areaIcon }\n\t\t\t\t\tonCreate={ onCreate }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tresetPlaceholder={ () =>\n\t\t\t\t\t\tsetStep( PLACEHOLDER_STEPS.initial )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/placeholder/index.js"],"names":["PLACEHOLDER_STEPS","initial","patterns","TemplatePartPlaceholder","area","clientId","setAttributes","enableSelection","hasResolvedReplacements","saveEntityRecord","coreStore","step","setStep","areaIcon","areaLabel","select","definedAreas","__experimentalGetDefaultTemplatePartAreas","selectedArea","defaultArea","icon","label","onCreate","startingBlocks","title","record","slug","content","templatePart","theme","undefined","toLowerCase","isOpen","onToggle","onClose"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAIA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,OAAO,EAAE,CADgB;AAEzBC,EAAAA,QAAQ,EAAE;AAFe,CAA1B;;AAKe,SAASC,uBAAT,CAAkC;AAChDC,EAAAA,IADgD;AAEhDC,EAAAA,QAFgD;AAGhDC,EAAAA,aAHgD;AAIhDC,EAAAA,eAJgD;AAKhDC,EAAAA;AALgD,CAAlC,EAMX;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaC,eAAb,CAA7B;AACA,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoB,uBAAUZ,iBAAiB,CAACC,OAA5B,CAA1B;AAEA,QAAM;AAAEY,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA0B,qBAC7BC,MAAF,IAAc;AACb;AACA;AACA;AACA,UAAMC,YAAY,GAAGD,MAAM,CAC1B,aAD0B,CAAN,CAEnBE,yCAFmB,EAArB;;AAIA,UAAMC,YAAY,GAAG,kBAAMF,YAAN,EAAoB;AAAEZ,MAAAA;AAAF,KAApB,CAArB;AACA,UAAMe,WAAW,GAAG,kBAAMH,YAAN,EAAoB;AAAEZ,MAAAA,IAAI,EAAE;AAAR,KAApB,CAApB;AAEA,WAAO;AACNS,MAAAA,QAAQ,EAAE,CAAAK,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAEE,IAAd,MAAsBD,WAAtB,aAAsBA,WAAtB,uBAAsBA,WAAW,CAAEC,IAAnC,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EAAC,mBAFV;AAGC,IAAA,YAAY,EAAG,CAAE;AAAEwB,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,qDACG1B,eAAe,IAChB,4BAAC,kBAAD;AACC,MAAA,OAAO,EAAC,SADT;AAEC,MAAA,OAAO,EAAG0B,QAFX;AAGC,uBAAgBD;AAHjB,OAKG,cAAI,iBAAJ,CALH,CAFF,EAUC,4BAAC,kBAAD;AACC,MAAA,OAAO,EACNzB,eAAe,GACZ,UADY,GAEZ,SAJL;AAMC,MAAA,OAAO,EAAG,MACTK,OAAO,CACNZ,iBAAiB,CAACE,QADZ;AAPT,OAYG,oBACD;AACA,kBAAI,QAAJ,CAFC,EAGDY,SAAS,CAACiB,WAAV,EAHC,CAZH,CAVD,CAJF;AAkCC,IAAA,aAAa,EAAG,CAAE;AAAEG,MAAAA;AAAF,KAAF,KACf,4BAAC,kBAAD;AACC,MAAA,aAAa,EAAG5B,aADjB;AAEC,MAAA,OAAO,EAAG4B,OAFX;AAGC,MAAA,IAAI,EAAG9B;AAHR;AAnCF,IAtBF,CAFF,EAqEGO,IAAI,KAAKX,iBAAiB,CAACE,QAA3B,IACD,4BAAC,sBAAD;AACC,IAAA,IAAI,EAAGE,IADR;AAEC,IAAA,SAAS,EAAGU,SAFb;AAGC,IAAA,QAAQ,EAAGD,QAHZ;AAIC,IAAA,QAAQ,EAAGS,QAJZ;AAKC,IAAA,QAAQ,EAAGjB,QALZ;AAMC,IAAA,gBAAgB,EAAG,MAClBO,OAAO,CAAEZ,iBAAiB,CAACC,OAApB;AAPT,IAtEF,CADD;AAoFA","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useState } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Placeholder, Dropdown, Button, Spinner } from '@wordpress/components';\nimport { serialize } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartSelection from '../selection';\nimport PatternsSetup from './patterns-setup';\n\nconst PLACEHOLDER_STEPS = {\n\tinitial: 1,\n\tpatterns: 2,\n};\n\nexport default function TemplatePartPlaceholder( {\n\tarea,\n\tclientId,\n\tsetAttributes,\n\tenableSelection,\n\thasResolvedReplacements,\n} ) {\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ step, setStep ] = useState( PLACEHOLDER_STEPS.initial );\n\n\tconst { areaIcon, areaLabel } = useSelect(\n\t\t( select ) => {\n\t\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t\t// Blocks can be loaded into a *non-post* block editor.\n\t\t\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\t\t\tconst definedAreas = select(\n\t\t\t\t'core/editor'\n\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\n\t\t\tconst selectedArea = find( definedAreas, { area } );\n\t\t\tconst defaultArea = find( definedAreas, { area: 'uncategorized' } );\n\n\t\t\treturn {\n\t\t\t\tareaIcon: selectedArea?.icon || defaultArea?.icon,\n\t\t\t\tareaLabel: selectedArea?.label || __( 'Template Part' ),\n\t\t\t};\n\t\t},\n\t\t[ area ]\n\t);\n\n\tconst onCreate = useCallback(\n\t\tasync (\n\t\t\tstartingBlocks = [],\n\t\t\ttitle = __( 'Untitled Template Part' )\n\t\t) => {\n\t\t\t// If we have `area` set from block attributes, means an exposed\n\t\t\t// block variation was inserted. So add this prop to the template\n\t\t\t// part entity on creation. Afterwards remove `area` value from\n\t\t\t// block attributes.\n\t\t\tconst record = {\n\t\t\t\ttitle,\n\t\t\t\tslug: 'template-part',\n\t\t\t\tcontent: serialize( startingBlocks ),\n\t\t\t\t// `area` is filterable on the server and defaults to `UNCATEGORIZED`\n\t\t\t\t// if provided value is not allowed.\n\t\t\t\tarea,\n\t\t\t};\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\trecord\n\t\t\t);\n\t\t\tsetAttributes( {\n\t\t\t\tslug: templatePart.slug,\n\t\t\t\ttheme: templatePart.theme,\n\t\t\t\tarea: undefined,\n\t\t\t} );\n\t\t},\n\t\t[ setAttributes, area ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ step === PLACEHOLDER_STEPS.initial && (\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ areaIcon }\n\t\t\t\t\tlabel={ areaLabel }\n\t\t\t\t\tinstructions={\n\t\t\t\t\t\tenableSelection\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Choose an existing %s or create a new one.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t\t\t__( 'Create a new %s.' ),\n\t\t\t\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ ! hasResolvedReplacements ? (\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"wp-block-template-part__placeholder-preview-dropdown-content\"\n\t\t\t\t\t\t\tposition=\"bottom right left\"\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ enableSelection && (\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Choose existing' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\tenableSelection\n\t\t\t\t\t\t\t\t\t\t\t\t? 'tertiary'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'primary'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetStep(\n\t\t\t\t\t\t\t\t\t\t\t\tPLACEHOLDER_STEPS.patterns\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t\t\t\t\t__( 'New %s' ),\n\t\t\t\t\t\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<TemplatePartSelection\n\t\t\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ step === PLACEHOLDER_STEPS.patterns && (\n\t\t\t\t<PatternsSetup\n\t\t\t\t\tarea={ area }\n\t\t\t\t\tareaLabel={ areaLabel }\n\t\t\t\t\tareaIcon={ areaIcon }\n\t\t\t\t\tonCreate={ onCreate }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tresetPlaceholder={ () =>\n\t\t\t\t\t\tsetStep( PLACEHOLDER_STEPS.initial )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -55,7 +55,8 @@ function PatternsSetup({
55
55
  return pattern === null || pattern === void 0 ? void 0 : (_pattern$blockTypes = pattern.blockTypes) === null || _pattern$blockTypes === void 0 ? void 0 : (_pattern$blockTypes$s = _pattern$blockTypes.some) === null || _pattern$blockTypes$s === void 0 ? void 0 : _pattern$blockTypes$s.call(_pattern$blockTypes, blockType => blockType === blockNameWithArea);
56
56
  }
57
57
  }), isTitleStep && (0, _element.createElement)(_components.Modal, {
58
- title: (0, _i18n.sprintf)('Name and create your new %s', areaLabel.toLowerCase()),
58
+ title: (0, _i18n.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
59
+ (0, _i18n.__)('Name and create your new %s'), areaLabel.toLowerCase()),
59
60
  closeLabel: (0, _i18n.__)('Cancel'),
60
61
  onRequestClose: resetPlaceholder,
61
62
  overlayClassName: "wp-block-template-part__placeholder-create-new__title-form"
@@ -91,7 +92,7 @@ function StartBlankComponent({
91
92
  label: areaLabel,
92
93
  icon: areaIcon,
93
94
  instructions: (0, _i18n.sprintf)( // Translators: %s as template part area title ("Header", "Footer", "Template Part", etc.).
94
- 'Creating your new %s...', areaLabel.toLowerCase())
95
+ (0, _i18n.__)('Creating your new %s'), areaLabel.toLowerCase())
95
96
  });
96
97
  }
97
98
  //# sourceMappingURL=patterns-setup.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/placeholder/patterns-setup.js"],"names":["PatternsSetup","area","areaLabel","areaIcon","clientId","onCreate","resetPlaceholder","blockNameWithArea","title","setTitle","startingBlocks","setStartingBlocks","isTitleStep","setIsTitleStep","selectPattern","selectedPattern","submitForCreation","event","preventDefault","pattern","blockTypes","some","blockType","toLowerCase","length","StartBlankComponent","setTitleStep"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AANA;AACA;AACA;AAae,SAASA,aAAT,CAAwB;AACtCC,EAAAA,IADsC;AAEtCC,EAAAA,SAFsC;AAGtCC,EAAAA,QAHsC;AAItCC,EAAAA,QAJsC;AAKtCC,EAAAA,QALsC;AAMtCC,EAAAA;AANsC,CAAxB,EAOX;AACH,QAAMC,iBAAiB,GAAGN,IAAI,GAC1B,sBAAsBA,IAAM,EADF,GAE3B,oBAFH,CADG,CAKH;AACA;;AACA,QAAM,CAAEO,KAAF,EAASC,QAAT,IAAsB,uBAAU,cAAI,wBAAJ,CAAV,CAA5B;AACA,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwC,uBAAU,EAAV,CAA9C;AACA,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;;AAEA,QAAMC,aAAa,GAAKC,eAAF,IAAuB;AAC5CJ,IAAAA,iBAAiB,CAAEI,eAAF,CAAjB;AACAF,IAAAA,cAAc,CAAE,IAAF,CAAd;AACA,GAHD;;AAKA,QAAMG,iBAAiB,GAAKC,KAAF,IAAa;AACtCA,IAAAA,KAAK,CAACC,cAAN;AACAb,IAAAA,QAAQ,CAAEK,cAAF,EAAkBF,KAAlB,CAAR;AACA,GAHD;;AAKA,SACC,qDACC,4BAAC,4CAAD;AACC,IAAA,QAAQ,EAAGJ,QADZ;AAEC,IAAA,mBAAmB,EAClB,4BAAC,mBAAD;AACC,MAAA,YAAY,EAAGS,cADhB;AAEC,MAAA,SAAS,EAAGX,SAFb;AAGC,MAAA,QAAQ,EAAGC;AAHZ,MAHF;AASC,IAAA,oBAAoB,EAAGW,aATxB;AAUC,IAAA,gBAAgB,EAAKK,OAAF;AAAA;;AAAA,aAClBA,OADkB,aAClBA,OADkB,8CAClBA,OA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EAAGC,QAFR;AAGC,IAAA,YAAY,EAAG,oBACd;AACA,6BAFc,EAGdD,SAAS,CAACqB,WAAV,EAHc;AAHhB,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalBlockPatternSetup as BlockPatternSetup } from '@wordpress/block-editor';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tButton,\n\tModal,\n\tPlaceholder,\n} from '@wordpress/components';\n\nexport default function PatternsSetup( {\n\tarea,\n\tareaLabel,\n\tareaIcon,\n\tclientId,\n\tonCreate,\n\tresetPlaceholder,\n} ) {\n\tconst blockNameWithArea = area\n\t\t? `core/template-part/${ area }`\n\t\t: 'core/template-part';\n\n\t// Restructure onCreate to set the blocks on local state.\n\t// Add modal to confirm title and trigger onCreate.\n\tconst [ title, setTitle ] = useState( __( 'Untitled Template Part' ) );\n\tconst [ startingBlocks, setStartingBlocks ] = useState( [] );\n\tconst [ isTitleStep, setIsTitleStep ] = useState( false );\n\n\tconst selectPattern = ( selectedPattern ) => {\n\t\tsetStartingBlocks( selectedPattern );\n\t\tsetIsTitleStep( true );\n\t};\n\n\tconst submitForCreation = ( event ) => {\n\t\tevent.preventDefault();\n\t\tonCreate( startingBlocks, title );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<BlockPatternSetup\n\t\t\t\tclientId={ clientId }\n\t\t\t\tstartBlankComponent={\n\t\t\t\t\t<StartBlankComponent\n\t\t\t\t\t\tsetTitleStep={ setIsTitleStep }\n\t\t\t\t\t\tareaLabel={ areaLabel }\n\t\t\t\t\t\tareaIcon={ areaIcon }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonBlockPatternSelect={ selectPattern }\n\t\t\t\tfilterPatternsFn={ ( pattern ) =>\n\t\t\t\t\tpattern?.blockTypes?.some?.(\n\t\t\t\t\t\t( blockType ) => blockType === blockNameWithArea\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isTitleStep && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t'Name and create your new %s',\n\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\t\t\tonRequestClose={ resetPlaceholder }\n\t\t\t\t\toverlayClassName=\"wp-block-template-part__placeholder-create-new__title-form\"\n\t\t\t\t>\n\t\t\t\t\t<form onSubmit={ submitForCreation }>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"wp-block-template-part__placeholder-create-new__title-form-actions\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tonClick={ resetPlaceholder }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title.length }\n\t\t\t\t\t\t\t\t\taria-disabled={ ! title.length }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction StartBlankComponent( { setTitleStep, areaLabel, areaIcon } ) {\n\tuseEffect( () => {\n\t\tsetTitleStep( true );\n\t}, [] );\n\treturn (\n\t\t<Placeholder\n\t\t\tlabel={ areaLabel }\n\t\t\ticon={ areaIcon }\n\t\t\tinstructions={ sprintf(\n\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", \"Template Part\", etc.).\n\t\t\t\t'Creating your new %s...',\n\t\t\t\tareaLabel.toLowerCase()\n\t\t\t) }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/placeholder/patterns-setup.js"],"names":["PatternsSetup","area","areaLabel","areaIcon","clientId","onCreate","resetPlaceholder","blockNameWithArea","title","setTitle","startingBlocks","setStartingBlocks","isTitleStep","setIsTitleStep","selectPattern","selectedPattern","submitForCreation","event","preventDefault","pattern","blockTypes","some","blockType","toLowerCase","length","StartBlankComponent","setTitleStep"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AANA;AACA;AACA;AAae,SAASA,aAAT,CAAwB;AACtCC,EAAAA,IADsC;AAEtCC,EAAAA,SAFsC;AAGtCC,EAAAA,QAHsC;AAItCC,EAAAA,QAJsC;AAKtCC,EAAAA,QALsC;AAMtCC,EAAAA;AANsC,CAAxB,EAOX;AACH,QAAMC,iBAAiB,GAAGN,IAAI,GAC1B,sBAAsBA,IAAM,EADF,GAE3B,oBAFH,CADG,CAKH;AACA;;AACA,QAAM,CAAEO,KAAF,EAASC,QAAT,IAAsB,uBAAU,cAAI,wBAAJ,CAAV,CAA5B;AACA,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwC,uBAAU,EAAV,CAA9C;AACA,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;;AAEA,QAAMC,aAAa,GAAKC,eAAF,IAAuB;AAC5CJ,IAAAA,iBAAiB,CAAEI,eAAF,CAAjB;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,CADD,CAJD,EAYC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,QAAQ,EAAG,CAAEE,KAAK,CAACgB,MAHpB;AAIC,qBAAgB,CAAEhB,KAAK,CAACgB;AAJzB,KAMG,cAAI,QAAJ,CANH,CADD,CAZD,CAND,CAVD,CAlBF,CADD;AA+DA;;AAED,SAASC,mBAAT,CAA8B;AAAEC,EAAAA,YAAF;AAAgBxB,EAAAA,SAAhB;AAA2BC,EAAAA;AAA3B,CAA9B,EAAsE;AACrE,0BAAW,MAAM;AAChBuB,IAAAA,YAAY,CAAE,IAAF,CAAZ;AACA,GAFD,EAEG,EAFH;AAGA,SACC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAGxB,SADT;AAEC,IAAA,IAAI,EAAGC,QAFR;AAGC,IAAA,YAAY,EAAG,oBACd;AACA,kBAAI,uBAAJ,CAFc,EAGdD,SAAS,CAACqB,WAAV,EAHc;AAHhB,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalBlockPatternSetup as BlockPatternSetup } from '@wordpress/block-editor';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tButton,\n\tModal,\n\tPlaceholder,\n} from '@wordpress/components';\n\nexport default function PatternsSetup( {\n\tarea,\n\tareaLabel,\n\tareaIcon,\n\tclientId,\n\tonCreate,\n\tresetPlaceholder,\n} ) {\n\tconst blockNameWithArea = area\n\t\t? `core/template-part/${ area }`\n\t\t: 'core/template-part';\n\n\t// Restructure onCreate to set the blocks on local state.\n\t// Add modal to confirm title and trigger onCreate.\n\tconst [ title, setTitle ] = useState( __( 'Untitled Template Part' ) );\n\tconst [ startingBlocks, setStartingBlocks ] = useState( [] );\n\tconst [ isTitleStep, setIsTitleStep ] = useState( false );\n\n\tconst selectPattern = ( selectedPattern ) => {\n\t\tsetStartingBlocks( selectedPattern );\n\t\tsetIsTitleStep( true );\n\t};\n\n\tconst submitForCreation = ( event ) => {\n\t\tevent.preventDefault();\n\t\tonCreate( startingBlocks, title );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<BlockPatternSetup\n\t\t\t\tclientId={ clientId }\n\t\t\t\tstartBlankComponent={\n\t\t\t\t\t<StartBlankComponent\n\t\t\t\t\t\tsetTitleStep={ setIsTitleStep }\n\t\t\t\t\t\tareaLabel={ areaLabel }\n\t\t\t\t\t\tareaIcon={ areaIcon }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonBlockPatternSelect={ selectPattern }\n\t\t\t\tfilterPatternsFn={ ( pattern ) =>\n\t\t\t\t\tpattern?.blockTypes?.some?.(\n\t\t\t\t\t\t( blockType ) => blockType === blockNameWithArea\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isTitleStep && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t__( 'Name and create your new %s' ),\n\t\t\t\t\t\tareaLabel.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\t\t\tonRequestClose={ resetPlaceholder }\n\t\t\t\t\toverlayClassName=\"wp-block-template-part__placeholder-create-new__title-form\"\n\t\t\t\t>\n\t\t\t\t\t<form onSubmit={ submitForCreation }>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"wp-block-template-part__placeholder-create-new__title-form-actions\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tonClick={ resetPlaceholder }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title.length }\n\t\t\t\t\t\t\t\t\taria-disabled={ ! title.length }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction StartBlankComponent( { setTitleStep, areaLabel, areaIcon } ) {\n\tuseEffect( () => {\n\t\tsetTitleStep( true );\n\t}, [] );\n\treturn (\n\t\t<Placeholder\n\t\t\tlabel={ areaLabel }\n\t\t\ticon={ areaIcon }\n\t\t\tinstructions={ sprintf(\n\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", \"Template Part\", etc.).\n\t\t\t\t__( 'Creating your new %s' ),\n\t\t\t\tareaLabel.toLowerCase()\n\t\t\t) }\n\t\t/>\n\t);\n}\n"]}
@@ -152,7 +152,7 @@ function TemplatePartsByArea({
152
152
  return (0, _element.createElement)(PanelGroup, {
153
153
  title: getAreaGroupTitle(labelsByArea[area] || labelsByArea.uncategorized)
154
154
  }, (0, _i18n.sprintf)( // Translators: %s for the template part variation ("Header", "Footer", "Template Part").
155
- 'There is no other %s available. If you are looking for another type of template part, try searching for it using the input above.', area && area !== 'uncategorized' ? labelsByArea[area] || area : (0, _i18n.__)('Template Part')));
155
+ (0, _i18n.__)('There is no other %s available. If you are looking for another type of template part, try searching for it using the input above.'), area && area !== 'uncategorized' ? labelsByArea[area] || area : (0, _i18n.__)('Template Part')));
156
156
  }
157
157
 
158
158
  return templatePartsByArea.map(templatePartList => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/selection/template-part-previews.js"],"names":["getAreaGroupTitle","areaLabel","PreviewPlaceholder","TemplatePartItem","templatePart","setAttributes","onClose","composite","slug","theme","title","rendered","content","raw","blocks","createSuccessNotice","noticesStore","onClick","area","undefined","type","event","ENTER","keyCode","SPACE","PanelGroup","icon","children","TemplatePartsByArea","templateParts","labelsByArea","templatePartsByArea","templatePartsToShow","_templatePartsToShow","filter","_templatePartsByArea","Object","values","orderedTemplatePartsToShow","currentShownTPs","length","uncategorized","map","templatePartList","includes","id","TemplatePartSearchResults","filterValue","filteredTPs","groupedResults","normalizedFilterValue","toLowerCase","searchResults","sort","a","b","indexInTitleA","indexOf","indexInTitleB","_groupedResults","i","push","group","TemplatePartPreviews","templatePartId","select","_templateParts","coreStore","getEntityRecords","per_page","definedAreas","__experimentalGetDefaultTemplatePartAreas","_labelsByArea","forEach","item","label"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AA3BA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;AAGA,SAASA,iBAAT,CAA4BC,SAA5B,EAAwC;AACvC,SAAO,oBACN;AACA,gBAAI,UAAJ,CAFM,EAGNA,SAHM,CAAP;AAKA;;AACD,SAASC,kBAAT,GAA8B;AAC7B,SACC;AACC,IAAA,SAAS,EAAC,+DADX;AAEC,IAAA,QAAQ,EAAG;AAFZ,IADD;AAMA;;AAED,SAASC,gBAAT,CAA2B;AAC1BC,EAAAA,YAD0B;AAE1BC,EAAAA,aAF0B;AAG1BC,EAAAA,OAH0B;AAI1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C,4BAAC,+BAAD,6BACMxC,SADN;AAEC,MAAA,IAAI,EAAC,SAFN;AAGC,oBAAa,cAAI,wBAAJ;AAHd,QAKC,4BAAC,yBAAD;AACC,MAAA,aAAa,EAAGsB,aADjB;AAEC,MAAA,aAAa,EAAGxB,aAFjB;AAGC,MAAA,WAAW,EAAG0C,WAHf;AAIC,MAAA,OAAO,EAAGzC,OAJX;AAKC,MAAA,SAAS,EAAGC,SALb;AAMC,MAAA,YAAY,EAAGuB;AANhB,MALD,CADD;AAgBA;;AAED,SACC,4BAAC,+BAAD,6BACMvB,SADN;AAEC,IAAA,IAAI,EAAC,SAFN;AAGC,kBAAa,cAAI,wBAAJ;AAHd,MAKC,4BAAC,mBAAD;AACC,IAAA,aAAa,EAAGsB,aADjB;AAEC,IAAA,aAAa,EAAGxB,aAFjB;AAGC,IAAA,OAAO,EAAGC,OAHX;AAIC,IAAA,SAAS,EAAGC,SAJb;AAKC,IAAA,IAAI,EAAGW,IALR;AAMC,IAAA,YAAY,EAAGY;AANhB,IALD,CADD;AAgBA","sourcesContent":["/**\n * External dependencies\n */\nimport { groupBy, deburr, flatten } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableCompositeItem as CompositeItem,\n\tIcon,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { createTemplatePartId } from '../utils/create-template-part-id';\n\nfunction getAreaGroupTitle( areaLabel ) {\n\treturn sprintf(\n\t\t// Translators: %s for the area the template part is assigned to (Header, Footer, General, etc.)\n\t\t__( 'Area: %s' ),\n\t\tareaLabel\n\t);\n}\nfunction PreviewPlaceholder() {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"wp-block-template-part__selection-preview-item is-placeholder\"\n\t\t\ttabIndex={ 0 }\n\t\t/>\n\t);\n}\n\nfunction TemplatePartItem( {\n\ttemplatePart,\n\tsetAttributes,\n\tonClose,\n\tcomposite,\n} ) {\n\tconst {\n\t\tslug,\n\t\ttheme,\n\t\ttitle: { rendered: title },\n\t} = templatePart;\n\t// The 'raw' property is not defined for a brief period in the save cycle.\n\t// The fallback prevents an error in the parse function while saving.\n\tconst content = templatePart.content.raw || '';\n\tconst blocks = useMemo( () => parse( content ), [ content ] );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onClick = useCallback( () => {\n\t\tsetAttributes( { slug, theme, area: undefined } );\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: template part title. */\n\t\t\t\t__( 'Template Part \"%s\" inserted.' ),\n\t\t\t\ttitle || slug\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t\tonClose();\n\t}, [ slug, theme ] );\n\n\treturn (\n\t\t<CompositeItem\n\t\t\tas=\"div\"\n\t\t\tclassName=\"wp-block-template-part__selection-preview-item\"\n\t\t\trole=\"option\"\n\t\t\tonClick={ onClick }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( ENTER === event.keyCode || SPACE === event.keyCode ) {\n\t\t\t\t\tonClick();\n\t\t\t\t}\n\t\t\t} }\n\t\t\ttabIndex={ 0 }\n\t\t\taria-label={ title || slug }\n\t\t\t{ ...composite }\n\t\t>\n\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t<div className=\"wp-block-template-part__selection-preview-item-title\">\n\t\t\t\t{ title || slug }\n\t\t\t</div>\n\t\t</CompositeItem>\n\t);\n}\n\nfunction PanelGroup( { title, icon, children } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"wp-block-template-part__selection-panel-group-header\">\n\t\t\t\t<span className=\"wp-block-template-part__selection-panel-group-title\">\n\t\t\t\t\t{ title }\n\t\t\t\t</span>\n\t\t\t\t<Icon icon={ icon } />\n\t\t\t</div>\n\t\t\t<div className=\"wp-block-template-part__selection-panel-group-content\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nfunction TemplatePartsByArea( {\n\ttemplateParts,\n\tsetAttributes,\n\tonClose,\n\tcomposite,\n\tarea = 'uncategorized',\n\tlabelsByArea,\n} ) {\n\tconst { templatePartsByArea, templatePartsToShow } = useMemo( () => {\n\t\tconst _templatePartsToShow =\n\t\t\ttemplateParts.filter(\n\t\t\t\t( templatePart ) =>\n\t\t\t\t\t'uncategorized' === area || templatePart.area === area\n\t\t\t) || [];\n\t\tconst _templatePartsByArea = Object.values(\n\t\t\tgroupBy( _templatePartsToShow, 'area' )\n\t\t);\n\t\tconst orderedTemplatePartsToShow = flatten( _templatePartsToShow );\n\t\treturn {\n\t\t\ttemplatePartsByArea: _templatePartsByArea,\n\t\t\ttemplatePartsToShow: orderedTemplatePartsToShow,\n\t\t};\n\t}, [ templateParts, area ] );\n\n\tconst currentShownTPs = useAsyncList( templatePartsToShow );\n\n\tif ( ! templatePartsToShow.length ) {\n\t\treturn (\n\t\t\t<PanelGroup\n\t\t\t\ttitle={ getAreaGroupTitle(\n\t\t\t\t\tlabelsByArea[ area ] || labelsByArea.uncategorized\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// Translators: %s for the template part variation (\"Header\", \"Footer\", \"Template Part\").\n\t\t\t\t\t'There is no other %s available. If you are looking for another type of template part, try searching for it using the input above.',\n\t\t\t\t\tarea && area !== 'uncategorized'\n\t\t\t\t\t\t? labelsByArea[ area ] || area\n\t\t\t\t\t\t: __( 'Template Part' )\n\t\t\t\t) }\n\t\t\t</PanelGroup>\n\t\t);\n\t}\n\n\treturn templatePartsByArea.map( ( templatePartList ) => {\n\t\treturn (\n\t\t\t<PanelGroup\n\t\t\t\tkey={ templatePartList[ 0 ].area }\n\t\t\t\ttitle={ getAreaGroupTitle(\n\t\t\t\t\tlabelsByArea[ templatePartList[ 0 ].area ] ||\n\t\t\t\t\t\tlabelsByArea.uncategorized\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ templatePartList.map( ( templatePart ) => {\n\t\t\t\t\treturn currentShownTPs.includes( templatePart ) ? (\n\t\t\t\t\t\t<TemplatePartItem\n\t\t\t\t\t\t\tkey={ templatePart.id }\n\t\t\t\t\t\t\ttemplatePart={ templatePart }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<PreviewPlaceholder key={ templatePart.id } />\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</PanelGroup>\n\t\t);\n\t} );\n}\n\nfunction TemplatePartSearchResults( {\n\ttemplateParts,\n\tsetAttributes,\n\tfilterValue,\n\tonClose,\n\tcomposite,\n\tlabelsByArea,\n} ) {\n\tconst { filteredTPs, groupedResults } = useMemo( () => {\n\t\t// Filter based on value.\n\t\t// Remove diacritics and convert to lowercase to normalize.\n\t\tconst normalizedFilterValue = deburr( filterValue ).toLowerCase();\n\t\tconst searchResults = templateParts.filter(\n\t\t\t( { title: { rendered: title }, area } ) =>\n\t\t\t\tdeburr( title )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes( normalizedFilterValue ) ||\n\t\t\t\t// Since diacritics can be used in theme names, remove them for the comparison.\n\t\t\t\tdeburr( labelsByArea[ area ] )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes( normalizedFilterValue )\n\t\t);\n\t\t// Order based on value location.\n\t\tsearchResults.sort( ( a, b ) => {\n\t\t\t// First prioritize index found in title.\n\t\t\t// Deburr for diacritics.\n\t\t\tconst indexInTitleA = deburr( a.title.rendered )\n\t\t\t\t.toLowerCase()\n\t\t\t\t.indexOf( normalizedFilterValue );\n\t\t\tconst indexInTitleB = deburr( b.title.rendered )\n\t\t\t\t.toLowerCase()\n\t\t\t\t.indexOf( normalizedFilterValue );\n\t\t\tif ( indexInTitleA !== -1 && indexInTitleB !== -1 ) {\n\t\t\t\treturn indexInTitleA - indexInTitleB;\n\t\t\t} else if ( indexInTitleA !== -1 ) {\n\t\t\t\treturn -1;\n\t\t\t} else if ( indexInTitleB !== -1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t// Second prioritize index found in area.\n\t\t\treturn (\n\t\t\t\tdeburr( labelsByArea[ a.area ] )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.indexOf( normalizedFilterValue ) -\n\t\t\t\tdeburr( labelsByArea[ b.area ] )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.indexOf( normalizedFilterValue )\n\t\t\t);\n\t\t} );\n\t\t// Group filtered results together if their neighbors share the same area.\n\t\t// This helps not show redundant panel groups side by side in the results.\n\t\tconst _groupedResults = [];\n\t\tfor ( let i = 0; i < searchResults.length; i++ ) {\n\t\t\tif (\n\t\t\t\ti !== 0 &&\n\t\t\t\tsearchResults[ i ].area === searchResults[ i - 1 ].area\n\t\t\t) {\n\t\t\t\t_groupedResults[ _groupedResults.length - 1 ].push(\n\t\t\t\t\tsearchResults[ i ]\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t_groupedResults.push( [ searchResults[ i ] ] );\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tfilteredTPs: searchResults,\n\t\t\tgroupedResults: _groupedResults,\n\t\t};\n\t}, [ filterValue, templateParts ] );\n\n\tconst currentShownTPs = useAsyncList( filteredTPs );\n\n\treturn groupedResults.map( ( group ) => (\n\t\t<PanelGroup\n\t\t\tkey={ group[ 0 ].id }\n\t\t\ttitle={ getAreaGroupTitle(\n\t\t\t\tlabelsByArea[ group[ 0 ].area ] || labelsByArea.uncategorized\n\t\t\t) }\n\t\t>\n\t\t\t{ group.map( ( templatePart ) =>\n\t\t\t\tcurrentShownTPs.includes( templatePart ) ? (\n\t\t\t\t\t<TemplatePartItem\n\t\t\t\t\t\tkey={ templatePart.id }\n\t\t\t\t\t\ttemplatePart={ templatePart }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<PreviewPlaceholder key={ templatePart.id } />\n\t\t\t\t)\n\t\t\t) }\n\t\t</PanelGroup>\n\t) );\n}\n\nexport default function TemplatePartPreviews( {\n\tsetAttributes,\n\tfilterValue,\n\tonClose,\n\tarea,\n\ttemplatePartId,\n} ) {\n\tconst composite = useCompositeState();\n\n\tconst { templateParts, labelsByArea } = useSelect( ( select ) => {\n\t\tconst _templateParts = (\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t) || []\n\t\t).filter(\n\t\t\t( templatePart ) =>\n\t\t\t\tcreateTemplatePartId(\n\t\t\t\t\ttemplatePart.theme,\n\t\t\t\t\ttemplatePart.slug\n\t\t\t\t) !== templatePartId\n\t\t);\n\n\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t// Blocks can be loaded into a *non-post* block editor.\n\t\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\t\tconst definedAreas = select(\n\t\t\t'core/editor'\n\t\t).__experimentalGetDefaultTemplatePartAreas();\n\t\tconst _labelsByArea = {};\n\t\tdefinedAreas.forEach( ( item ) => {\n\t\t\t_labelsByArea[ item.area ] = item.label;\n\t\t} );\n\n\t\treturn {\n\t\t\ttemplateParts: _templateParts,\n\t\t\tlabelsByArea: _labelsByArea,\n\t\t};\n\t}, [] );\n\n\tif ( ! templateParts || ! templateParts.length ) {\n\t\treturn (\n\t\t\t<PanelGroup>\n\t\t\t\t{ __( 'There are no existing template parts to select.' ) }\n\t\t\t</PanelGroup>\n\t\t);\n\t}\n\n\tif ( filterValue ) {\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\t{ ...composite }\n\t\t\t\trole=\"listbox\"\n\t\t\t\taria-label={ __( 'List of template parts' ) }\n\t\t\t>\n\t\t\t\t<TemplatePartSearchResults\n\t\t\t\t\ttemplateParts={ templateParts }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tfilterValue={ filterValue }\n\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\tlabelsByArea={ labelsByArea }\n\t\t\t\t/>\n\t\t\t</Composite>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\taria-label={ __( 'List of template parts' ) }\n\t\t>\n\t\t\t<TemplatePartsByArea\n\t\t\t\ttemplateParts={ templateParts }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tonClose={ onClose }\n\t\t\t\tcomposite={ composite }\n\t\t\t\tarea={ area }\n\t\t\t\tlabelsByArea={ labelsByArea }\n\t\t\t/>\n\t\t</Composite>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/selection/template-part-previews.js"],"names":["getAreaGroupTitle","areaLabel","PreviewPlaceholder","TemplatePartItem","templatePart","setAttributes","onClose","composite","slug","theme","title","rendered","content","raw","blocks","createSuccessNotice","noticesStore","onClick","area","undefined","type","event","ENTER","keyCode","SPACE","PanelGroup","icon","children","TemplatePartsByArea","templateParts","labelsByArea","templatePartsByArea","templatePartsToShow","_templatePartsToShow","filter","_templatePartsByArea","Object","values","orderedTemplatePartsToShow","currentShownTPs","length","uncategorized","map","templatePartList","includes","id","TemplatePartSearchResults","filterValue","filteredTPs","groupedResults","normalizedFilterValue","toLowerCase","searchResults","sort","a","b","indexInTitleA","indexOf","indexInTitleB","_groupedResults","i","push","group","TemplatePartPreviews","templatePartId","select","_templateParts","coreStore","getEntityRecords","per_page","definedAreas","__experimentalGetDefaultTemplatePartAreas","_labelsByArea","forEach","item","label"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AA3BA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;AAGA,SAASA,iBAAT,CAA4BC,SAA5B,EAAwC;AACvC,SAAO,oBACN;AACA,gBAAI,UAAJ,CAFM,EAGNA,SAHM,CAAP;AAKA;;AACD,SAASC,kBAAT,GAA8B;AAC7B,SACC;AACC,IAAA,SAAS,EAAC,+DADX;AAEC,IAAA,QAAQ,EAAG;AAFZ,IADD;AAMA;;AAED,SAASC,gBAAT,CAA2B;AAC1BC,EAAAA,YAD0B;AAE1BC,EAAAA,aAF0B;AAG1BC,EAAAA,OAH0B;AAI1BC,EAAAA;AAJ0B,CAA3B,EAKI;AACH,QAAM;AACLC,IAAAA,IADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,QAAQ,EAAED;AAAZ;AAHF,MAIFN,YAJJ,CADG,CAMH;AACA;;AACA,QAAMQ,OAAO,GAAGR,YAAY,CAACQ,OAAb,CAAqBC,GAArB,IAA4B,EAA5C;AACA,QAAMC,MAAM,GAAG,sBAAS,MAAM,mBAAOF,OAAP,CAAf,EAAiC,CAAEA,OAAF,CAAjC,CAAf;AACA,QAAM;AAAEG,IAAAA;AAAF,MAA0B,uBAAaC,cAAb,CAAhC;AAEA,QAAMC,OAAO,GAAG,0BAAa,MAAM;AAClCZ,IAAAA,aAAa,CAAE;AAAEG,MAAAA,IAAF;AAAQC,MAAAA,KAAR;AAAeS,MAAAA,IAAI,EAAEC;AAArB,KAAF,CAAb;AACAJ,IAAAA,mBAAmB,CAClB;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AAKC,IAAA,IAAI,EAAGW,IALR;AAMC,IAAA,YAAY,EAAGY;AANhB,IALD,CADD;AAgBA","sourcesContent":["/**\n * External dependencies\n */\nimport { groupBy, deburr, flatten } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableCompositeItem as CompositeItem,\n\tIcon,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { createTemplatePartId } from '../utils/create-template-part-id';\n\nfunction getAreaGroupTitle( areaLabel ) {\n\treturn sprintf(\n\t\t// Translators: %s for the area the template part is assigned to (Header, Footer, General, etc.)\n\t\t__( 'Area: %s' ),\n\t\tareaLabel\n\t);\n}\nfunction PreviewPlaceholder() {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"wp-block-template-part__selection-preview-item is-placeholder\"\n\t\t\ttabIndex={ 0 }\n\t\t/>\n\t);\n}\n\nfunction TemplatePartItem( {\n\ttemplatePart,\n\tsetAttributes,\n\tonClose,\n\tcomposite,\n} ) {\n\tconst {\n\t\tslug,\n\t\ttheme,\n\t\ttitle: { rendered: title },\n\t} = templatePart;\n\t// The 'raw' property is not defined for a brief period in the save cycle.\n\t// The fallback prevents an error in the parse function while saving.\n\tconst content = templatePart.content.raw || '';\n\tconst blocks = useMemo( () => parse( content ), [ content ] );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onClick = useCallback( () => {\n\t\tsetAttributes( { slug, theme, area: undefined } );\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: template part title. */\n\t\t\t\t__( 'Template Part \"%s\" inserted.' ),\n\t\t\t\ttitle || slug\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t\tonClose();\n\t}, [ slug, theme ] );\n\n\treturn (\n\t\t<CompositeItem\n\t\t\tas=\"div\"\n\t\t\tclassName=\"wp-block-template-part__selection-preview-item\"\n\t\t\trole=\"option\"\n\t\t\tonClick={ onClick }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( ENTER === event.keyCode || SPACE === event.keyCode ) {\n\t\t\t\t\tonClick();\n\t\t\t\t}\n\t\t\t} }\n\t\t\ttabIndex={ 0 }\n\t\t\taria-label={ title || slug }\n\t\t\t{ ...composite }\n\t\t>\n\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t<div className=\"wp-block-template-part__selection-preview-item-title\">\n\t\t\t\t{ title || slug }\n\t\t\t</div>\n\t\t</CompositeItem>\n\t);\n}\n\nfunction PanelGroup( { title, icon, children } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"wp-block-template-part__selection-panel-group-header\">\n\t\t\t\t<span className=\"wp-block-template-part__selection-panel-group-title\">\n\t\t\t\t\t{ title }\n\t\t\t\t</span>\n\t\t\t\t<Icon icon={ icon } />\n\t\t\t</div>\n\t\t\t<div className=\"wp-block-template-part__selection-panel-group-content\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nfunction TemplatePartsByArea( {\n\ttemplateParts,\n\tsetAttributes,\n\tonClose,\n\tcomposite,\n\tarea = 'uncategorized',\n\tlabelsByArea,\n} ) {\n\tconst { templatePartsByArea, templatePartsToShow } = useMemo( () => {\n\t\tconst _templatePartsToShow =\n\t\t\ttemplateParts.filter(\n\t\t\t\t( templatePart ) =>\n\t\t\t\t\t'uncategorized' === area || templatePart.area === area\n\t\t\t) || [];\n\t\tconst _templatePartsByArea = Object.values(\n\t\t\tgroupBy( _templatePartsToShow, 'area' )\n\t\t);\n\t\tconst orderedTemplatePartsToShow = flatten( _templatePartsToShow );\n\t\treturn {\n\t\t\ttemplatePartsByArea: _templatePartsByArea,\n\t\t\ttemplatePartsToShow: orderedTemplatePartsToShow,\n\t\t};\n\t}, [ templateParts, area ] );\n\n\tconst currentShownTPs = useAsyncList( templatePartsToShow );\n\n\tif ( ! templatePartsToShow.length ) {\n\t\treturn (\n\t\t\t<PanelGroup\n\t\t\t\ttitle={ getAreaGroupTitle(\n\t\t\t\t\tlabelsByArea[ area ] || labelsByArea.uncategorized\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// Translators: %s for the template part variation (\"Header\", \"Footer\", \"Template Part\").\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is no other %s available. If you are looking for another type of template part, try searching for it using the input above.'\n\t\t\t\t\t),\n\t\t\t\t\tarea && area !== 'uncategorized'\n\t\t\t\t\t\t? labelsByArea[ area ] || area\n\t\t\t\t\t\t: __( 'Template Part' )\n\t\t\t\t) }\n\t\t\t</PanelGroup>\n\t\t);\n\t}\n\n\treturn templatePartsByArea.map( ( templatePartList ) => {\n\t\treturn (\n\t\t\t<PanelGroup\n\t\t\t\tkey={ templatePartList[ 0 ].area }\n\t\t\t\ttitle={ getAreaGroupTitle(\n\t\t\t\t\tlabelsByArea[ templatePartList[ 0 ].area ] ||\n\t\t\t\t\t\tlabelsByArea.uncategorized\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ templatePartList.map( ( templatePart ) => {\n\t\t\t\t\treturn currentShownTPs.includes( templatePart ) ? (\n\t\t\t\t\t\t<TemplatePartItem\n\t\t\t\t\t\t\tkey={ templatePart.id }\n\t\t\t\t\t\t\ttemplatePart={ templatePart }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<PreviewPlaceholder key={ templatePart.id } />\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</PanelGroup>\n\t\t);\n\t} );\n}\n\nfunction TemplatePartSearchResults( {\n\ttemplateParts,\n\tsetAttributes,\n\tfilterValue,\n\tonClose,\n\tcomposite,\n\tlabelsByArea,\n} ) {\n\tconst { filteredTPs, groupedResults } = useMemo( () => {\n\t\t// Filter based on value.\n\t\t// Remove diacritics and convert to lowercase to normalize.\n\t\tconst normalizedFilterValue = deburr( filterValue ).toLowerCase();\n\t\tconst searchResults = templateParts.filter(\n\t\t\t( { title: { rendered: title }, area } ) =>\n\t\t\t\tdeburr( title )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes( normalizedFilterValue ) ||\n\t\t\t\t// Since diacritics can be used in theme names, remove them for the comparison.\n\t\t\t\tdeburr( labelsByArea[ area ] )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes( normalizedFilterValue )\n\t\t);\n\t\t// Order based on value location.\n\t\tsearchResults.sort( ( a, b ) => {\n\t\t\t// First prioritize index found in title.\n\t\t\t// Deburr for diacritics.\n\t\t\tconst indexInTitleA = deburr( a.title.rendered )\n\t\t\t\t.toLowerCase()\n\t\t\t\t.indexOf( normalizedFilterValue );\n\t\t\tconst indexInTitleB = deburr( b.title.rendered )\n\t\t\t\t.toLowerCase()\n\t\t\t\t.indexOf( normalizedFilterValue );\n\t\t\tif ( indexInTitleA !== -1 && indexInTitleB !== -1 ) {\n\t\t\t\treturn indexInTitleA - indexInTitleB;\n\t\t\t} else if ( indexInTitleA !== -1 ) {\n\t\t\t\treturn -1;\n\t\t\t} else if ( indexInTitleB !== -1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t// Second prioritize index found in area.\n\t\t\treturn (\n\t\t\t\tdeburr( labelsByArea[ a.area ] )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.indexOf( normalizedFilterValue ) -\n\t\t\t\tdeburr( labelsByArea[ b.area ] )\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.indexOf( normalizedFilterValue )\n\t\t\t);\n\t\t} );\n\t\t// Group filtered results together if their neighbors share the same area.\n\t\t// This helps not show redundant panel groups side by side in the results.\n\t\tconst _groupedResults = [];\n\t\tfor ( let i = 0; i < searchResults.length; i++ ) {\n\t\t\tif (\n\t\t\t\ti !== 0 &&\n\t\t\t\tsearchResults[ i ].area === searchResults[ i - 1 ].area\n\t\t\t) {\n\t\t\t\t_groupedResults[ _groupedResults.length - 1 ].push(\n\t\t\t\t\tsearchResults[ i ]\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t_groupedResults.push( [ searchResults[ i ] ] );\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tfilteredTPs: searchResults,\n\t\t\tgroupedResults: _groupedResults,\n\t\t};\n\t}, [ filterValue, templateParts ] );\n\n\tconst currentShownTPs = useAsyncList( filteredTPs );\n\n\treturn groupedResults.map( ( group ) => (\n\t\t<PanelGroup\n\t\t\tkey={ group[ 0 ].id }\n\t\t\ttitle={ getAreaGroupTitle(\n\t\t\t\tlabelsByArea[ group[ 0 ].area ] || labelsByArea.uncategorized\n\t\t\t) }\n\t\t>\n\t\t\t{ group.map( ( templatePart ) =>\n\t\t\t\tcurrentShownTPs.includes( templatePart ) ? (\n\t\t\t\t\t<TemplatePartItem\n\t\t\t\t\t\tkey={ templatePart.id }\n\t\t\t\t\t\ttemplatePart={ templatePart }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<PreviewPlaceholder key={ templatePart.id } />\n\t\t\t\t)\n\t\t\t) }\n\t\t</PanelGroup>\n\t) );\n}\n\nexport default function TemplatePartPreviews( {\n\tsetAttributes,\n\tfilterValue,\n\tonClose,\n\tarea,\n\ttemplatePartId,\n} ) {\n\tconst composite = useCompositeState();\n\n\tconst { templateParts, labelsByArea } = useSelect( ( select ) => {\n\t\tconst _templateParts = (\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t) || []\n\t\t).filter(\n\t\t\t( templatePart ) =>\n\t\t\t\tcreateTemplatePartId(\n\t\t\t\t\ttemplatePart.theme,\n\t\t\t\t\ttemplatePart.slug\n\t\t\t\t) !== templatePartId\n\t\t);\n\n\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t// Blocks can be loaded into a *non-post* block editor.\n\t\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\t\tconst definedAreas = select(\n\t\t\t'core/editor'\n\t\t).__experimentalGetDefaultTemplatePartAreas();\n\t\tconst _labelsByArea = {};\n\t\tdefinedAreas.forEach( ( item ) => {\n\t\t\t_labelsByArea[ item.area ] = item.label;\n\t\t} );\n\n\t\treturn {\n\t\t\ttemplateParts: _templateParts,\n\t\t\tlabelsByArea: _labelsByArea,\n\t\t};\n\t}, [] );\n\n\tif ( ! templateParts || ! templateParts.length ) {\n\t\treturn (\n\t\t\t<PanelGroup>\n\t\t\t\t{ __( 'There are no existing template parts to select.' ) }\n\t\t\t</PanelGroup>\n\t\t);\n\t}\n\n\tif ( filterValue ) {\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\t{ ...composite }\n\t\t\t\trole=\"listbox\"\n\t\t\t\taria-label={ __( 'List of template parts' ) }\n\t\t\t>\n\t\t\t\t<TemplatePartSearchResults\n\t\t\t\t\ttemplateParts={ templateParts }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tfilterValue={ filterValue }\n\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\tlabelsByArea={ labelsByArea }\n\t\t\t\t/>\n\t\t\t</Composite>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\taria-label={ __( 'List of template parts' ) }\n\t\t>\n\t\t\t<TemplatePartsByArea\n\t\t\t\ttemplateParts={ templateParts }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tonClose={ onClose }\n\t\t\t\tcomposite={ composite }\n\t\t\t\tarea={ area }\n\t\t\t\tlabelsByArea={ labelsByArea }\n\t\t\t/>\n\t\t</Composite>\n\t);\n}\n"]}
@@ -31,7 +31,7 @@ function getTemplatePartIcon(iconName) {
31
31
  return _icons.sidebar;
32
32
  }
33
33
 
34
- return _icons.layout;
34
+ return _icons.symbolFilled;
35
35
  }
36
36
 
37
37
  function enhanceTemplatePartVariations(settings, name) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/variations.js"],"names":["getTemplatePartIcon","iconName","headerIcon","footerIcon","sidebarIcon","layoutIcon","enhanceTemplatePartVariations","settings","name","variations","length","fallbackVariations","isActive","blockAttributes","variationAttributes","area","theme","slug","entity","coreDataStore","getEntityRecord","map","variation","icon"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAUA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,SAASA,mBAAT,CAA8BC,QAA9B,EAAyC;AACxC,MAAK,aAAaA,QAAlB,EAA6B;AAC5B,WAAOC,aAAP;AACA,GAFD,MAEO,IAAK,aAAaD,QAAlB,EAA6B;AACnC,WAAOE,aAAP;AACA,GAFM,MAEA,IAAK,cAAcF,QAAnB,EAA8B;AACpC,WAAOG,cAAP;AACA;;AACD,SAAOC,aAAP;AACA;;AAEM,SAASC,6BAAT,CAAwCC,QAAxC,EAAkDC,IAAlD,EAAyD;AAC/D,MAAKA,IAAI,KAAK,oBAAd,EAAqC;AACpC,WAAOD,QAAP;AACA,GAH8D,CAK/D;AACA;;;AACA,MAAK,EAAIA,QAAQ,CAACE,UAAT,IAAuBF,QAAQ,CAACE,UAAT,CAAoBC,MAA/C,CAAL,EAA+D;AAC9D,WAAO,EAAE,GAAGH,QAAL;AAAeE,MAAAA,UAAU,EAAEE;AAA3B,KAAP;AACA;;AAED,MAAKJ,QAAQ,CAACE,UAAd,EAA2B;AAC1B,UAAMG,QAAQ,GAAG,CAAEC,eAAF,EAAmBC,mBAAnB,KAA4C;AAC5D,YAAM;AAAEC,QAAAA,IAAF;AAAQC,QAAAA,KAAR;AAAeC,QAAAA;AAAf,UAAwBJ,eAA9B,CAD4D,CAE5D;AACA;;AACA,UAAKE,IAAL,EAAY,OAAOA,IAAI,KAAKD,mBAAmB,CAACC,IAApC,CAJgD,CAK5D;AACA;;AACA,UAAK,CAAEE,IAAP,EAAc,OAAO,KAAP;AACd,YAAMC,MAAM,GAAG,kBAAQC,eAAR,EAAwBC,eAAxB,CACd,UADc,EAEd,kBAFc,EAGb,GAAGJ,KAAO,KAAKC,IAAM,EAHR,CAAf;AAKA,aAAO,CAAAC,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEH,IAAR,MAAiBD,mBAAmB,CAACC,IAA5C;AACA,KAdD;;AAgBA,UAAMN,UAAU,GAAGF,QAAQ,CAACE,UAAT,CAAoBY,GAApB,CAA2BC,SAAF,IAAiB;AAC5D,aAAO,EACN,GAAGA,SADG;AAEN,YAAK,CAAEA,SAAS,CAACV,QAAZ,IAAwB;AAAEA,UAAAA;AAAF,SAA7B,CAFM;AAGN,YAAK,OAAOU,SAAS,CAACC,IAAjB,KAA0B,QAA1B,IAAsC;AAC1CA,UAAAA,IAAI,EAAEvB,mBAAmB,CAAEsB,SAAS,CAACC,IAAZ;AADiB,SAA3C;AAHM,OAAP;AAOA,KARkB,CAAnB;AAUA,WAAO,EACN,GAAGhB,QADG;AAENE,MAAAA;AAFM,KAAP;AAIA;;AACD,SAAOF,QAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport {\n\theader as headerIcon,\n\tfooter as footerIcon,\n\tsidebar as sidebarIcon,\n\tlayout as layoutIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport fallbackVariations from './fallback-variations';\n\nfunction getTemplatePartIcon( iconName ) {\n\tif ( 'header' === iconName ) {\n\t\treturn headerIcon;\n\t} else if ( 'footer' === iconName ) {\n\t\treturn footerIcon;\n\t} else if ( 'sidebar' === iconName ) {\n\t\treturn sidebarIcon;\n\t}\n\treturn layoutIcon;\n}\n\nexport function enhanceTemplatePartVariations( settings, name ) {\n\tif ( name !== 'core/template-part' ) {\n\t\treturn settings;\n\t}\n\n\t// WordPress versions pre-5.8 do not support server side variation registration.\n\t// So we must register the fallback variations until those versions are no longer supported.\n\tif ( ! ( settings.variations && settings.variations.length ) ) {\n\t\treturn { ...settings, variations: fallbackVariations };\n\t}\n\n\tif ( settings.variations ) {\n\t\tconst isActive = ( blockAttributes, variationAttributes ) => {\n\t\t\tconst { area, theme, slug } = blockAttributes;\n\t\t\t// We first check the `area` block attribute which is set during insertion.\n\t\t\t// This property is removed on the creation of a template part.\n\t\t\tif ( area ) return area === variationAttributes.area;\n\t\t\t// Find a matching variation from the created template part\n\t\t\t// by checking the entity's `area` property.\n\t\t\tif ( ! slug ) return false;\n\t\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t`${ theme }//${ slug }`\n\t\t\t);\n\t\t\treturn entity?.area === variationAttributes.area;\n\t\t};\n\n\t\tconst variations = settings.variations.map( ( variation ) => {\n\t\t\treturn {\n\t\t\t\t...variation,\n\t\t\t\t...( ! variation.isActive && { isActive } ),\n\t\t\t\t...( typeof variation.icon === 'string' && {\n\t\t\t\t\ticon: getTemplatePartIcon( variation.icon ),\n\t\t\t\t} ),\n\t\t\t};\n\t\t} );\n\n\t\treturn {\n\t\t\t...settings,\n\t\t\tvariations,\n\t\t};\n\t}\n\treturn settings;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/variations.js"],"names":["getTemplatePartIcon","iconName","headerIcon","footerIcon","sidebarIcon","symbolFilledIcon","enhanceTemplatePartVariations","settings","name","variations","length","fallbackVariations","isActive","blockAttributes","variationAttributes","area","theme","slug","entity","coreDataStore","getEntityRecord","map","variation","icon"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAUA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,SAASA,mBAAT,CAA8BC,QAA9B,EAAyC;AACxC,MAAK,aAAaA,QAAlB,EAA6B;AAC5B,WAAOC,aAAP;AACA,GAFD,MAEO,IAAK,aAAaD,QAAlB,EAA6B;AACnC,WAAOE,aAAP;AACA,GAFM,MAEA,IAAK,cAAcF,QAAnB,EAA8B;AACpC,WAAOG,cAAP;AACA;;AACD,SAAOC,mBAAP;AACA;;AAEM,SAASC,6BAAT,CAAwCC,QAAxC,EAAkDC,IAAlD,EAAyD;AAC/D,MAAKA,IAAI,KAAK,oBAAd,EAAqC;AACpC,WAAOD,QAAP;AACA,GAH8D,CAK/D;AACA;;;AACA,MAAK,EAAIA,QAAQ,CAACE,UAAT,IAAuBF,QAAQ,CAACE,UAAT,CAAoBC,MAA/C,CAAL,EAA+D;AAC9D,WAAO,EAAE,GAAGH,QAAL;AAAeE,MAAAA,UAAU,EAAEE;AAA3B,KAAP;AACA;;AAED,MAAKJ,QAAQ,CAACE,UAAd,EAA2B;AAC1B,UAAMG,QAAQ,GAAG,CAAEC,eAAF,EAAmBC,mBAAnB,KAA4C;AAC5D,YAAM;AAAEC,QAAAA,IAAF;AAAQC,QAAAA,KAAR;AAAeC,QAAAA;AAAf,UAAwBJ,eAA9B,CAD4D,CAE5D;AACA;;AACA,UAAKE,IAAL,EAAY,OAAOA,IAAI,KAAKD,mBAAmB,CAACC,IAApC,CAJgD,CAK5D;AACA;;AACA,UAAK,CAAEE,IAAP,EAAc,OAAO,KAAP;AACd,YAAMC,MAAM,GAAG,kBAAQC,eAAR,EAAwBC,eAAxB,CACd,UADc,EAEd,kBAFc,EAGb,GAAGJ,KAAO,KAAKC,IAAM,EAHR,CAAf;AAKA,aAAO,CAAAC,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEH,IAAR,MAAiBD,mBAAmB,CAACC,IAA5C;AACA,KAdD;;AAgBA,UAAMN,UAAU,GAAGF,QAAQ,CAACE,UAAT,CAAoBY,GAApB,CAA2BC,SAAF,IAAiB;AAC5D,aAAO,EACN,GAAGA,SADG;AAEN,YAAK,CAAEA,SAAS,CAACV,QAAZ,IAAwB;AAAEA,UAAAA;AAAF,SAA7B,CAFM;AAGN,YAAK,OAAOU,SAAS,CAACC,IAAjB,KAA0B,QAA1B,IAAsC;AAC1CA,UAAAA,IAAI,EAAEvB,mBAAmB,CAAEsB,SAAS,CAACC,IAAZ;AADiB,SAA3C;AAHM,OAAP;AAOA,KARkB,CAAnB;AAUA,WAAO,EACN,GAAGhB,QADG;AAENE,MAAAA;AAFM,KAAP;AAIA;;AACD,SAAOF,QAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport {\n\theader as headerIcon,\n\tfooter as footerIcon,\n\tsidebar as sidebarIcon,\n\tsymbolFilled as symbolFilledIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport fallbackVariations from './fallback-variations';\n\nfunction getTemplatePartIcon( iconName ) {\n\tif ( 'header' === iconName ) {\n\t\treturn headerIcon;\n\t} else if ( 'footer' === iconName ) {\n\t\treturn footerIcon;\n\t} else if ( 'sidebar' === iconName ) {\n\t\treturn sidebarIcon;\n\t}\n\treturn symbolFilledIcon;\n}\n\nexport function enhanceTemplatePartVariations( settings, name ) {\n\tif ( name !== 'core/template-part' ) {\n\t\treturn settings;\n\t}\n\n\t// WordPress versions pre-5.8 do not support server side variation registration.\n\t// So we must register the fallback variations until those versions are no longer supported.\n\tif ( ! ( settings.variations && settings.variations.length ) ) {\n\t\treturn { ...settings, variations: fallbackVariations };\n\t}\n\n\tif ( settings.variations ) {\n\t\tconst isActive = ( blockAttributes, variationAttributes ) => {\n\t\t\tconst { area, theme, slug } = blockAttributes;\n\t\t\t// We first check the `area` block attribute which is set during insertion.\n\t\t\t// This property is removed on the creation of a template part.\n\t\t\tif ( area ) return area === variationAttributes.area;\n\t\t\t// Find a matching variation from the created template part\n\t\t\t// by checking the entity's `area` property.\n\t\t\tif ( ! slug ) return false;\n\t\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t`${ theme }//${ slug }`\n\t\t\t);\n\t\t\treturn entity?.area === variationAttributes.area;\n\t\t};\n\n\t\tconst variations = settings.variations.map( ( variation ) => {\n\t\t\treturn {\n\t\t\t\t...variation,\n\t\t\t\t...( ! variation.isActive && { isActive } ),\n\t\t\t\t...( typeof variation.icon === 'string' && {\n\t\t\t\t\ticon: getTemplatePartIcon( variation.icon ),\n\t\t\t\t} ),\n\t\t\t};\n\t\t} );\n\n\t\treturn {\n\t\t\t...settings,\n\t\t\tvariations,\n\t\t};\n\t}\n\treturn settings;\n}\n"]}
@@ -47,6 +47,6 @@ function TermDescriptionEdit({
47
47
  }
48
48
  })), (0, _element.createElement)("div", blockProps, (0, _element.createElement)("div", {
49
49
  className: "wp-block-term-description__placeholder"
50
- }, (0, _element.createElement)("span", null, (0, _i18n.__)('Term description.')))));
50
+ }, (0, _element.createElement)("span", null, (0, _i18n.__)('Term Description')))));
51
51
  }
52
52
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/term-description/edit.js"],"names":["TermDescriptionEdit","attributes","setAttributes","mergedStyle","textAlign","blockProps","className","style","nextAlign"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAQe,SAASA,mBAAT,CAA8B;AAC5CC,EAAAA,UAD4C;AAE5CC,EAAAA,aAF4C;AAG5CC,EAAAA;AAH4C,CAA9B,EAIX;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAgBH,UAAtB;AACA,QAAMI,UAAU,GAAG,gCAAe;AACjCC,IAAAA,SAAS,EAAE,yBAAY;AACtB,OAAG,kBAAkBF,SAAW,EAAhC,GAAqCA;AADf,KAAZ,CADsB;AAIjCG,IAAAA,KAAK,EAAEJ;AAJ0B,GAAf,CAAnB;AAMA,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGC,SADT;AAEC,IAAA,QAAQ,EAAKI,SAAF,IAAiB;AAC3BN,MAAAA,aAAa,CAAE;AAAEE,QAAAA,SAAS,EAAEI;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,mCAAUH,UAAV,EACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,0CAAQ,cAAI,mBAAJ,CAAR,CADD,CADD,CATD,CADD;AAiBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tAlignmentControl,\n} from '@wordpress/block-editor';\n\nexport default function TermDescriptionEdit( {\n\tattributes,\n\tsetAttributes,\n\tmergedStyle,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\tstyle: mergedStyle,\n\t} );\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<div className=\"wp-block-term-description__placeholder\">\n\t\t\t\t\t<span>{ __( 'Term description.' ) }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/term-description/edit.js"],"names":["TermDescriptionEdit","attributes","setAttributes","mergedStyle","textAlign","blockProps","className","style","nextAlign"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAQe,SAASA,mBAAT,CAA8B;AAC5CC,EAAAA,UAD4C;AAE5CC,EAAAA,aAF4C;AAG5CC,EAAAA;AAH4C,CAA9B,EAIX;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAgBH,UAAtB;AACA,QAAMI,UAAU,GAAG,gCAAe;AACjCC,IAAAA,SAAS,EAAE,yBAAY;AACtB,OAAG,kBAAkBF,SAAW,EAAhC,GAAqCA;AADf,KAAZ,CADsB;AAIjCG,IAAAA,KAAK,EAAEJ;AAJ0B,GAAf,CAAnB;AAMA,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGC,SADT;AAEC,IAAA,QAAQ,EAAKI,SAAF,IAAiB;AAC3BN,MAAAA,aAAa,CAAE;AAAEE,QAAAA,SAAS,EAAEI;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,mCAAUH,UAAV,EACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,0CAAQ,cAAI,kBAAJ,CAAR,CADD,CADD,CATD,CADD;AAiBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tAlignmentControl,\n} from '@wordpress/block-editor';\n\nexport default function TermDescriptionEdit( {\n\tattributes,\n\tsetAttributes,\n\tmergedStyle,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\tstyle: mergedStyle,\n\t} );\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<div className=\"wp-block-term-description__placeholder\">\n\t\t\t\t\t<span>{ __( 'Term Description' ) }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
@@ -38,7 +38,10 @@ const metadata = {
38
38
  },
39
39
  typography: {
40
40
  fontSize: true,
41
- lineHeight: true
41
+ lineHeight: true,
42
+ __experimentalDefaultControls: {
43
+ fontSize: true
44
+ }
42
45
  }
43
46
  },
44
47
  editorStyle: "wp-block-term-description-editor"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/term-description/index.js"],"names":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,sBADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { termDescription as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/term-description/index.js"],"names":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,sBADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { termDescription as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n"]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _lodash = require("lodash");
9
+
10
+ /**
11
+ * External dependencies
12
+ */
13
+
14
+ /**
15
+ * Removed empty nodes from nested objects.
16
+ *
17
+ * @param {Object} object
18
+ * @return {Object} Object cleaned from empty nodes.
19
+ */
20
+ const cleanEmptyObject = object => {
21
+ if (!(0, _lodash.isObject)(object) || Array.isArray(object)) {
22
+ return object;
23
+ }
24
+
25
+ const cleanedNestedObjects = (0, _lodash.pickBy)((0, _lodash.mapValues)(object, cleanEmptyObject), _lodash.identity);
26
+ return (0, _lodash.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
27
+ };
28
+
29
+ var _default = cleanEmptyObject;
30
+ exports.default = _default;
31
+ //# sourceMappingURL=clean-empty-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/utils/clean-empty-object.js"],"names":["cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","identity","undefined"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,gBAAgB,GAAKC,MAAF,IAAc;AACtC,MAAK,CAAE,sBAAUA,MAAV,CAAF,IAAwBC,KAAK,CAACC,OAAN,CAAeF,MAAf,CAA7B,EAAuD;AACtD,WAAOA,MAAP;AACA;;AACD,QAAMG,oBAAoB,GAAG,oBAC5B,uBAAWH,MAAX,EAAmBD,gBAAnB,CAD4B,EAE5BK,gBAF4B,CAA7B;AAIA,SAAO,qBAASD,oBAAT,IAAkCE,SAAlC,GAA8CF,oBAArD;AACA,CATD;;eAWeJ,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, isObject, identity, mapValues, pickBy } from 'lodash';\n\n/**\n * Removed empty nodes from nested objects.\n *\n * @param {Object} object\n * @return {Object} Object cleaned from empty nodes.\n */\nconst cleanEmptyObject = ( object ) => {\n\tif ( ! isObject( object ) || Array.isArray( object ) ) {\n\t\treturn object;\n\t}\n\tconst cleanedNestedObjects = pickBy(\n\t\tmapValues( object, cleanEmptyObject ),\n\t\tidentity\n\t);\n\treturn isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;\n};\n\nexport default cleanEmptyObject;\n"]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = _default;
9
+
10
+ var _lodash = require("lodash");
11
+
12
+ var _cleanEmptyObject = _interopRequireDefault(require("./clean-empty-object"));
13
+
14
+ /**
15
+ * External dependencies
16
+ */
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+
22
+ /**
23
+ * Migrates the current style.typography.fontFamily attribute,
24
+ * whose value was "var:preset|font-family|helvetica-arial",
25
+ * to the style.fontFamily attribute, whose value will be "helvetica-arial".
26
+ *
27
+ * @param {Object} attributes The current attributes
28
+ * @return {Object} The updated attributes.
29
+ */
30
+ function _default(attributes) {
31
+ var _attributes$style, _attributes$style$typ;
32
+
33
+ if (!(attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && (_attributes$style$typ = _attributes$style.typography) !== null && _attributes$style$typ !== void 0 && _attributes$style$typ.fontFamily)) {
34
+ return attributes;
35
+ } // Clone first so when we delete the fontFamily
36
+ // below we're not modifying the original
37
+ // attributes. Because the deprecation may be discarded
38
+ // we don't want to alter the original attributes.
39
+
40
+
41
+ const atts = (0, _lodash.cloneDeep)(attributes);
42
+ const fontFamily = atts.style.typography.fontFamily.split('|').pop();
43
+ delete atts.style.typography.fontFamily;
44
+ atts.style = (0, _cleanEmptyObject.default)(atts.style);
45
+ return { ...atts,
46
+ fontFamily
47
+ };
48
+ }
49
+ //# sourceMappingURL=migrate-font-family.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/utils/migrate-font-family.js"],"names":["attributes","style","typography","fontFamily","atts","split","pop"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,kBAAWA,UAAX,EAAwB;AAAA;;AACtC,MAAK,EAAEA,UAAF,aAAEA,UAAF,oCAAEA,UAAU,CAAEC,KAAd,uEAAE,kBAAmBC,UAArB,kDAAE,sBAA+BC,UAAjC,CAAL,EAAmD;AAClD,WAAOH,UAAP;AACA,GAHqC,CAKtC;AACA;AACA;AACA;;;AACA,QAAMI,IAAI,GAAG,uBAAWJ,UAAX,CAAb;AACA,QAAMG,UAAU,GAAGC,IAAI,CAACH,KAAL,CAAWC,UAAX,CAAsBC,UAAtB,CAAiCE,KAAjC,CAAwC,GAAxC,EAA8CC,GAA9C,EAAnB;AACA,SAAOF,IAAI,CAACH,KAAL,CAAWC,UAAX,CAAsBC,UAA7B;AACAC,EAAAA,IAAI,CAACH,KAAL,GAAa,+BAAkBG,IAAI,CAACH,KAAvB,CAAb;AAEA,SAAO,EACN,GAAGG,IADG;AAEND,IAAAA;AAFM,GAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { cloneDeep } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport cleanEmptyObject from './clean-empty-object';\n\n/**\n * Migrates the current style.typography.fontFamily attribute,\n * whose value was \"var:preset|font-family|helvetica-arial\",\n * to the style.fontFamily attribute, whose value will be \"helvetica-arial\".\n *\n * @param {Object} attributes The current attributes\n * @return {Object} The updated attributes.\n */\nexport default function ( attributes ) {\n\tif ( ! attributes?.style?.typography?.fontFamily ) {\n\t\treturn attributes;\n\t}\n\n\t// Clone first so when we delete the fontFamily\n\t// below we're not modifying the original\n\t// attributes. Because the deprecation may be discarded\n\t// we don't want to alter the original attributes.\n\tconst atts = cloneDeep( attributes );\n\tconst fontFamily = atts.style.typography.fontFamily.split( '|' ).pop();\n\tdelete atts.style.typography.fontFamily;\n\tatts.style = cleanEmptyObject( atts.style );\n\n\treturn {\n\t\t...atts,\n\t\tfontFamily,\n\t};\n}\n"]}
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -7,24 +9,35 @@ exports.default = void 0;
7
9
 
8
10
  var _element = require("@wordpress/element");
9
11
 
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
10
14
  var _blockEditor = require("@wordpress/block-editor");
11
15
 
16
+ var _migrateFontFamily = _interopRequireDefault(require("../utils/migrate-font-family"));
17
+
18
+ /**
19
+ * External dependencies
20
+ */
21
+
12
22
  /**
13
23
  * WordPress dependencies
14
24
  */
15
- const blockAttributes = {
16
- content: {
17
- type: 'string',
18
- source: 'html',
19
- selector: 'pre',
20
- default: ''
25
+
26
+ /**
27
+ * Internal dependencies
28
+ */
29
+ const v1 = {
30
+ attributes: {
31
+ content: {
32
+ type: 'string',
33
+ source: 'html',
34
+ selector: 'pre',
35
+ default: ''
36
+ },
37
+ textAlign: {
38
+ type: 'string'
39
+ }
21
40
  },
22
- textAlign: {
23
- type: 'string'
24
- }
25
- };
26
- const deprecated = [{
27
- attributes: blockAttributes,
28
41
 
29
42
  save({
30
43
  attributes
@@ -42,7 +55,73 @@ const deprecated = [{
42
55
  });
43
56
  }
44
57
 
45
- }];
46
- var _default = deprecated;
58
+ };
59
+ const v2 = {
60
+ attributes: {
61
+ content: {
62
+ type: 'string',
63
+ source: 'html',
64
+ selector: 'pre',
65
+ default: '',
66
+ __unstablePreserveWhiteSpace: true,
67
+ __experimentalRole: 'content'
68
+ },
69
+ textAlign: {
70
+ type: 'string'
71
+ }
72
+ },
73
+ supports: {
74
+ anchor: true,
75
+ color: {
76
+ gradients: true,
77
+ link: true
78
+ },
79
+ typography: {
80
+ fontSize: true,
81
+ __experimentalFontFamily: true
82
+ },
83
+ spacing: {
84
+ padding: true
85
+ }
86
+ },
87
+
88
+ save({
89
+ attributes
90
+ }) {
91
+ const {
92
+ textAlign,
93
+ content
94
+ } = attributes;
95
+ const className = (0, _classnames.default)({
96
+ [`has-text-align-${textAlign}`]: textAlign
97
+ });
98
+ return (0, _element.createElement)("pre", _blockEditor.useBlockProps.save({
99
+ className
100
+ }), (0, _element.createElement)(_blockEditor.RichText.Content, {
101
+ value: content
102
+ }));
103
+ },
104
+
105
+ migrate: _migrateFontFamily.default,
106
+
107
+ isEligible({
108
+ style
109
+ }) {
110
+ var _style$typography;
111
+
112
+ return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
113
+ }
114
+
115
+ };
116
+ /**
117
+ * New deprecations need to be placed first
118
+ * for them to have higher priority.
119
+ *
120
+ * Old deprecations may need to be updated as well.
121
+ *
122
+ * See block-deprecation.md
123
+ */
124
+
125
+ var _default = [v2, v1];
47
126
  exports.default = _default;
48
127
  //# sourceMappingURL=deprecated.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/verse/deprecated.js"],"names":["blockAttributes","content","type","source","selector","default","textAlign","deprecated","attributes","save"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,eAAe,GAAG;AACvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,IAAI,EAAE,QADE;AAERC,IAAAA,MAAM,EAAE,MAFA;AAGRC,IAAAA,QAAQ,EAAE,KAHF;AAIRC,IAAAA,OAAO,EAAE;AAJD,GADc;AAOvBC,EAAAA,SAAS,EAAE;AACVJ,IAAAA,IAAI,EAAE;AADI;AAPY,CAAxB;AAYA,MAAMK,UAAU,GAAG,CAClB;AACCC,EAAAA,UAAU,EAAER,eADb;;AAECS,EAAAA,IAAI,CAAE;AAAED,IAAAA;AAAF,GAAF,EAAmB;AACtB,UAAM;AAAEF,MAAAA,SAAF;AAAaL,MAAAA;AAAb,QAAyBO,UAA/B;AAEA,WACC,4BAAC,qBAAD,CAAU,OAAV;AACC,MAAA,OAAO,EAAC,KADT;AAEC,MAAA,KAAK,EAAG;AAAEF,QAAAA;AAAF,OAFT;AAGC,MAAA,KAAK,EAAGL;AAHT,MADD;AAOA;;AAZF,CADkB,CAAnB;eAiBeM,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichText } from '@wordpress/block-editor';\n\nconst blockAttributes = {\n\tcontent: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'pre',\n\t\tdefault: '',\n\t},\n\ttextAlign: {\n\t\ttype: 'string',\n\t},\n};\n\nconst deprecated = [\n\t{\n\t\tattributes: blockAttributes,\n\t\tsave( { attributes } ) {\n\t\t\tconst { textAlign, content } = attributes;\n\n\t\t\treturn (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"pre\"\n\t\t\t\t\tstyle={ { textAlign } }\n\t\t\t\t\tvalue={ content }\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/verse/deprecated.js"],"names":["v1","attributes","content","type","source","selector","default","textAlign","save","v2","__unstablePreserveWhiteSpace","__experimentalRole","supports","anchor","color","gradients","link","typography","fontSize","__experimentalFontFamily","spacing","padding","className","useBlockProps","migrate","migrateFontFamily","isEligible","style","fontFamily"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,EAAE,GAAG;AACVC,EAAAA,UAAU,EAAE;AACXC,IAAAA,OAAO,EAAE;AACRC,MAAAA,IAAI,EAAE,QADE;AAERC,MAAAA,MAAM,EAAE,MAFA;AAGRC,MAAAA,QAAQ,EAAE,KAHF;AAIRC,MAAAA,OAAO,EAAE;AAJD,KADE;AAOXC,IAAAA,SAAS,EAAE;AACVJ,MAAAA,IAAI,EAAE;AADI;AAPA,GADF;;AAYVK,EAAAA,IAAI,CAAE;AAAEP,IAAAA;AAAF,GAAF,EAAmB;AACtB,UAAM;AAAEM,MAAAA,SAAF;AAAaL,MAAAA;AAAb,QAAyBD,UAA/B;AAEA,WACC,4BAAC,qBAAD,CAAU,OAAV;AACC,MAAA,OAAO,EAAC,KADT;AAEC,MAAA,KAAK,EAAG;AAAEM,QAAAA;AAAF,OAFT;AAGC,MAAA,KAAK,EAAGL;AAHT,MADD;AAOA;;AAtBS,CAAX;AAyBA,MAAMO,EAAE,GAAG;AACVR,EAAAA,UAAU,EAAE;AACXC,IAAAA,OAAO,EAAE;AACRC,MAAAA,IAAI,EAAE,QADE;AAERC,MAAAA,MAAM,EAAE,MAFA;AAGRC,MAAAA,QAAQ,EAAE,KAHF;AAIRC,MAAAA,OAAO,EAAE,EAJD;AAKRI,MAAAA,4BAA4B,EAAE,IALtB;AAMRC,MAAAA,kBAAkB,EAAE;AANZ,KADE;AASXJ,IAAAA,SAAS,EAAE;AACVJ,MAAAA,IAAI,EAAE;AADI;AATA,GADF;AAcVS,EAAAA,QAAQ,EAAE;AACTC,IAAAA,MAAM,EAAE,IADC;AAETC,IAAAA,KAAK,EAAE;AACNC,MAAAA,SAAS,EAAE,IADL;AAENC,MAAAA,IAAI,EAAE;AAFA,KAFE;AAMTC,IAAAA,UAAU,EAAE;AACXC,MAAAA,QAAQ,EAAE,IADC;AAEXC,MAAAA,wBAAwB,EAAE;AAFf,KANH;AAUTC,IAAAA,OAAO,EAAE;AACRC,MAAAA,OAAO,EAAE;AADD;AAVA,GAdA;;AA4BVb,EAAAA,IAAI,CAAE;AAAEP,IAAAA;AAAF,GAAF,EAAmB;AACtB,UAAM;AAAEM,MAAAA,SAAF;AAAaL,MAAAA;AAAb,QAAyBD,UAA/B;AAEA,UAAMqB,SAAS,GAAG,yBAAY;AAC7B,OAAG,kBAAkBf,SAAW,EAAhC,GAAqCA;AADR,KAAZ,CAAlB;AAIA,WACC,mCAAUgB,2BAAcf,IAAd,CAAoB;AAAEc,MAAAA;AAAF,KAApB,CAAV,EACC,4BAAC,qBAAD,CAAU,OAAV;AAAkB,MAAA,KAAK,EAAGpB;AAA1B,MADD,CADD;AAKA,GAxCS;;AAyCVsB,EAAAA,OAAO,EAAEC,0BAzCC;;AA0CVC,EAAAA,UAAU,CAAE;AAAEC,IAAAA;AAAF,GAAF,EAAc;AAAA;;AACvB,WAAOA,KAAP,aAAOA,KAAP,4CAAOA,KAAK,CAAEV,UAAd,sDAAO,kBAAmBW,UAA1B;AACA;;AA5CS,CAAX;AA+CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;eACe,CAAEnB,EAAF,EAAMT,EAAN,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport migrateFontFamily from '../utils/migrate-font-family';\n\nconst v1 = {\n\tattributes: {\n\t\tcontent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'pre',\n\t\t\tdefault: '',\n\t\t},\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { textAlign, content } = attributes;\n\n\t\treturn (\n\t\t\t<RichText.Content\n\t\t\t\ttagName=\"pre\"\n\t\t\t\tstyle={ { textAlign } }\n\t\t\t\tvalue={ content }\n\t\t\t/>\n\t\t);\n\t},\n};\n\nconst v2 = {\n\tattributes: {\n\t\tcontent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'pre',\n\t\t\tdefault: '',\n\t\t\t__unstablePreserveWhiteSpace: true,\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t},\n\t\tspacing: {\n\t\t\tpadding: true,\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { textAlign, content } = attributes;\n\n\t\tconst className = classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} );\n\n\t\treturn (\n\t\t\t<pre { ...useBlockProps.save( { className } ) }>\n\t\t\t\t<RichText.Content value={ content } />\n\t\t\t</pre>\n\t\t);\n\t},\n\tmigrate: migrateFontFamily,\n\tisEligible( { style } ) {\n\t\treturn style?.typography?.fontFamily;\n\t},\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v2, v1 ];\n"]}
@@ -55,7 +55,16 @@ const metadata = {
55
55
  },
56
56
  typography: {
57
57
  fontSize: true,
58
- __experimentalFontFamily: true
58
+ __experimentalFontFamily: true,
59
+ lineHeight: true,
60
+ __experimentalFontStyle: true,
61
+ __experimentalFontWeight: true,
62
+ __experimentalLetterSpacing: true,
63
+ __experimentalTextTransform: true,
64
+ __experimentalDefaultControls: {
65
+ fontSize: true,
66
+ fontAppearance: true
67
+ }
59
68
  },
60
69
  spacing: {
61
70
  padding: true
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/verse/index.js"],"names":["name","metadata","settings","icon","example","attributes","content","transforms","deprecated","merge","attributesToMerge","edit","save"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACX;AACA;AACAC,MAAAA,OAAO,EAAE,cACR,yOADQ;AAGT;;AANW;AADJ,GAFc;AAYvBC,EAAAA,UAAU,EAAVA,mBAZuB;AAavBC,EAAAA,UAAU,EAAVA,mBAbuB;;AAcvBC,EAAAA,KAAK,CAAEJ,UAAF,EAAcK,iBAAd,EAAkC;AACtC,WAAO;AACNJ,MAAAA,OAAO,EAAED,UAAU,CAACC,OAAX,GAAqBI,iBAAiB,CAACJ;AAD1C,KAAP;AAGA,GAlBsB;;AAmBvBK,EAAAA,IAAI,EAAJA,aAnBuB;AAoBvBC,EAAAA,IAAI,EAAJA;AApBuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { verse as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\t/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */\n\t\t\t// translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.\n\t\t\tcontent: __(\n\t\t\t\t'WHAT was he doing, the great god Pan,\\n\tDown in the reeds by the river?\\nSpreading ruin and scattering ban,\\nSplashing and paddling with hoofs of a goat,\\nAnd breaking the golden lilies afloat\\n With the dragon-fly on the river.'\n\t\t\t),\n\t\t\t/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent: attributes.content + attributesToMerge.content,\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/verse/index.js"],"names":["name","metadata","settings","icon","example","attributes","content","transforms","deprecated","merge","attributesToMerge","edit","save"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACX;AACA;AACAC,MAAAA,OAAO,EAAE,cACR,yOADQ;AAGT;;AANW;AADJ,GAFc;AAYvBC,EAAAA,UAAU,EAAVA,mBAZuB;AAavBC,EAAAA,UAAU,EAAVA,mBAbuB;;AAcvBC,EAAAA,KAAK,CAAEJ,UAAF,EAAcK,iBAAd,EAAkC;AACtC,WAAO;AACNJ,MAAAA,OAAO,EAAED,UAAU,CAACC,OAAX,GAAqBI,iBAAiB,CAACJ;AAD1C,KAAP;AAGA,GAlBsB;;AAmBvBK,EAAAA,IAAI,EAAJA,aAnBuB;AAoBvBC,EAAAA,IAAI,EAAJA;AApBuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { verse as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\t/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */\n\t\t\t// translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.\n\t\t\tcontent: __(\n\t\t\t\t'WHAT was he doing, the great god Pan,\\n\tDown in the reeds by the river?\\nSpreading ruin and scattering ban,\\nSplashing and paddling with hoofs of a goat,\\nAnd breaking the golden lilies afloat\\n With the dragon-fly on the river.'\n\t\t\t),\n\t\t\t/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent: attributes.content + attributesToMerge.content,\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n"]}
@@ -7,7 +7,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
7
7
  import { useEntityBlockEditor, useEntityProp, store as coreStore } from '@wordpress/core-data';
8
8
  import { Placeholder, Spinner, ToolbarGroup, ToolbarButton, TextControl, PanelBody } from '@wordpress/components';
9
9
  import { __ } from '@wordpress/i18n';
10
- import { __experimentalUseInnerBlocksProps as useInnerBlocksProps, __experimentalUseNoRecursiveRenders as useNoRecursiveRenders, __experimentalBlockContentOverlay as BlockContentOverlay, InnerBlocks, BlockControls, InspectorControls, useBlockProps, Warning } from '@wordpress/block-editor';
10
+ import { useInnerBlocksProps, __experimentalUseNoRecursiveRenders as useNoRecursiveRenders, __experimentalBlockContentOverlay as BlockContentOverlay, InnerBlocks, BlockControls, InspectorControls, useBlockProps, Warning } from '@wordpress/block-editor';
11
11
  import { store as reusableBlocksStore } from '@wordpress/reusable-blocks';
12
12
  import { ungroup } from '@wordpress/icons';
13
13
  export default function ReusableBlockEdit({