@wordpress/block-library 8.2.0 → 8.3.1

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 (797) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/babel-plugin.js +1 -1
  3. package/build/archives/index.js +1 -0
  4. package/build/archives/index.js.map +1 -1
  5. package/build/avatar/index.js +1 -0
  6. package/build/avatar/index.js.map +1 -1
  7. package/build/block/edit.js +1 -0
  8. package/build/block/edit.js.map +1 -1
  9. package/build/button/edit.js +2 -1
  10. package/build/button/edit.js.map +1 -1
  11. package/build/button/index.js +1 -0
  12. package/build/button/index.js.map +1 -1
  13. package/build/buttons/edit.js +0 -2
  14. package/build/buttons/edit.js.map +1 -1
  15. package/build/calendar/index.js +1 -0
  16. package/build/calendar/index.js.map +1 -1
  17. package/build/categories/edit.js +3 -3
  18. package/build/categories/edit.js.map +1 -1
  19. package/build/categories/index.js +1 -0
  20. package/build/categories/index.js.map +1 -1
  21. package/build/column/edit.native.js +2 -1
  22. package/build/column/edit.native.js.map +1 -1
  23. package/build/columns/deprecated.js +1 -1
  24. package/build/columns/deprecated.js.map +1 -1
  25. package/build/comment-author-avatar/index.js +1 -0
  26. package/build/comment-author-avatar/index.js.map +1 -1
  27. package/build/comment-author-name/index.js +1 -0
  28. package/build/comment-author-name/index.js.map +1 -1
  29. package/build/comment-content/index.js +1 -0
  30. package/build/comment-content/index.js.map +1 -1
  31. package/build/comment-date/index.js +1 -0
  32. package/build/comment-date/index.js.map +1 -1
  33. package/build/comment-edit-link/index.js +1 -0
  34. package/build/comment-edit-link/index.js.map +1 -1
  35. package/build/comment-reply-link/index.js +1 -0
  36. package/build/comment-reply-link/index.js.map +1 -1
  37. package/build/comment-template/index.js +1 -0
  38. package/build/comment-template/index.js.map +1 -1
  39. package/build/comments/edit/comments-inspector-controls.js +1 -1
  40. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  41. package/build/comments/index.js +2 -1
  42. package/build/comments/index.js.map +1 -1
  43. package/build/comments-pagination/comments-pagination-arrow-controls.js +1 -0
  44. package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
  45. package/build/comments-pagination/edit.js +3 -14
  46. package/build/comments-pagination/edit.js.map +1 -1
  47. package/build/comments-pagination/index.js +1 -0
  48. package/build/comments-pagination/index.js.map +1 -1
  49. package/build/comments-pagination-next/index.js +1 -0
  50. package/build/comments-pagination-next/index.js.map +1 -1
  51. package/build/comments-pagination-numbers/index.js +1 -0
  52. package/build/comments-pagination-numbers/index.js.map +1 -1
  53. package/build/comments-pagination-previous/index.js +1 -0
  54. package/build/comments-pagination-previous/index.js.map +1 -1
  55. package/build/cover/deprecated.js +153 -30
  56. package/build/cover/deprecated.js.map +1 -1
  57. package/build/cover/edit/index.js +4 -3
  58. package/build/cover/edit/index.js.map +1 -1
  59. package/build/cover/edit/inspector-controls.js +45 -4
  60. package/build/cover/edit/inspector-controls.js.map +1 -1
  61. package/build/cover/edit.native.js +0 -4
  62. package/build/cover/edit.native.js.map +1 -1
  63. package/build/cover/index.js +4 -0
  64. package/build/cover/index.js.map +1 -1
  65. package/build/cover/save.js +3 -2
  66. package/build/cover/save.js.map +1 -1
  67. package/build/embed/variations.js +1 -1
  68. package/build/embed/variations.js.map +1 -1
  69. package/build/experiments.js +19 -0
  70. package/build/experiments.js.map +1 -0
  71. package/build/gallery/deprecated.js +6 -4
  72. package/build/gallery/deprecated.js.map +1 -1
  73. package/build/gallery/edit.js +48 -7
  74. package/build/gallery/edit.js.map +1 -1
  75. package/build/gallery/gallery.js +8 -34
  76. package/build/gallery/gallery.js.map +1 -1
  77. package/build/gallery/v1/edit.js +5 -5
  78. package/build/gallery/v1/edit.js.map +1 -1
  79. package/build/group/deprecated.js +1 -1
  80. package/build/group/deprecated.js.map +1 -1
  81. package/build/group/edit.js +1 -2
  82. package/build/group/edit.js.map +1 -1
  83. package/build/heading/index.js +1 -7
  84. package/build/heading/index.js.map +1 -1
  85. package/build/home-link/index.js +1 -0
  86. package/build/home-link/index.js.map +1 -1
  87. package/build/image/edit.native.js +2 -2
  88. package/build/image/edit.native.js.map +1 -1
  89. package/build/image/image.js +12 -15
  90. package/build/image/image.js.map +1 -1
  91. package/build/latest-comments/index.js +1 -0
  92. package/build/latest-comments/index.js.map +1 -1
  93. package/build/latest-posts/deprecated.js +1 -0
  94. package/build/latest-posts/deprecated.js.map +1 -1
  95. package/build/latest-posts/index.js +1 -0
  96. package/build/latest-posts/index.js.map +1 -1
  97. package/build/list/ordered-list-settings.js +1 -0
  98. package/build/list/ordered-list-settings.js.map +1 -1
  99. package/build/loginout/index.js +1 -0
  100. package/build/loginout/index.js.map +1 -1
  101. package/build/media-text/edit.js +2 -4
  102. package/build/media-text/edit.js.map +1 -1
  103. package/build/missing/edit.native.js +4 -4
  104. package/build/missing/edit.native.js.map +1 -1
  105. package/build/navigation/edit/deleted-navigation-warning.js +31 -0
  106. package/build/navigation/edit/deleted-navigation-warning.js.map +1 -0
  107. package/build/navigation/edit/index.js +19 -11
  108. package/build/navigation/edit/index.js.map +1 -1
  109. package/build/navigation/edit/inner-blocks.js +0 -5
  110. package/build/navigation/edit/inner-blocks.js.map +1 -1
  111. package/build/navigation/edit/manage-menus-button.js +9 -2
  112. package/build/navigation/edit/manage-menus-button.js.map +1 -1
  113. package/build/navigation/edit/menu-inspector-controls.js +39 -48
  114. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  115. package/build/navigation/edit/navigation-menu-delete-control.js +0 -1
  116. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  117. package/build/navigation/edit/navigation-menu-name-control.js +1 -0
  118. package/build/navigation/edit/navigation-menu-name-control.js.map +1 -1
  119. package/build/navigation/edit/navigation-menu-selector.js +11 -52
  120. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  121. package/build/navigation/edit/overlay-menu-preview.js +1 -0
  122. package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
  123. package/build/navigation/edit/placeholder/index.js +1 -6
  124. package/build/navigation/edit/placeholder/index.js.map +1 -1
  125. package/build/navigation/index.js +5 -0
  126. package/build/navigation/index.js.map +1 -1
  127. package/build/navigation/menu-items-to-blocks.js +0 -2
  128. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  129. package/build/navigation-link/edit.js +17 -8
  130. package/build/navigation-link/edit.js.map +1 -1
  131. package/build/navigation-submenu/edit.js +4 -0
  132. package/build/navigation-submenu/edit.js.map +1 -1
  133. package/build/navigation-submenu/index.js +13 -3
  134. package/build/navigation-submenu/index.js.map +1 -1
  135. package/build/page-list/edit.js +153 -132
  136. package/build/page-list/edit.js.map +1 -1
  137. package/build/page-list/index.js +2 -11
  138. package/build/page-list/index.js.map +1 -1
  139. package/build/page-list/{convert-to-navigation-links.js → use-convert-to-navigation-links.js} +41 -9
  140. package/build/page-list/use-convert-to-navigation-links.js.map +1 -0
  141. package/build/page-list-item/edit.js +4 -2
  142. package/build/page-list-item/edit.js.map +1 -1
  143. package/build/page-list-item/index.js +1 -1
  144. package/build/page-list-item/index.js.map +1 -1
  145. package/build/paragraph/edit.js +1 -1
  146. package/build/paragraph/edit.js.map +1 -1
  147. package/build/paragraph/index.js +1 -7
  148. package/build/paragraph/index.js.map +1 -1
  149. package/build/post-author/index.js +1 -0
  150. package/build/post-author/index.js.map +1 -1
  151. package/build/post-author-biography/index.js +1 -0
  152. package/build/post-author-biography/index.js.map +1 -1
  153. package/build/post-author-name/index.js +1 -1
  154. package/build/post-comment/edit.js +1 -0
  155. package/build/post-comment/edit.js.map +1 -1
  156. package/build/post-comments-count/index.js +1 -0
  157. package/build/post-comments-count/index.js.map +1 -1
  158. package/build/post-comments-form/index.js +1 -0
  159. package/build/post-comments-form/index.js.map +1 -1
  160. package/build/post-comments-link/index.js +1 -0
  161. package/build/post-comments-link/index.js.map +1 -1
  162. package/build/post-content/edit.js +1 -20
  163. package/build/post-content/edit.js.map +1 -1
  164. package/build/post-content/index.js +1 -0
  165. package/build/post-content/index.js.map +1 -1
  166. package/build/post-date/index.js +1 -0
  167. package/build/post-date/index.js.map +1 -1
  168. package/build/post-excerpt/edit.js +6 -1
  169. package/build/post-excerpt/edit.js.map +1 -1
  170. package/build/post-excerpt/index.js +1 -0
  171. package/build/post-excerpt/index.js.map +1 -1
  172. package/build/post-featured-image/dimension-controls.js +2 -1
  173. package/build/post-featured-image/dimension-controls.js.map +1 -1
  174. package/build/post-featured-image/edit.js +39 -22
  175. package/build/post-featured-image/edit.js.map +1 -1
  176. package/build/post-featured-image/index.js +1 -0
  177. package/build/post-featured-image/index.js.map +1 -1
  178. package/build/post-featured-image/overlay.js +1 -1
  179. package/build/post-featured-image/overlay.js.map +1 -1
  180. package/build/post-navigation-link/edit.js +1 -0
  181. package/build/post-navigation-link/edit.js.map +1 -1
  182. package/build/post-navigation-link/index.js +1 -0
  183. package/build/post-navigation-link/index.js.map +1 -1
  184. package/build/post-template/edit.js +6 -4
  185. package/build/post-template/edit.js.map +1 -1
  186. package/build/post-template/index.js +1 -0
  187. package/build/post-template/index.js.map +1 -1
  188. package/build/post-terms/edit.js +5 -4
  189. package/build/post-terms/edit.js.map +1 -1
  190. package/build/post-terms/index.js +1 -0
  191. package/build/post-terms/index.js.map +1 -1
  192. package/build/post-title/edit.js +1 -0
  193. package/build/post-title/edit.js.map +1 -1
  194. package/build/post-title/index.js +1 -0
  195. package/build/post-title/index.js.map +1 -1
  196. package/build/query/deprecated.js +90 -1
  197. package/build/query/deprecated.js.map +1 -1
  198. package/build/query/edit/index.js +2 -50
  199. package/build/query/edit/index.js.map +1 -1
  200. package/build/query/edit/inspector-controls/index.js +1 -0
  201. package/build/query/edit/inspector-controls/index.js.map +1 -1
  202. package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -2
  203. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  204. package/build/query/edit/pattern-selection-modal.js +88 -0
  205. package/build/query/edit/pattern-selection-modal.js.map +1 -0
  206. package/build/query/edit/query-content.js +3 -24
  207. package/build/query/edit/query-content.js.map +1 -1
  208. package/build/query/edit/query-placeholder.js +2 -2
  209. package/build/query/edit/query-placeholder.js.map +1 -1
  210. package/build/query/edit/query-toolbar.js +6 -11
  211. package/build/query/edit/query-toolbar.js.map +1 -1
  212. package/build/query/index.js +1 -0
  213. package/build/query/index.js.map +1 -1
  214. package/build/query/utils.js +25 -3
  215. package/build/query/utils.js.map +1 -1
  216. package/build/query-no-results/index.js +1 -0
  217. package/build/query-no-results/index.js.map +1 -1
  218. package/build/query-pagination/edit.js +3 -14
  219. package/build/query-pagination/edit.js.map +1 -1
  220. package/build/query-pagination/index.js +1 -0
  221. package/build/query-pagination/index.js.map +1 -1
  222. package/build/query-pagination/query-pagination-arrow-controls.js +1 -0
  223. package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
  224. package/build/query-pagination-next/index.js +1 -0
  225. package/build/query-pagination-next/index.js.map +1 -1
  226. package/build/query-pagination-numbers/index.js +1 -0
  227. package/build/query-pagination-numbers/index.js.map +1 -1
  228. package/build/query-pagination-previous/index.js +1 -0
  229. package/build/query-pagination-previous/index.js.map +1 -1
  230. package/build/query-title/index.js +1 -0
  231. package/build/query-title/index.js.map +1 -1
  232. package/build/read-more/index.js +1 -0
  233. package/build/read-more/index.js.map +1 -1
  234. package/build/rss/edit.js +5 -2
  235. package/build/rss/edit.js.map +1 -1
  236. package/build/rss/index.js +1 -0
  237. package/build/rss/index.js.map +1 -1
  238. package/build/search/index.js +1 -0
  239. package/build/search/index.js.map +1 -1
  240. package/build/site-logo/edit.js +9 -13
  241. package/build/site-logo/edit.js.map +1 -1
  242. package/build/site-logo/index.js +1 -0
  243. package/build/site-logo/index.js.map +1 -1
  244. package/build/site-tagline/index.js +1 -0
  245. package/build/site-tagline/index.js.map +1 -1
  246. package/build/site-title/index.js +1 -0
  247. package/build/site-title/index.js.map +1 -1
  248. package/build/social-link/edit.js +3 -1
  249. package/build/social-link/edit.js.map +1 -1
  250. package/build/social-link/index.js +1 -0
  251. package/build/social-link/index.js.map +1 -1
  252. package/build/social-links/edit.js +3 -14
  253. package/build/social-links/edit.js.map +1 -1
  254. package/build/table/edit.js +9 -5
  255. package/build/table/edit.js.map +1 -1
  256. package/build/table/index.js +15 -0
  257. package/build/table/index.js.map +1 -1
  258. package/build/table/save.js +4 -2
  259. package/build/table/save.js.map +1 -1
  260. package/build/table/state.js +1 -1
  261. package/build/table/state.js.map +1 -1
  262. package/build/table/transforms.js +47 -3
  263. package/build/table/transforms.js.map +1 -1
  264. package/build/table/utils.js +26 -0
  265. package/build/table/utils.js.map +1 -0
  266. package/build/tag-cloud/edit.js +3 -9
  267. package/build/tag-cloud/edit.js.map +1 -1
  268. package/build/tag-cloud/index.js +1 -0
  269. package/build/tag-cloud/index.js.map +1 -1
  270. package/build/template-part/edit/advanced-controls.js +2 -1
  271. package/build/template-part/edit/advanced-controls.js.map +1 -1
  272. package/build/template-part/edit/index.js +0 -1
  273. package/build/template-part/edit/index.js.map +1 -1
  274. package/build/template-part/edit/selection-modal.js +3 -3
  275. package/build/template-part/edit/selection-modal.js.map +1 -1
  276. package/build/template-part/edit/title-modal.js +6 -5
  277. package/build/template-part/edit/title-modal.js.map +1 -1
  278. package/build/template-part/edit/utils/hooks.js +2 -2
  279. package/build/template-part/edit/utils/hooks.js.map +1 -1
  280. package/build/template-part/index.js +1 -0
  281. package/build/template-part/index.js.map +1 -1
  282. package/build/term-description/index.js +1 -0
  283. package/build/term-description/index.js.map +1 -1
  284. package/build/utils/init-block.js +1 -1
  285. package/build/utils/init-block.js.map +1 -1
  286. package/build/utils/init-block.native.js +1 -1
  287. package/build/utils/init-block.native.js.map +1 -1
  288. package/build/{template-part/edit/utils/search.js → utils/search-patterns.js} +3 -1
  289. package/build/utils/search-patterns.js.map +1 -0
  290. package/build/video/tracks-editor.js +17 -11
  291. package/build/video/tracks-editor.js.map +1 -1
  292. package/build-module/archives/index.js +1 -0
  293. package/build-module/archives/index.js.map +1 -1
  294. package/build-module/avatar/index.js +1 -0
  295. package/build-module/avatar/index.js.map +1 -1
  296. package/build-module/block/edit.js +1 -0
  297. package/build-module/block/edit.js.map +1 -1
  298. package/build-module/button/edit.js +2 -1
  299. package/build-module/button/edit.js.map +1 -1
  300. package/build-module/button/index.js +1 -0
  301. package/build-module/button/index.js.map +1 -1
  302. package/build-module/buttons/edit.js +0 -2
  303. package/build-module/buttons/edit.js.map +1 -1
  304. package/build-module/calendar/index.js +1 -0
  305. package/build-module/calendar/index.js.map +1 -1
  306. package/build-module/categories/edit.js +2 -2
  307. package/build-module/categories/edit.js.map +1 -1
  308. package/build-module/categories/index.js +1 -0
  309. package/build-module/categories/index.js.map +1 -1
  310. package/build-module/column/edit.native.js +2 -1
  311. package/build-module/column/edit.native.js.map +1 -1
  312. package/build-module/columns/deprecated.js +1 -1
  313. package/build-module/columns/deprecated.js.map +1 -1
  314. package/build-module/comment-author-avatar/index.js +1 -0
  315. package/build-module/comment-author-avatar/index.js.map +1 -1
  316. package/build-module/comment-author-name/index.js +1 -0
  317. package/build-module/comment-author-name/index.js.map +1 -1
  318. package/build-module/comment-content/index.js +1 -0
  319. package/build-module/comment-content/index.js.map +1 -1
  320. package/build-module/comment-date/index.js +1 -0
  321. package/build-module/comment-date/index.js.map +1 -1
  322. package/build-module/comment-edit-link/index.js +1 -0
  323. package/build-module/comment-edit-link/index.js.map +1 -1
  324. package/build-module/comment-reply-link/index.js +1 -0
  325. package/build-module/comment-reply-link/index.js.map +1 -1
  326. package/build-module/comment-template/index.js +1 -0
  327. package/build-module/comment-template/index.js.map +1 -1
  328. package/build-module/comments/edit/comments-inspector-controls.js +1 -1
  329. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  330. package/build-module/comments/index.js +2 -1
  331. package/build-module/comments/index.js.map +1 -1
  332. package/build-module/comments-pagination/comments-pagination-arrow-controls.js +1 -0
  333. package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
  334. package/build-module/comments-pagination/edit.js +3 -14
  335. package/build-module/comments-pagination/edit.js.map +1 -1
  336. package/build-module/comments-pagination/index.js +1 -0
  337. package/build-module/comments-pagination/index.js.map +1 -1
  338. package/build-module/comments-pagination-next/index.js +1 -0
  339. package/build-module/comments-pagination-next/index.js.map +1 -1
  340. package/build-module/comments-pagination-numbers/index.js +1 -0
  341. package/build-module/comments-pagination-numbers/index.js.map +1 -1
  342. package/build-module/comments-pagination-previous/index.js +1 -0
  343. package/build-module/comments-pagination-previous/index.js.map +1 -1
  344. package/build-module/cover/deprecated.js +155 -31
  345. package/build-module/cover/deprecated.js.map +1 -1
  346. package/build-module/cover/edit/index.js +4 -3
  347. package/build-module/cover/edit/index.js.map +1 -1
  348. package/build-module/cover/edit/inspector-controls.js +46 -5
  349. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  350. package/build-module/cover/edit.native.js +0 -4
  351. package/build-module/cover/edit.native.js.map +1 -1
  352. package/build-module/cover/index.js +4 -0
  353. package/build-module/cover/index.js.map +1 -1
  354. package/build-module/cover/save.js +3 -2
  355. package/build-module/cover/save.js.map +1 -1
  356. package/build-module/embed/variations.js +1 -1
  357. package/build-module/embed/variations.js.map +1 -1
  358. package/build-module/experiments.js +9 -0
  359. package/build-module/experiments.js.map +1 -0
  360. package/build-module/gallery/deprecated.js +6 -3
  361. package/build-module/gallery/deprecated.js.map +1 -1
  362. package/build-module/gallery/edit.js +50 -10
  363. package/build-module/gallery/edit.js.map +1 -1
  364. package/build-module/gallery/gallery.js +9 -35
  365. package/build-module/gallery/gallery.js.map +1 -1
  366. package/build-module/gallery/v1/edit.js +6 -6
  367. package/build-module/gallery/v1/edit.js.map +1 -1
  368. package/build-module/group/deprecated.js +1 -1
  369. package/build-module/group/deprecated.js.map +1 -1
  370. package/build-module/group/edit.js +1 -2
  371. package/build-module/group/edit.js.map +1 -1
  372. package/build-module/heading/index.js +1 -6
  373. package/build-module/heading/index.js.map +1 -1
  374. package/build-module/home-link/index.js +1 -0
  375. package/build-module/home-link/index.js.map +1 -1
  376. package/build-module/image/edit.native.js +2 -2
  377. package/build-module/image/edit.native.js.map +1 -1
  378. package/build-module/image/image.js +14 -17
  379. package/build-module/image/image.js.map +1 -1
  380. package/build-module/latest-comments/index.js +1 -0
  381. package/build-module/latest-comments/index.js.map +1 -1
  382. package/build-module/latest-posts/deprecated.js +1 -0
  383. package/build-module/latest-posts/deprecated.js.map +1 -1
  384. package/build-module/latest-posts/index.js +1 -0
  385. package/build-module/latest-posts/index.js.map +1 -1
  386. package/build-module/list/ordered-list-settings.js +1 -0
  387. package/build-module/list/ordered-list-settings.js.map +1 -1
  388. package/build-module/loginout/index.js +1 -0
  389. package/build-module/loginout/index.js.map +1 -1
  390. package/build-module/media-text/edit.js +2 -3
  391. package/build-module/media-text/edit.js.map +1 -1
  392. package/build-module/missing/edit.native.js +4 -4
  393. package/build-module/missing/edit.native.js.map +1 -1
  394. package/build-module/navigation/edit/deleted-navigation-warning.js +21 -0
  395. package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -0
  396. package/build-module/navigation/edit/index.js +18 -11
  397. package/build-module/navigation/edit/index.js.map +1 -1
  398. package/build-module/navigation/edit/inner-blocks.js +0 -5
  399. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  400. package/build-module/navigation/edit/manage-menus-button.js +10 -3
  401. package/build-module/navigation/edit/manage-menus-button.js.map +1 -1
  402. package/build-module/navigation/edit/menu-inspector-controls.js +38 -49
  403. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  404. package/build-module/navigation/edit/navigation-menu-delete-control.js +0 -1
  405. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  406. package/build-module/navigation/edit/navigation-menu-name-control.js +1 -0
  407. package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -1
  408. package/build-module/navigation/edit/navigation-menu-selector.js +13 -54
  409. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  410. package/build-module/navigation/edit/overlay-menu-preview.js +1 -0
  411. package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
  412. package/build-module/navigation/edit/placeholder/index.js +1 -6
  413. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  414. package/build-module/navigation/index.js +5 -0
  415. package/build-module/navigation/index.js.map +1 -1
  416. package/build-module/navigation/menu-items-to-blocks.js +0 -2
  417. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  418. package/build-module/navigation-link/edit.js +16 -7
  419. package/build-module/navigation-link/edit.js.map +1 -1
  420. package/build-module/navigation-submenu/edit.js +4 -0
  421. package/build-module/navigation-submenu/edit.js.map +1 -1
  422. package/build-module/navigation-submenu/index.js +14 -4
  423. package/build-module/navigation-submenu/index.js.map +1 -1
  424. package/build-module/page-list/edit.js +155 -132
  425. package/build-module/page-list/edit.js.map +1 -1
  426. package/build-module/page-list/index.js +3 -12
  427. package/build-module/page-list/index.js.map +1 -1
  428. package/build-module/page-list/{convert-to-navigation-links.js → use-convert-to-navigation-links.js} +37 -7
  429. package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -0
  430. package/build-module/page-list-item/edit.js +3 -2
  431. package/build-module/page-list-item/edit.js.map +1 -1
  432. package/build-module/page-list-item/index.js +1 -1
  433. package/build-module/page-list-item/index.js.map +1 -1
  434. package/build-module/paragraph/edit.js +1 -1
  435. package/build-module/paragraph/edit.js.map +1 -1
  436. package/build-module/paragraph/index.js +1 -6
  437. package/build-module/paragraph/index.js.map +1 -1
  438. package/build-module/post-author/index.js +1 -0
  439. package/build-module/post-author/index.js.map +1 -1
  440. package/build-module/post-author-biography/index.js +1 -0
  441. package/build-module/post-author-biography/index.js.map +1 -1
  442. package/build-module/post-author-name/index.js +1 -1
  443. package/build-module/post-comment/edit.js +1 -0
  444. package/build-module/post-comment/edit.js.map +1 -1
  445. package/build-module/post-comments-count/index.js +1 -0
  446. package/build-module/post-comments-count/index.js.map +1 -1
  447. package/build-module/post-comments-form/index.js +1 -0
  448. package/build-module/post-comments-form/index.js.map +1 -1
  449. package/build-module/post-comments-link/index.js +1 -0
  450. package/build-module/post-comments-link/index.js.map +1 -1
  451. package/build-module/post-content/edit.js +2 -20
  452. package/build-module/post-content/edit.js.map +1 -1
  453. package/build-module/post-content/index.js +1 -0
  454. package/build-module/post-content/index.js.map +1 -1
  455. package/build-module/post-date/index.js +1 -0
  456. package/build-module/post-date/index.js.map +1 -1
  457. package/build-module/post-excerpt/edit.js +6 -1
  458. package/build-module/post-excerpt/edit.js.map +1 -1
  459. package/build-module/post-excerpt/index.js +1 -0
  460. package/build-module/post-excerpt/index.js.map +1 -1
  461. package/build-module/post-featured-image/dimension-controls.js +2 -1
  462. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  463. package/build-module/post-featured-image/edit.js +39 -22
  464. package/build-module/post-featured-image/edit.js.map +1 -1
  465. package/build-module/post-featured-image/index.js +1 -0
  466. package/build-module/post-featured-image/index.js.map +1 -1
  467. package/build-module/post-featured-image/overlay.js +1 -1
  468. package/build-module/post-featured-image/overlay.js.map +1 -1
  469. package/build-module/post-navigation-link/edit.js +1 -0
  470. package/build-module/post-navigation-link/edit.js.map +1 -1
  471. package/build-module/post-navigation-link/index.js +1 -0
  472. package/build-module/post-navigation-link/index.js.map +1 -1
  473. package/build-module/post-template/edit.js +6 -4
  474. package/build-module/post-template/edit.js.map +1 -1
  475. package/build-module/post-template/index.js +1 -0
  476. package/build-module/post-template/index.js.map +1 -1
  477. package/build-module/post-terms/edit.js +4 -3
  478. package/build-module/post-terms/edit.js.map +1 -1
  479. package/build-module/post-terms/index.js +1 -0
  480. package/build-module/post-terms/index.js.map +1 -1
  481. package/build-module/post-title/edit.js +1 -0
  482. package/build-module/post-title/edit.js.map +1 -1
  483. package/build-module/post-title/index.js +1 -0
  484. package/build-module/post-title/index.js.map +1 -1
  485. package/build-module/query/deprecated.js +87 -1
  486. package/build-module/query/deprecated.js.map +1 -1
  487. package/build-module/query/edit/index.js +4 -50
  488. package/build-module/query/edit/index.js.map +1 -1
  489. package/build-module/query/edit/inspector-controls/index.js +1 -0
  490. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  491. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -2
  492. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  493. package/build-module/query/edit/pattern-selection-modal.js +75 -0
  494. package/build-module/query/edit/pattern-selection-modal.js.map +1 -0
  495. package/build-module/query/edit/query-content.js +4 -25
  496. package/build-module/query/edit/query-content.js.map +1 -1
  497. package/build-module/query/edit/query-placeholder.js +2 -2
  498. package/build-module/query/edit/query-placeholder.js.map +1 -1
  499. package/build-module/query/edit/query-toolbar.js +6 -10
  500. package/build-module/query/edit/query-toolbar.js.map +1 -1
  501. package/build-module/query/index.js +1 -0
  502. package/build-module/query/index.js.map +1 -1
  503. package/build-module/query/utils.js +21 -2
  504. package/build-module/query/utils.js.map +1 -1
  505. package/build-module/query-no-results/index.js +1 -0
  506. package/build-module/query-no-results/index.js.map +1 -1
  507. package/build-module/query-pagination/edit.js +3 -14
  508. package/build-module/query-pagination/edit.js.map +1 -1
  509. package/build-module/query-pagination/index.js +1 -0
  510. package/build-module/query-pagination/index.js.map +1 -1
  511. package/build-module/query-pagination/query-pagination-arrow-controls.js +1 -0
  512. package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
  513. package/build-module/query-pagination-next/index.js +1 -0
  514. package/build-module/query-pagination-next/index.js.map +1 -1
  515. package/build-module/query-pagination-numbers/index.js +1 -0
  516. package/build-module/query-pagination-numbers/index.js.map +1 -1
  517. package/build-module/query-pagination-previous/index.js +1 -0
  518. package/build-module/query-pagination-previous/index.js.map +1 -1
  519. package/build-module/query-title/index.js +1 -0
  520. package/build-module/query-title/index.js.map +1 -1
  521. package/build-module/read-more/index.js +1 -0
  522. package/build-module/read-more/index.js.map +1 -1
  523. package/build-module/rss/edit.js +6 -3
  524. package/build-module/rss/edit.js.map +1 -1
  525. package/build-module/rss/index.js +1 -0
  526. package/build-module/rss/index.js.map +1 -1
  527. package/build-module/search/index.js +1 -0
  528. package/build-module/search/index.js.map +1 -1
  529. package/build-module/site-logo/edit.js +10 -14
  530. package/build-module/site-logo/edit.js.map +1 -1
  531. package/build-module/site-logo/index.js +1 -0
  532. package/build-module/site-logo/index.js.map +1 -1
  533. package/build-module/site-tagline/index.js +1 -0
  534. package/build-module/site-tagline/index.js.map +1 -1
  535. package/build-module/site-title/index.js +1 -0
  536. package/build-module/site-title/index.js.map +1 -1
  537. package/build-module/social-link/edit.js +3 -1
  538. package/build-module/social-link/edit.js.map +1 -1
  539. package/build-module/social-link/index.js +1 -0
  540. package/build-module/social-link/index.js.map +1 -1
  541. package/build-module/social-links/edit.js +3 -14
  542. package/build-module/social-links/edit.js.map +1 -1
  543. package/build-module/table/edit.js +9 -5
  544. package/build-module/table/edit.js.map +1 -1
  545. package/build-module/table/index.js +15 -0
  546. package/build-module/table/index.js.map +1 -1
  547. package/build-module/table/save.js +4 -2
  548. package/build-module/table/save.js.map +1 -1
  549. package/build-module/table/state.js +1 -1
  550. package/build-module/table/state.js.map +1 -1
  551. package/build-module/table/transforms.js +46 -3
  552. package/build-module/table/transforms.js.map +1 -1
  553. package/build-module/table/utils.js +19 -0
  554. package/build-module/table/utils.js.map +1 -0
  555. package/build-module/tag-cloud/edit.js +4 -9
  556. package/build-module/tag-cloud/edit.js.map +1 -1
  557. package/build-module/tag-cloud/index.js +1 -0
  558. package/build-module/tag-cloud/index.js.map +1 -1
  559. package/build-module/template-part/edit/advanced-controls.js +2 -1
  560. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  561. package/build-module/template-part/edit/index.js +0 -1
  562. package/build-module/template-part/edit/index.js.map +1 -1
  563. package/build-module/template-part/edit/selection-modal.js +1 -1
  564. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  565. package/build-module/template-part/edit/title-modal.js +7 -6
  566. package/build-module/template-part/edit/title-modal.js.map +1 -1
  567. package/build-module/template-part/edit/utils/hooks.js +2 -2
  568. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  569. package/build-module/template-part/index.js +1 -0
  570. package/build-module/template-part/index.js.map +1 -1
  571. package/build-module/term-description/index.js +1 -0
  572. package/build-module/term-description/index.js.map +1 -1
  573. package/build-module/utils/init-block.js +1 -1
  574. package/build-module/utils/init-block.js.map +1 -1
  575. package/build-module/utils/init-block.native.js +1 -1
  576. package/build-module/utils/init-block.native.js.map +1 -1
  577. package/build-module/{template-part/edit/utils/search.js → utils/search-patterns.js} +3 -5
  578. package/build-module/utils/search-patterns.js.map +1 -0
  579. package/build-module/video/tracks-editor.js +18 -12
  580. package/build-module/video/tracks-editor.js.map +1 -1
  581. package/build-style/common-rtl.css +14 -0
  582. package/build-style/common.css +14 -0
  583. package/build-style/editor-rtl.css +14 -67
  584. package/build-style/editor.css +14 -67
  585. package/build-style/post-excerpt/style-rtl.css +15 -0
  586. package/build-style/post-excerpt/style.css +15 -0
  587. package/build-style/query/editor-rtl.css +11 -14
  588. package/build-style/query/editor.css +11 -14
  589. package/build-style/rss/editor-rtl.css +3 -16
  590. package/build-style/rss/editor.css +3 -16
  591. package/build-style/style-rtl.css +29 -0
  592. package/build-style/style.css +29 -0
  593. package/build-style/table/editor-rtl.css +0 -3
  594. package/build-style/table/editor.css +0 -3
  595. package/build-style/video/editor-rtl.css +0 -34
  596. package/build-style/video/editor.css +0 -34
  597. package/package.json +30 -29
  598. package/src/archives/block.json +1 -0
  599. package/src/avatar/block.json +1 -0
  600. package/src/block/edit.js +1 -0
  601. package/src/button/block.json +1 -0
  602. package/src/button/edit.js +2 -1
  603. package/src/buttons/edit.js +2 -2
  604. package/src/calendar/block.json +1 -0
  605. package/src/calendar/index.php +4 -2
  606. package/src/categories/block.json +1 -0
  607. package/src/categories/edit.js +2 -2
  608. package/src/column/edit.native.js +6 -1
  609. package/src/columns/deprecated.js +1 -1
  610. package/src/comment-author-avatar/block.json +1 -0
  611. package/src/comment-author-name/block.json +1 -0
  612. package/src/comment-author-name/index.php +6 -3
  613. package/src/comment-content/block.json +1 -0
  614. package/src/comment-content/index.php +6 -3
  615. package/src/comment-date/block.json +1 -0
  616. package/src/comment-date/index.php +1 -1
  617. package/src/comment-edit-link/block.json +1 -0
  618. package/src/comment-edit-link/index.php +6 -3
  619. package/src/comment-reply-link/block.json +1 -0
  620. package/src/comment-reply-link/index.php +6 -3
  621. package/src/comment-template/block.json +1 -0
  622. package/src/comments/block.json +2 -1
  623. package/src/comments/edit/comments-inspector-controls.js +1 -1
  624. package/src/comments-pagination/block.json +1 -0
  625. package/src/comments-pagination/comments-pagination-arrow-controls.js +1 -0
  626. package/src/comments-pagination/edit.js +1 -13
  627. package/src/comments-pagination/index.php +4 -1
  628. package/src/comments-pagination-next/block.json +1 -0
  629. package/src/comments-pagination-numbers/block.json +1 -0
  630. package/src/comments-pagination-previous/block.json +1 -0
  631. package/src/common.scss +19 -0
  632. package/src/cover/block.json +4 -0
  633. package/src/cover/deprecated.js +173 -6
  634. package/src/cover/edit/index.js +5 -4
  635. package/src/cover/edit/inspector-controls.js +45 -2
  636. package/src/cover/edit.native.js +0 -3
  637. package/src/cover/save.js +3 -2
  638. package/src/embed/variations.js +1 -1
  639. package/src/experiments.js +10 -0
  640. package/src/gallery/deprecated.js +2 -3
  641. package/src/gallery/edit.js +66 -5
  642. package/src/gallery/gallery.js +27 -44
  643. package/src/gallery/index.php +1 -1
  644. package/src/gallery/v1/edit.js +8 -9
  645. package/src/group/deprecated.js +3 -1
  646. package/src/group/edit.js +1 -2
  647. package/src/heading/index.js +1 -6
  648. package/src/home-link/block.json +1 -0
  649. package/src/image/edit.native.js +2 -3
  650. package/src/image/image.js +17 -22
  651. package/src/latest-comments/block.json +1 -0
  652. package/src/latest-posts/block.json +1 -0
  653. package/src/latest-posts/index.php +9 -10
  654. package/src/list/ordered-list-settings.js +1 -0
  655. package/src/loginout/block.json +1 -0
  656. package/src/media-text/edit.js +3 -7
  657. package/src/missing/edit.native.js +3 -4
  658. package/src/missing/test/edit.native.js +2 -2
  659. package/src/navigation/block.json +2 -0
  660. package/src/navigation/edit/deleted-navigation-warning.js +19 -0
  661. package/src/navigation/edit/index.js +22 -24
  662. package/src/navigation/edit/inner-blocks.js +0 -6
  663. package/src/navigation/edit/manage-menus-button.js +24 -13
  664. package/src/navigation/edit/menu-inspector-controls.js +51 -74
  665. package/src/navigation/edit/navigation-menu-delete-control.js +0 -1
  666. package/src/navigation/edit/navigation-menu-name-control.js +1 -0
  667. package/src/navigation/edit/navigation-menu-selector.js +12 -77
  668. package/src/navigation/edit/overlay-menu-preview.js +1 -0
  669. package/src/navigation/edit/placeholder/index.js +0 -6
  670. package/src/navigation/index.js +3 -0
  671. package/src/navigation/index.php +27 -9
  672. package/src/navigation/menu-items-to-blocks.js +0 -2
  673. package/src/navigation-link/edit.js +16 -7
  674. package/src/navigation-link/index.php +2 -34
  675. package/src/navigation-submenu/edit.js +4 -0
  676. package/src/navigation-submenu/index.js +8 -2
  677. package/src/navigation-submenu/index.php +2 -34
  678. package/src/page-list/block.json +1 -0
  679. package/src/page-list/edit.js +196 -161
  680. package/src/page-list/index.js +2 -8
  681. package/src/page-list/test/convert-to-links-modal.js +1 -1
  682. package/src/page-list/{convert-to-navigation-links.js → use-convert-to-navigation-links.js} +36 -6
  683. package/src/page-list-item/edit.js +3 -2
  684. package/src/page-list-item/index.js +1 -1
  685. package/src/paragraph/edit.js +1 -1
  686. package/src/paragraph/index.js +1 -6
  687. package/src/post-author/block.json +1 -0
  688. package/src/post-author/index.php +10 -4
  689. package/src/post-author-biography/block.json +1 -0
  690. package/src/post-author-name/block.json +1 -1
  691. package/src/post-author-name/index.php +9 -4
  692. package/src/post-comment/edit.js +1 -0
  693. package/src/post-comments-count/block.json +1 -0
  694. package/src/post-comments-form/block.json +1 -0
  695. package/src/post-comments-form/index.php +6 -4
  696. package/src/post-comments-link/block.json +1 -0
  697. package/src/post-comments-link/index.php +8 -2
  698. package/src/post-content/block.json +1 -0
  699. package/src/post-content/edit.js +2 -13
  700. package/src/post-date/block.json +1 -0
  701. package/src/post-date/index.php +10 -3
  702. package/src/post-excerpt/block.json +1 -0
  703. package/src/post-excerpt/edit.js +22 -12
  704. package/src/post-excerpt/index.php +6 -3
  705. package/src/post-excerpt/style.scss +18 -0
  706. package/src/post-featured-image/block.json +1 -0
  707. package/src/post-featured-image/dimension-controls.js +2 -1
  708. package/src/post-featured-image/edit.js +46 -27
  709. package/src/post-featured-image/index.php +19 -6
  710. package/src/post-featured-image/overlay.js +1 -1
  711. package/src/post-navigation-link/block.json +1 -0
  712. package/src/post-navigation-link/edit.js +1 -0
  713. package/src/post-template/block.json +1 -0
  714. package/src/post-template/edit.js +4 -3
  715. package/src/post-template/index.php +4 -1
  716. package/src/post-terms/block.json +1 -0
  717. package/src/post-terms/edit.js +4 -3
  718. package/src/post-terms/index.php +6 -3
  719. package/src/post-title/block.json +1 -0
  720. package/src/post-title/edit.js +1 -0
  721. package/src/post-title/index.php +10 -4
  722. package/src/preformatted/test/__snapshots__/edit.native.js.snap +0 -2
  723. package/src/query/block.json +1 -0
  724. package/src/query/deprecated.js +77 -1
  725. package/src/query/edit/index.js +4 -60
  726. package/src/query/edit/inspector-controls/index.js +1 -0
  727. package/src/query/edit/inspector-controls/taxonomy-controls.js +2 -2
  728. package/src/query/edit/pattern-selection-modal.js +86 -0
  729. package/src/query/edit/query-content.js +1 -12
  730. package/src/query/edit/query-placeholder.js +4 -8
  731. package/src/query/edit/query-toolbar.js +6 -16
  732. package/src/query/editor.scss +21 -19
  733. package/src/query/utils.js +22 -8
  734. package/src/query-no-results/block.json +1 -0
  735. package/src/query-no-results/index.php +3 -1
  736. package/src/query-pagination/block.json +1 -0
  737. package/src/query-pagination/edit.js +1 -13
  738. package/src/query-pagination/index.php +2 -0
  739. package/src/query-pagination/query-pagination-arrow-controls.js +1 -0
  740. package/src/query-pagination-next/block.json +1 -0
  741. package/src/query-pagination-numbers/block.json +1 -0
  742. package/src/query-pagination-previous/block.json +1 -0
  743. package/src/query-title/block.json +1 -0
  744. package/src/read-more/block.json +1 -0
  745. package/src/rss/block.json +1 -0
  746. package/src/rss/edit.js +16 -12
  747. package/src/rss/editor.scss +4 -15
  748. package/src/search/block.json +1 -0
  749. package/src/search/index.php +2 -2
  750. package/src/site-logo/block.json +1 -0
  751. package/src/site-logo/edit.js +9 -16
  752. package/src/site-tagline/block.json +1 -0
  753. package/src/site-title/block.json +1 -0
  754. package/src/site-title/index.php +6 -3
  755. package/src/social-link/block.json +1 -0
  756. package/src/social-link/edit.js +3 -1
  757. package/src/social-links/edit.js +1 -14
  758. package/src/table/block.json +15 -0
  759. package/src/table/edit.js +38 -26
  760. package/src/table/editor.scss +0 -6
  761. package/src/table/save.js +9 -1
  762. package/src/table/state.js +1 -1
  763. package/src/table/test/utils.js +20 -0
  764. package/src/table/transforms.js +65 -2
  765. package/src/table/utils.js +18 -0
  766. package/src/tag-cloud/block.json +1 -0
  767. package/src/tag-cloud/edit.js +12 -15
  768. package/src/template-part/block.json +1 -0
  769. package/src/template-part/edit/advanced-controls.js +2 -1
  770. package/src/template-part/edit/index.js +0 -1
  771. package/src/template-part/edit/selection-modal.js +1 -1
  772. package/src/template-part/edit/title-modal.js +12 -15
  773. package/src/template-part/edit/utils/hooks.js +3 -8
  774. package/src/template-part/index.php +19 -7
  775. package/src/term-description/block.json +1 -0
  776. package/src/term-description/index.php +8 -4
  777. package/src/utils/init-block.js +1 -1
  778. package/src/utils/init-block.native.js +1 -1
  779. package/src/{template-part/edit/utils/search.js → utils/search-patterns.js} +2 -2
  780. package/src/utils/test/search-patterns.js +58 -0
  781. package/src/video/editor.scss +0 -35
  782. package/src/video/tracks-editor.js +65 -51
  783. package/tsconfig.tsbuildinfo +1 -1
  784. package/build/page-list/constants.js +0 -15
  785. package/build/page-list/constants.js.map +0 -1
  786. package/build/page-list/convert-to-links-modal.js +0 -83
  787. package/build/page-list/convert-to-links-modal.js.map +0 -1
  788. package/build/page-list/convert-to-navigation-links.js.map +0 -1
  789. package/build/template-part/edit/utils/search.js.map +0 -1
  790. package/build-module/page-list/constants.js +0 -6
  791. package/build-module/page-list/constants.js.map +0 -1
  792. package/build-module/page-list/convert-to-links-modal.js +0 -68
  793. package/build-module/page-list/convert-to-links-modal.js.map +0 -1
  794. package/build-module/page-list/convert-to-navigation-links.js.map +0 -1
  795. package/build-module/template-part/edit/utils/search.js.map +0 -1
  796. package/src/page-list/constants.js +0 -8
  797. package/src/page-list/convert-to-links-modal.js +0 -70
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"names":["DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","layout","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","instanceId","themeSupportsLayout","select","getSettings","supportsLayout","defaultLayout","usedLayout","type","blockProps","innerBlocksProps","template","__experimentalLayout","undefined","postsPerPage","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","section","aside","label","value"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AAQA;;AACA;;AAKA;;AACA;;AArBA;AACA;AACA;;AAeA;AACA;AACA;AAIA,MAAMA,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAF,CAAF,CAAjB;;AACe,SAASC,YAAT,OAMX;AAAA,MANkC;AACrCC,IAAAA,UADqC;AAErCC,IAAAA,aAFqC;AAGrCC,IAAAA,yBAHqC;AAIrCC,IAAAA,IAJqC;AAKrCC,IAAAA;AALqC,GAMlC;AACH,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,aAHK;AAILC,IAAAA,OAAO,EAAEC,OAAO,GAAG,KAJd;AAKLC,IAAAA,MAAM,GAAG;AALJ,MAMFV,UANJ;AAOA,QAAM;AAAEW,IAAAA;AAAF,MACL,uBAAaC,kBAAb,CADD;AAEA,QAAMC,UAAU,GAAG,4BAAed,YAAf,CAAnB;AACA,QAAM;AAAEe,IAAAA;AAAF,MAA0B,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AAAmB,IAAA,mBAAmB,EAAC;AAAvC,KACC,4BAAC,yBAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAG,cAAI,cAAJ,CAFT;AAGC,IAAA,OAAO,EAAG,CACT;AAAEuC,MAAAA,KAAK,EAAE,cAAI,iBAAJ,CAAT;AAAkCC,MAAAA,KAAK,EAAE;AAAzC,KADS,EAET;AAAED,MAAAA,KAAK,EAAE,QAAT;AAAmBC,MAAAA,KAAK,EAAE;AAA1B,KAFS,EAGT;AAAED,MAAAA,KAAK,EAAE,WAAT;AAAsBC,MAAAA,KAAK,EAAE;AAA7B,KAHS,EAIT;AAAED,MAAAA,KAAK,EAAE,SAAT;AAAoBC,MAAAA,KAAK,EAAE;AAA3B,KAJS,CAHX;AASC,IAAA,KAAK,EAAGjC,OATT;AAUC,IAAA,QAAQ,EAAKiC,KAAF,IACVzC,aAAa,CAAE;AAAEO,MAAAA,OAAO,EAAEkC;AAAX,KAAF,CAXf;AAaC,IAAA,IAAI,EAAGL,mBAAmB,CAAE5B,OAAF;AAb3B,IADD,CAhBD,EAiCC,4BAAC,OAAD,EAAca,gBAAd,CAjCD,CADD;AAqCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport QueryToolbar from './query-toolbar';\nimport QueryInspectorControls from './inspector-controls';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\ttagName: TagName = 'div',\n\t\tlayout = {},\n\t} = attributes;\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn { themeSupportsLayout: getSettings()?.supportsLayout };\n\t}, [] );\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = ! layout?.type\n\t\t? { ...defaultLayout, ...layout, type: 'default' }\n\t\t: { ...defaultLayout, ...layout };\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\t__experimentalLayout: themeSupportsLayout ? usedLayout : undefined,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tpostsPerPage:\n\t\t\t\t+getSettings().postsPerPage || DEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\tif ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [ query.perPage ] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [ queryId, instanceId ] );\n\tconst updateQuery = ( newQuery ) =>\n\t\tsetAttributes( { query: { ...query, ...newQuery } } );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\tconst htmlElementMessages = {\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\treturn (\n\t\t<>\n\t\t\t<QueryInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t/>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\t\topenPatternSelectionModal={ openPatternSelectionModal }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls __experimentalGroup=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"names":["DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","instanceId","blockProps","innerBlocksProps","template","postsPerPage","select","getSettings","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","section","aside","label","value"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AAOA;;AACA;;AAKA;;AACA;;AApBA;AACA;AACA;;AAcA;AACA;AACA;AAIA,MAAMA,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAF,CAAF,CAAjB;;AACe,SAASC,YAAT,OAMX;AAAA,MANkC;AACrCC,IAAAA,UADqC;AAErCC,IAAAA,aAFqC;AAGrCC,IAAAA,yBAHqC;AAIrCC,IAAAA,IAJqC;AAKrCC,IAAAA;AALqC,GAMlC;AACH,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,aAHK;AAILC,IAAAA,OAAO,EAAEC,OAAO,GAAG;AAJd,MAKFT,UALJ;AAMA,QAAM;AAAEU,IAAAA;AAAF,MACL,uBAAaC,kBAAb,CADD;AAEA,QAAMC,UAAU,GAAG,4BAAeb,YAAf,CAAnB;AACA,QAAMc,UAAU,GAAG,iCAAnB;AACA,QAAMC,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,QAAQ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B,IADD,CAhBD,EAiCC,4BAAC,OAAD,EAAcK,gBAAd,CAjCD,CADD;AAqCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport QueryToolbar from './query-toolbar';\nimport QueryInspectorControls from './inspector-controls';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\ttagName: TagName = 'div',\n\t} = attributes;\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tpostsPerPage:\n\t\t\t\t+getSettings().postsPerPage || DEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\tif ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [ query.perPage ] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [ queryId, instanceId ] );\n\tconst updateQuery = ( newQuery ) =>\n\t\tsetAttributes( { query: { ...query, ...newQuery } } );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\tconst htmlElementMessages = {\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\treturn (\n\t\t<>\n\t\t\t<QueryInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t/>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\t\topenPatternSelectionModal={ openPatternSelectionModal }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
@@ -49,13 +49,13 @@ function QueryPlaceholder(_ref) {
49
49
  } = select(_blocks.store);
50
50
  const {
51
51
  getBlockRootClientId,
52
- __experimentalGetPatternsByBlockTypes
52
+ getPatternsByBlockTypes
53
53
  } = select(_blockEditor.store);
54
54
  const rootClientId = getBlockRootClientId(clientId);
55
55
  return {
56
56
  blockType: getBlockType(name),
57
57
  allVariations: getBlockVariations(name),
58
- hasPatterns: !!__experimentalGetPatternsByBlockTypes(name, rootClientId).length
58
+ hasPatterns: !!getPatternsByBlockTypes(name, rootClientId).length
59
59
  };
60
60
  }, [name, clientId]);
61
61
  const matchingVariation = (0, _blockEditor.__experimentalGetMatchingVariation)(attributes, allVariations);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query/edit/query-placeholder.js"],"names":["QueryPlaceholder","attributes","clientId","name","openPatternSelectionModal","setAttributes","isStartingBlank","setIsStartingBlank","blockProps","blockType","allVariations","hasPatterns","select","getBlockVariations","getBlockType","blocksStore","getBlockRootClientId","__experimentalGetPatternsByBlockTypes","blockEditorStore","rootClientId","length","matchingVariation","icon","src","label","title","QueryVariationPicker","scopeVariations","replaceInnerBlocks","variation","query","postType","namespace","inner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G,iCAAnB;AACA,SACC,mCAAUA,UAAV,EACC,4BAAC,+CAAD;AACC,IAAA,IAAI,EAAGc,IADR;AAEC,IAAA,KAAK,EAAGE,KAFT;AAGC,IAAA,UAAU,EAAGG,eAHd;AAIC,IAAA,QAAQ,EAAKE,SAAF,IAAiB;AAC3B,UAAKA,SAAS,CAAC5B,UAAf,EAA4B;AAC3BI,QAAAA,aAAa,CAAE,EACd,GAAGwB,SAAS,CAAC5B,UADC;AAEd6B,UAAAA,KAAK,EAAE,EACN,GAAGD,SAAS,CAAC5B,UAAV,CAAqB6B,KADlB;AAENC,YAAAA,QAAQ,EACP9B,UAAU,CAAC6B,KAAX,CAAiBC,QAAjB,IACAF,SAAS,CAAC5B,UAAV,CAAqB6B,KAArB,CAA2BC;AAJtB,WAFO;AAQdC,UAAAA,SAAS,EAAE/B,UAAU,CAAC+B;AARR,SAAF,CAAb;AAUA;;AACD,UAAKH,SAAS,CAACI,WAAf,EAA6B;AAC5BL,QAAAA,kBAAkB,CACjB1B,QADiB,EAEjB,iDACC2B,SAAS,CAACI,WADX,CAFiB,EAKjB,KALiB,CAAlB;AAOA;AACD;AA1BF,IADD,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tcreateBlocksFromInnerBlocksTemplate,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useState } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalBlockVariationPicker,\n\t__experimentalGetMatchingVariation as getMatchingVariation,\n} from '@wordpress/block-editor';\nimport { Button, Placeholder } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useScopedBlockVariations } from '../utils';\n\nexport default function QueryPlaceholder( {\n\tattributes,\n\tclientId,\n\tname,\n\topenPatternSelectionModal,\n\tsetAttributes,\n} ) {\n\tconst [ isStartingBlank, setIsStartingBlank ] = useState( false );\n\tconst blockProps = useBlockProps();\n\n\tconst { blockType, allVariations, hasPatterns } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockVariations, getBlockType } = select( blocksStore );\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\t__experimentalGetPatternsByBlockTypes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn {\n\t\t\t\tblockType: getBlockType( name ),\n\t\t\t\tallVariations: getBlockVariations( name ),\n\t\t\t\thasPatterns: !! __experimentalGetPatternsByBlockTypes(\n\t\t\t\t\tname,\n\t\t\t\t\trootClientId\n\t\t\t\t).length,\n\t\t\t};\n\t\t},\n\t\t[ name, clientId ]\n\t);\n\n\tconst matchingVariation = getMatchingVariation( attributes, allVariations );\n\tconst icon =\n\t\tmatchingVariation?.icon?.src ||\n\t\tmatchingVariation?.icon ||\n\t\tblockType?.icon?.src;\n\tconst label = matchingVariation?.title || blockType?.title;\n\tif ( isStartingBlank ) {\n\t\treturn (\n\t\t\t<QueryVariationPicker\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Placeholder\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Choose a pattern for the query loop or start blank.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ !! hasPatterns && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ openPatternSelectionModal }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Choose' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetIsStartingBlank( true );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Start blank' ) }\n\t\t\t\t</Button>\n\t\t\t</Placeholder>\n\t\t</div>\n\t);\n}\n\nfunction QueryVariationPicker( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\ticon,\n\tlabel,\n} ) {\n\tconst scopeVariations = useScopedBlockVariations( attributes );\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<__experimentalBlockVariationPicker\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\tvariations={ scopeVariations }\n\t\t\t\tonSelect={ ( variation ) => {\n\t\t\t\t\tif ( variation.attributes ) {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t...variation.attributes,\n\t\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\t\t...variation.attributes.query,\n\t\t\t\t\t\t\t\tpostType:\n\t\t\t\t\t\t\t\t\tattributes.query.postType ||\n\t\t\t\t\t\t\t\t\tvariation.attributes.query.postType,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnamespace: attributes.namespace,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( variation.innerBlocks ) {\n\t\t\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlocksFromInnerBlocksTemplate(\n\t\t\t\t\t\t\t\tvariation.innerBlocks\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query/edit/query-placeholder.js"],"names":["QueryPlaceholder","attributes","clientId","name","openPatternSelectionModal","setAttributes","isStartingBlank","setIsStartingBlank","blockProps","blockType","allVariations","hasPatterns","select","getBlockVariations","getBlockType","blocksStore","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","length","matchingVariation","icon","src","label","title","QueryVariationPicker","scopeVariations","replaceInnerBlocks","variation","query","postType","namespace","innerBlocks"],"mappings":";;;;;;;AAQA;;AALA;;AACA;;AAKA;;AAMA;;AACA;;AAKA;;AArBA;AACA;AACA;;AAgBA;AACA;AACA;AAGe,SAASA,gBAAT,OAMX;AAAA;;AAAA,MANsC;AACzCC,IAAAA,UADyC;AAEzCC,IAAAA,QAFyC;AAGzCC,IAAAA,IAHyC;AAIzCC,IAAAA,yBAJyC;AAKzCC,IAAAA;AALyC,GAMtC;AACH,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAMC,UAAU,GAAG,iCAAnB;AAEA,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,aAAb;AAA4BC,IAAAA;AAA5B,MAA4C,qBAC/CC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,kBAAF;AAAsBC,MAAAA;AAAtB,QAAuCF,MAAM,CAAEG,aAAF,CAAnD;AACA,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLL,MAAM,CAAEM,kBAAF,CADP;AAEA,UAAMC,YAAY,GAAGH,oBAAoB,CAAEd,QAAF,CAAzC;AAEA,WAAO;AACNO,MAAAA,SAAS,EAAEK,YAAY,CAAEX,IAAF,CADjB;AAENO,MAAAA,aAAa,EAAEG,kBAAkB,CAAEV,IAAF,CAF3B;AAGNQ,MAAAA,WAAW,EAAE,CAAC,CAAEM,uBAAuB,CAAEd,IAAF,EAAQgB,YAAR,CAAvB,CACdC;AAJI,KAAP;AAMA,GAbgD,EAcjD,CAAEjB,IAAF,EAAQD,QAAR,CAdiD,CAAlD;AAiBA,QAAMmB,iBAAiB,GAAG,qDAAsBpB,UAAtB,EAAkCS,aAAlC,CAA1B;AACA,QAA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AAK9BE,IAAAA;AAL8B,GAM3B;AACH,QAAMG,eAAe,GAAG,qCAA0B1B,UAA1B,CAAxB;AACA,QAAM;AAAE2B,IAAAA;AAAF,MAAyB,uBAAaV,kBAAb,CAA/B;AACA,QAAMV,UAAU,GAAG,iCAAnB;AACA,SACC,mCAAUA,UAAV,EACC,4BAAC,+CAAD;AACC,IAAA,IAAI,EAAGc,IADR;AAEC,IAAA,KAAK,EAAGE,KAFT;AAGC,IAAA,UAAU,EAAGG,eAHd;AAIC,IAAA,QAAQ,EAAKE,SAAF,IAAiB;AAC3B,UAAKA,SAAS,CAAC5B,UAAf,EAA4B;AAC3BI,QAAAA,aAAa,CAAE,EACd,GAAGwB,SAAS,CAAC5B,UADC;AAEd6B,UAAAA,KAAK,EAAE,EACN,GAAGD,SAAS,CAAC5B,UAAV,CAAqB6B,KADlB;AAENC,YAAAA,QAAQ,EACP9B,UAAU,CAAC6B,KAAX,CAAiBC,QAAjB,IACAF,SAAS,CAAC5B,UAAV,CAAqB6B,KAArB,CAA2BC;AAJtB,WAFO;AAQdC,UAAAA,SAAS,EAAE/B,UAAU,CAAC+B;AARR,SAAF,CAAb;AAUA;;AACD,UAAKH,SAAS,CAACI,WAAf,EAA6B;AAC5BL,QAAAA,kBAAkB,CACjB1B,QADiB,EAEjB,iDACC2B,SAAS,CAACI,WADX,CAFiB,EAKjB,KALiB,CAAlB;AAOA;AACD;AA1BF,IADD,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tcreateBlocksFromInnerBlocksTemplate,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useState } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalBlockVariationPicker,\n\t__experimentalGetMatchingVariation as getMatchingVariation,\n} from '@wordpress/block-editor';\nimport { Button, Placeholder } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useScopedBlockVariations } from '../utils';\n\nexport default function QueryPlaceholder( {\n\tattributes,\n\tclientId,\n\tname,\n\topenPatternSelectionModal,\n\tsetAttributes,\n} ) {\n\tconst [ isStartingBlank, setIsStartingBlank ] = useState( false );\n\tconst blockProps = useBlockProps();\n\n\tconst { blockType, allVariations, hasPatterns } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockVariations, getBlockType } = select( blocksStore );\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn {\n\t\t\t\tblockType: getBlockType( name ),\n\t\t\t\tallVariations: getBlockVariations( name ),\n\t\t\t\thasPatterns: !! getPatternsByBlockTypes( name, rootClientId )\n\t\t\t\t\t.length,\n\t\t\t};\n\t\t},\n\t\t[ name, clientId ]\n\t);\n\n\tconst matchingVariation = getMatchingVariation( attributes, allVariations );\n\tconst icon =\n\t\tmatchingVariation?.icon?.src ||\n\t\tmatchingVariation?.icon ||\n\t\tblockType?.icon?.src;\n\tconst label = matchingVariation?.title || blockType?.title;\n\tif ( isStartingBlank ) {\n\t\treturn (\n\t\t\t<QueryVariationPicker\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Placeholder\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Choose a pattern for the query loop or start blank.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ !! hasPatterns && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ openPatternSelectionModal }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Choose' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetIsStartingBlank( true );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Start blank' ) }\n\t\t\t\t</Button>\n\t\t\t</Placeholder>\n\t\t</div>\n\t);\n}\n\nfunction QueryVariationPicker( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\ticon,\n\tlabel,\n} ) {\n\tconst scopeVariations = useScopedBlockVariations( attributes );\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<__experimentalBlockVariationPicker\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\tvariations={ scopeVariations }\n\t\t\t\tonSelect={ ( variation ) => {\n\t\t\t\t\tif ( variation.attributes ) {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t...variation.attributes,\n\t\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\t\t...variation.attributes.query,\n\t\t\t\t\t\t\t\tpostType:\n\t\t\t\t\t\t\t\t\tattributes.query.postType ||\n\t\t\t\t\t\t\t\t\tvariation.attributes.query.postType,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnamespace: attributes.namespace,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( variation.innerBlocks ) {\n\t\t\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlocksFromInnerBlocksTemplate(\n\t\t\t\t\t\t\t\tvariation.innerBlocks\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
@@ -15,13 +15,15 @@ var _i18n = require("@wordpress/i18n");
15
15
 
16
16
  var _icons = require("@wordpress/icons");
17
17
 
18
- var _data = require("@wordpress/data");
19
-
20
- var _blockEditor = require("@wordpress/block-editor");
18
+ var _utils = require("../utils");
21
19
 
22
20
  /**
23
21
  * WordPress dependencies
24
22
  */
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
25
27
  function QueryToolbar(_ref) {
26
28
  let {
27
29
  attributes: {
@@ -34,14 +36,7 @@ function QueryToolbar(_ref) {
34
36
  name,
35
37
  clientId
36
38
  } = _ref;
37
- const hasPatterns = (0, _data.useSelect)(select => {
38
- const {
39
- getBlockRootClientId,
40
- __experimentalGetPatternsByBlockTypes
41
- } = select(_blockEditor.store);
42
- const rootClientId = getBlockRootClientId(clientId);
43
- return !!__experimentalGetPatternsByBlockTypes(name, rootClientId).length;
44
- }, [name, clientId]);
39
+ const hasPatterns = !!(0, _utils.usePatterns)(clientId, name).length;
45
40
  const maxPageInputId = (0, _compose.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input');
46
41
  const displayLayoutControls = [{
47
42
  icon: _icons.list,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query/edit/query-toolbar.js"],"names":["QueryToolbar","attributes","query","displayLayout","setQuery","setDisplayLayout","openPatternSelectionModal","name","clientId","hasPatterns","select","getBlockRootClientId","__experimentalGetPatternsByBlockTypes","blockEditorStore","rootClientId","length","maxPageInputId","displayLayoutControls","icon","list","title","onClick","type","isActive","grid","columns","inherit","onToggle","settings","value","isNaN","perPage","offset","pages"],"mappings":";;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;AAce,SAASA,YAAT,OAOX;AAAA,MAPkC;AACrCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,KADyB;AAErCC,IAAAA,QAFqC;AAGrCC,IAAAA,gBAHqC;AAIrCC,IAAAA,yBAJqC;AAKrCC,IAAAA,IALqC;AA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SAAF,CAAR;AACA,OAfF;AAgBC,MAAA,IAAI,EAAC,GAhBN;AAiBC,MAAA,KAAK,EAAG3B,KAAK,CAAC8B,MAjBf;AAkBC,MAAA,aAAa,EAAG;AAlBjB,MADD,CAzBD,EA+CC,4BAAC,uBAAD;AACC,MAAA,EAAE,EAAGhB,cADN;AAEC,MAAA,IAAI,EAAG,cACN,uGADM;AAFR,OAMC,4BAAC,uCAAD;AACC,MAAA,EAAE,EAAGA,cADN;AAEC,MAAA,oBAAoB,EAAC,MAFtB;AAGC,MAAA,KAAK,EAAG,cAAI,kBAAJ,CAHT;AAIC,MAAA,aAAa,EAAC,MAJf;AAKC,MAAA,GAAG,EAAG,CALP;AAMC,MAAA,QAAQ,EAAKa,KAAF,IAAa;AACvB,YAAKC,KAAK,CAAED,KAAF,CAAL,IAAkBA,KAAK,GAAG,CAA/B,EAAmC;AAClC;AACA;;AACDzB,QAAAA,QAAQ,CAAE;AAAE6B,UAAAA,KAAK,EAAEJ;AAAT,SAAF,CAAR;AACA,OAXF;AAYC,MAAA,IAAI,EAAC,GAZN;AAaC,MAAA,KAAK,EAAG3B,KAAK,CAAC+B,KAbf;AAcC,MAAA,aAAa,EAAG;AAdjB,MAND,CA/CD;AAVF,IADD,CAFF,EAwFGxB,WAAW,IACZ,4BAAC,wBAAD;AAAc,IAAA,SAAS,EAAC;AAAxB,KACC,4BAAC,yBAAD;AAAe,IAAA,OAAO,EAAGH;AAAzB,KACG,cAAI,SAAJ,CADH,CADD,CAzFF,EA+FC,4BAAC,wBAAD;AAAc,IAAA,QAAQ,EAAGW;AAAzB,IA/FD,CADD;AAmGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarGroup,\n\tDropdown,\n\tToolbarButton,\n\tBaseControl,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { settings, list, grid } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function QueryToolbar( {\n\tattributes: { query, displayLayout },\n\tsetQuery,\n\tsetDisplayLayout,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst hasPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\t__experimentalGetPatternsByBlockTypes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn !! __experimentalGetPatternsByBlockTypes(\n\t\t\t\tname,\n\t\t\t\trootClientId\n\t\t\t).length;\n\t\t},\n\t\t[ name, clientId ]\n\t);\n\tconst maxPageInputId = useInstanceId(\n\t\tQueryToolbar,\n\t\t'blocks-query-pagination-max-page-input'\n\t);\n\tconst displayLayoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: __( 'List view' ),\n\t\t\tonClick: () => setDisplayLayout( { type: 'list' } ),\n\t\t\tisActive: displayLayout?.type === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: __( 'Grid view' ),\n\t\t\tonClick: () =>\n\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\ttype: 'flex',\n\t\t\t\t\tcolumns: displayLayout?.columns || 3,\n\t\t\t\t} ),\n\t\t\tisActive: displayLayout?.type === 'flex',\n\t\t},\n\t];\n\treturn (\n\t\t<>\n\t\t\t{ ! query.inherit && (\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tcontentClassName=\"block-library-query-toolbar__popover\"\n\t\t\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\t\tlabel={ __( 'Display settings' ) }\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BaseControl>\n\t\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Items per Page' ) }\n\t\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tisNaN( value ) ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue < 1 ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue > 100\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\t\t\t\tperPage: value,\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\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\tvalue={ query.perPage }\n\t\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t\t\t<BaseControl>\n\t\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Offset' ) }\n\t\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tisNaN( value ) ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue < 0 ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue > 100\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetQuery( { offset: value } );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\tvalue={ query.offset }\n\t\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t\t\t<BaseControl\n\t\t\t\t\t\t\t\t\tid={ maxPageInputId }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t\tid={ maxPageInputId }\n\t\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Max page to show' ) }\n\t\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( isNaN( value ) || value < 0 ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetQuery( { pages: value } );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\tvalue={ query.pages }\n\t\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</BaseControl>\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</ToolbarGroup>\n\t\t\t) }\n\t\t\t{ hasPatterns && (\n\t\t\t\t<ToolbarGroup className=\"wp-block-template-part__block-control-group\">\n\t\t\t\t\t<ToolbarButton onClick={ openPatternSelectionModal }>\n\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t</ToolbarButton>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t\t<ToolbarGroup controls={ displayLayoutControls } />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query/edit/query-toolbar.js"],"names":["QueryToolbar","attributes","query","displayLayout","setQuery","setDisplayLayout","openPatternSelectionModal","name","clientId","hasPatterns","length","maxPageInputId","displayLayoutControls","icon","list","title","onClick","type","isActive","grid","columns","inherit","onToggle","settings","value","isNaN","perPage","offset","pages"],"mappings":";;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;AAGe,SAASA,YAAT,OAOX;AAAA,MAPkC;AACrCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,KADyB;AAErCC,IAAAA,QAFqC;AAGrCC,IAAAA,gBAHqC;AAIrCC,IAAAA,yBAJqC;AAKrCC,IAAAA,IALqC;AAMrCC,IAAAA;AANqC,GAOlC;AACH,QAAMC,WAAW,GAAG,CAAC,CAAE,wBAAaD,QAAb,EAAuBD,IAAvB,EAA8BG,MAArD;AACA,QAAMC,cAAc,GAAG,4BACtBX,YADsB,EAEtB,wCAFsB,CAAvB;AAIA,QAAMY,qBAAqB,GAAG,CAC7B;AACCC,IAAAA,IAAI,EAAEC,WADP;AAECC,IAAAA,KAAK,EAAE,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GAAG,CAA/B,EAAmC;AAClC;AACA;;AACDpB,QAAAA,QAAQ,CAAE;AAAEwB,UAAAA,KAAK,EAAEJ;AAAT,SAAF,CAAR;AACA,OAXF;AAYC,MAAA,IAAI,EAAC,GAZN;AAaC,MAAA,KAAK,EAAGtB,KAAK,CAAC0B,KAbf;AAcC,MAAA,aAAa,EAAG;AAdjB,MAND,CA/CD;AAVF,IADD,CAFF,EAwFGnB,WAAW,IACZ,4BAAC,wBAAD;AAAc,IAAA,SAAS,EAAC;AAAxB,KACC,4BAAC,yBAAD;AAAe,IAAA,OAAO,EAAGH;AAAzB,KACG,cAAI,SAAJ,CADH,CADD,CAzFF,EA+FC,4BAAC,wBAAD;AAAc,IAAA,QAAQ,EAAGM;AAAzB,IA/FD,CADD;AAmGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarGroup,\n\tDropdown,\n\tToolbarButton,\n\tBaseControl,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { settings, list, grid } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { usePatterns } from '../utils';\n\nexport default function QueryToolbar( {\n\tattributes: { query, displayLayout },\n\tsetQuery,\n\tsetDisplayLayout,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst hasPatterns = !! usePatterns( clientId, name ).length;\n\tconst maxPageInputId = useInstanceId(\n\t\tQueryToolbar,\n\t\t'blocks-query-pagination-max-page-input'\n\t);\n\tconst displayLayoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: __( 'List view' ),\n\t\t\tonClick: () => setDisplayLayout( { type: 'list' } ),\n\t\t\tisActive: displayLayout?.type === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: __( 'Grid view' ),\n\t\t\tonClick: () =>\n\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\ttype: 'flex',\n\t\t\t\t\tcolumns: displayLayout?.columns || 3,\n\t\t\t\t} ),\n\t\t\tisActive: displayLayout?.type === 'flex',\n\t\t},\n\t];\n\treturn (\n\t\t<>\n\t\t\t{ ! query.inherit && (\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tcontentClassName=\"block-library-query-toolbar__popover\"\n\t\t\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\t\tlabel={ __( 'Display settings' ) }\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BaseControl>\n\t\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Items per Page' ) }\n\t\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tisNaN( value ) ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue < 1 ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue > 100\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\t\t\t\tperPage: value,\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\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\tvalue={ query.perPage }\n\t\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t\t\t<BaseControl>\n\t\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Offset' ) }\n\t\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tisNaN( value ) ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue < 0 ||\n\t\t\t\t\t\t\t\t\t\t\t\tvalue > 100\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetQuery( { offset: value } );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\tvalue={ query.offset }\n\t\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t\t\t<BaseControl\n\t\t\t\t\t\t\t\t\tid={ maxPageInputId }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t\tid={ maxPageInputId }\n\t\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Max page to show' ) }\n\t\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( isNaN( value ) || value < 0 ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetQuery( { pages: value } );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\tvalue={ query.pages }\n\t\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</BaseControl>\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</ToolbarGroup>\n\t\t\t) }\n\t\t\t{ hasPatterns && (\n\t\t\t\t<ToolbarGroup className=\"wp-block-template-part__block-control-group\">\n\t\t\t\t\t<ToolbarButton onClick={ openPatternSelectionModal }>\n\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t</ToolbarButton>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t\t<ToolbarGroup controls={ displayLayoutControls } />\n\t\t</>\n\t);\n}\n"]}
@@ -81,6 +81,7 @@ const metadata = {
81
81
  },
82
82
  supports: {
83
83
  align: ["wide", "full"],
84
+ anchor: true,
84
85
  html: false,
85
86
  __experimentalLayout: true
86
87
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query/index.js"],"names":["name","metadata","settings","icon","edit","save","variations","deprecated","init","queryInspectorControls"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA,mBAJuB;AAKvBC,EAAAA,UAAU,EAAVA;AALuB,CAAjB;;;AAQA,MAAMC,IAAI,GAAG,MAAM;AACzB,wBAAW,kBAAX,EAA+B,YAA/B,EAA6CC,eAA7C;AAEA,SAAO,wBAAW;AAAET,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAX,CAAP;AACA,CAJM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\nimport queryInspectorControls from './hooks';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => {\n\taddFilter( 'editor.BlockEdit', 'core/query', queryInspectorControls );\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query/index.js"],"names":["name","metadata","settings","icon","edit","save","variations","deprecated","init","queryInspectorControls"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA,mBAJuB;AAKvBC,EAAAA,UAAU,EAAVA;AALuB,CAAjB;;;AAQA,MAAMC,IAAI,GAAG,MAAM;AACzB,wBAAW,kBAAX,EAA+B,YAA/B,EAA6CC,eAA7C;AAEA,SAAO,wBAAW;AAAET,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAX,CAAP;AACA,CAJM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\nimport queryInspectorControls from './hooks';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => {\n\taddFilter( 'editor.BlockEdit', 'core/query', queryInspectorControls );\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
@@ -9,7 +9,7 @@ exports.mapToIHasNameAndId = void 0;
9
9
  exports.useAllowedControls = useAllowedControls;
10
10
  exports.useBlockNameForPatterns = useBlockNameForPatterns;
11
11
  exports.useIsPostTypeHierarchical = useIsPostTypeHierarchical;
12
- exports.usePostTypes = void 0;
12
+ exports.usePostTypes = exports.usePatterns = void 0;
13
13
  exports.useScopedBlockVariations = useScopedBlockVariations;
14
14
  exports.useTaxonomies = void 0;
15
15
 
@@ -91,6 +91,7 @@ const {
91
91
  },
92
92
  supports: {
93
93
  align: ["wide", "full"],
94
+ anchor: true,
94
95
  html: false,
95
96
  __experimentalLayout: true
96
97
  },
@@ -362,10 +363,10 @@ function useBlockNameForPatterns(clientId, attributes) {
362
363
 
363
364
  const {
364
365
  getBlockRootClientId,
365
- __experimentalGetPatternsByBlockTypes
366
+ getPatternsByBlockTypes
366
367
  } = select(_blockEditor.store);
367
368
  const rootClientId = getBlockRootClientId(clientId);
368
- return __experimentalGetPatternsByBlockTypes(blockName, rootClientId);
369
+ return getPatternsByBlockTypes(blockName, rootClientId);
369
370
  }, [clientId, activeVariationName]);
370
371
  return activeVariationPatterns !== null && activeVariationPatterns !== void 0 && activeVariationPatterns.length ? blockName : queryLoopName;
371
372
  }
@@ -437,4 +438,25 @@ function useScopedBlockVariations(attributes) {
437
438
  }, [activeVariationName, blockVariations]);
438
439
  return variations;
439
440
  }
441
+ /**
442
+ * Hook that returns the block patterns for a specific block type.
443
+ *
444
+ * @param {string} clientId The block's client ID.
445
+ * @param {string} name The block type name.
446
+ * @return {Object[]} An array of valid block patterns.
447
+ */
448
+
449
+
450
+ const usePatterns = (clientId, name) => {
451
+ return (0, _data.useSelect)(select => {
452
+ const {
453
+ getBlockRootClientId,
454
+ getPatternsByBlockTypes
455
+ } = select(_blockEditor.store);
456
+ const rootClientId = getBlockRootClientId(clientId);
457
+ return getPatternsByBlockTypes(name, rootClientId);
458
+ }, [name, clientId]);
459
+ };
460
+
461
+ exports.usePatterns = usePatterns;
440
462
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","mapToIHasNameAndId","path","map","usePostTypes","postTypes","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","value","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","blocksStore","getActiveBlockVariation","queryLoopName","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","forEach","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","activeVariationPatterns","getBlockRootClientId","__experimentalGetPatternsByBlockTypes","blockEditorStore","rootClientId","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","namespace","connectedVariations"],"mappings":";;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMA,eAAe,GAAKC,QAAF,IAAgB;AAC9C,QAAMC,OAAO,GAAGD,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAEE,MAAV,CACf,CAAEC,WAAF,EAAeC,MAAf,KAA2B;AAC1B,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,SAAX;AAAsBC,MAAAA;AAAtB,QAAgCJ,WAAtC;AACAE,IAAAA,OAAO,CAAED,MAAM,CAACI,EAAT,CAAP,GAAuBJ,MAAvB;AACAE,IAAAA,SAAS,CAAEF,MAAM,CAACK,IAAT,CAAT,GAA2BL,MAA3B;AACAG,IAAAA,KAAK,CAACG,IAAN,CAAYN,MAAM,CAACK,IAAnB;AACA,WAAON,WAAP;AACA,GAPc,EAQf;AAAEE,IAAAA,OAAO,EAAE,EAAX;AAAeC,IAAAA,SAAS,EAAE,EAA1B;AAA8BC,IAAAA,KAAK,EAAE;AAArC,GARe,CAAhB;AAUA,SAAO;AACNP,IAAAA,QADM;AAEN,OAAGC;AAFG,GAAP;AAIA,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\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { cloneBlock, store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as queryLoopName } from './block.json';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( get( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) return;\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\treturn { postTypesTaxonomiesMap, postTypesSelectOptions };\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn taxonomies;\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\tconst activeVariationName = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `${ queryLoopName }/${ activeVariationName }`;\n\tconst activeVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\t__experimentalGetPatternsByBlockTypes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn __experimentalGetPatternsByBlockTypes(\n\t\t\t\tblockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t},\n\t\t[ clientId, activeVariationName ]\n\t);\n\treturn activeVariationPatterns?.length ? blockName : queryLoopName;\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\tqueryLoopName,\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( queryLoopName, 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","mapToIHasNameAndId","path","map","usePostTypes","postTypes","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","value","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","blocksStore","getActiveBlockVariation","queryLoopName","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","forEach","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","activeVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","namespace","connectedVariations","usePatterns"],"mappings":";;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMA,eAAe,GAAKC,QAAF,IAAgB;AAC9C,QAAMC,OAAO,GAAGD,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAEE,MAAV,CACf,CAAEC,WAAF,EAAeC,MAAf,KAA2B;AAC1B,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,SAAX;AAAsBC,MAAAA;AAAtB,QAAgCJ,WAAtC;AACAE,IAAAA,OAAO,CAAED,MAAM,CAACI,EAAT,CAAP,GAAuBJ,MAAvB;AACAE,I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,2DACnD,uBAAiCvD,QAAjC,CAA2C0C,mBAA3C,CADmD;AAAA,KAAxB,CAA5B;;AAGA,QAAK,CAAC,CAAEc,mBAAmB,CAACtD,MAA5B,EAAqC;AACpC,aAAOsD,mBAAP;AACA;;AACD,WAAON,eAAe,CAACrD,MAAhB,CAAwBwD,cAAxB,CAAP;AACA,GAfkB,EAehB,CAAEX,mBAAF,EAAuBQ,eAAvB,CAfgB,CAAnB;AAgBA,SAAOE,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMK,WAAW,GAAG,CAAErB,QAAF,EAAYpD,IAAZ,KAAsB;AAChD,SAAO,qBACJO,MAAF,IAAc;AACb,UAAM;AAAEsD,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLvD,MAAM,CAAEwD,kBAAF,CADP;AAEA,UAAMC,YAAY,GAAGH,oBAAoB,CAAET,QAAF,CAAzC;AACA,WAAOU,uBAAuB,CAAE9D,IAAF,EAAQgE,YAAR,CAA9B;AACA,GANK,EAON,CAAEhE,IAAF,EAAQoD,QAAR,CAPM,CAAP;AASA,CAVM","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { cloneBlock, store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as queryLoopName } from './block.json';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( get( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) return;\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\treturn { postTypesTaxonomiesMap, postTypesSelectOptions };\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn taxonomies;\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\tconst activeVariationName = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `${ queryLoopName }/${ activeVariationName }`;\n\tconst activeVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( blockName, rootClientId );\n\t\t},\n\t\t[ clientId, activeVariationName ]\n\t);\n\treturn activeVariationPatterns?.length ? blockName : queryLoopName;\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\tqueryLoopName,\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( queryLoopName, 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n\n/**\n * Hook that returns the block patterns for a specific block type.\n *\n * @param {string} clientId The block's client ID.\n * @param {string} name The block type name.\n * @return {Object[]} An array of valid block patterns.\n */\nexport const usePatterns = ( clientId, name ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( name, rootClientId );\n\t\t},\n\t\t[ name, clientId ]\n\t);\n};\n"]}
@@ -33,6 +33,7 @@ const metadata = {
33
33
  textdomain: "default",
34
34
  usesContext: ["queryId", "query"],
35
35
  supports: {
36
+ anchor: true,
36
37
  align: true,
37
38
  reusable: false,
38
39
  html: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-no-results/index.js"],"names":["name","metadata","settings","icon","edit","save","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB;;;AAMA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEN,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-no-results/index.js"],"names":["name","metadata","settings","icon","edit","save","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB;;;AAMA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEN,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -13,8 +13,6 @@ var _blockEditor = require("@wordpress/block-editor");
13
13
 
14
14
  var _data = require("@wordpress/data");
15
15
 
16
- var _blocks = require("@wordpress/blocks");
17
-
18
16
  var _components = require("@wordpress/components");
19
17
 
20
18
  var _queryPaginationArrowControls = require("./query-pagination-arrow-controls");
@@ -29,22 +27,14 @@ var _queryPaginationArrowControls = require("./query-pagination-arrow-controls")
29
27
  const TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
30
28
  const ALLOWED_BLOCKS = ['core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next'];
31
29
 
32
- const getDefaultBlockLayout = blockTypeOrName => {
33
- const layoutBlockSupportConfig = (0, _blocks.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
34
- return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
35
- };
36
-
37
30
  function QueryPaginationEdit(_ref) {
38
31
  let {
39
32
  attributes: {
40
- paginationArrow,
41
- layout
33
+ paginationArrow
42
34
  },
43
35
  setAttributes,
44
- clientId,
45
- name
36
+ clientId
46
37
  } = _ref;
47
- const usedLayout = layout || getDefaultBlockLayout(name);
48
38
  const hasNextPreviousBlocks = (0, _data.useSelect)(select => {
49
39
  const {
50
40
  getBlocks
@@ -62,8 +52,7 @@ function QueryPaginationEdit(_ref) {
62
52
  const blockProps = (0, _blockEditor.useBlockProps)();
63
53
  const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
64
54
  template: TEMPLATE,
65
- allowedBlocks: ALLOWED_BLOCKS,
66
- __experimentalLayout: usedLayout
55
+ allowedBlocks: ALLOWED_BLOCKS
67
56
  });
68
57
  return (0, _element.createElement)(_element.Fragment, null, hasNextPreviousBlocks && (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
69
58
  title: (0, _i18n.__)('Settings')
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-pagination/edit.js"],"names":["TEMPLATE","ALLOWED_BLOCKS","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","QueryPaginationEdit","attributes","paginationArrow","layout","setAttributes","clientId","name","usedLayout","hasNextPreviousBlocks","select","getBlocks","blockEditorStore","innerBlocks","find","innerBlock","includes","blockProps","innerBlocksProps","template","allowedBlocks","__experimentalLayout","value"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;AAGA,MAAMA,QAAQ,GAAG,CAChB,CAAE,gCAAF,CADgB,EAEhB,CAAE,+BAAF,CAFgB,EAGhB,CAAE,4BAAF,CAHgB,CAAjB;AAKA,MAAMC,cAAc,GAAG,CACtB,gCADsB,EAEtB,+BAFsB,EAGtB,4BAHsB,CAAvB;;AAMA,MAAMC,qBAAqB,GAAKC,eAAF,IAAuB;AACpD,QAAMC,wBAAwB,GAAG,6BAChCD,eADgC,EAEhC,sBAFgC,CAAjC;AAIA,SAAOC,wBAAP,aAAOA,wBAAP,uBAAOA,wBAAwB,CAAEC,OAAjC;AACA,CAND;;AAQe,SAASC,mBAAT,OAKX;AAAA,MALyC;AAC5CC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,KADgC;AAE5CC,IAAAA,aAF4C;AAG5CC,IAAAA,QAH4C;AAI5CC,IAAAA;AAJ4C,GAKzC;AACH,QAAMC,UAAU,GAAGJ,MAAM,IAAIP,qBAAqB,CAAEU,IAAF,CAAlD;AACA,QAAME,qBAAqB,GAAG,qBAAaC,MAAF,IAAc;AACtD,UAAM;AAAEC,MAAAA;AAAF,QAAgBD,MAAM,CAAEE,kBAAF,CAA5B;AACA,UAAMC,WAAW,GAAGF,SAAS,CAAEL,QAAF,CAA7B;AACA;AACF;AACA;AACA;;AACE,WAAOO,WAAP,aAAOA,WAAP,uBAAOA,WAAW,CAAEC,IAAb,CAAqBC,UAAF,IAAkB;AAC3C,aAAO,CACN,4BADM,EAEN,gCAFM,EAGLC,QAHK,CAGKD,UAAU,CAACR,IAHhB,CAAP;AAIA,KALM,CAAP;AAMA,GAb6B,EAa3B,EAb2B,CAA9B;AAcA,QAAMU,UAAU,GAAG,iCAAnB;AACA,QAAMC,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,QAAQ,EAAExB,QAD+C;AAEzDyB,IAAAA,aAAa,EAAExB,cAF0C;AAGzDyB,IAAAA,oBAAoB,EAAEb;AAHmC,GAAjC,CAAzB;AAKA,SACC,qDACGC,qBAAqB,IACtB,4BAAC,8BAAD,QACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,UAAJ;AAAnB,KACC,4BAAC,0DAAD;AACC,IAAA,KAAK,EAAGN,eADT;AAEC,IAAA,QAAQ,EAAKmB,KAAF,IAAa;AACvBjB,MAAAA,aAAa,CAAE;AAAEF,QAAAA,eAAe,EAAEmB;AAAnB,OAAF,CAAb;AACA;AAJF,IADD,CADD,CAFF,EAaC,mCAAUJ,gBAAV,CAbD,CADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { QueryPaginationArrowControls } from './query-pagination-arrow-controls';\n\nconst TEMPLATE = [\n\t[ 'core/query-pagination-previous' ],\n\t[ 'core/query-pagination-numbers' ],\n\t[ 'core/query-pagination-next' ],\n];\nconst ALLOWED_BLOCKS = [\n\t'core/query-pagination-previous',\n\t'core/query-pagination-numbers',\n\t'core/query-pagination-next',\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport default function QueryPaginationEdit( {\n\tattributes: { paginationArrow, layout },\n\tsetAttributes,\n\tclientId,\n\tname,\n} ) {\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\tconst hasNextPreviousBlocks = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst innerBlocks = getBlocks( clientId );\n\t\t/**\n\t\t * Show the `paginationArrow` control only if a\n\t\t * `QueryPaginationNext/Previous` block exists.\n\t\t */\n\t\treturn innerBlocks?.find( ( innerBlock ) => {\n\t\t\treturn [\n\t\t\t\t'core/query-pagination-next',\n\t\t\t\t'core/query-pagination-previous',\n\t\t\t].includes( innerBlock.name );\n\t\t} );\n\t}, [] );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\treturn (\n\t\t<>\n\t\t\t{ hasNextPreviousBlocks && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<QueryPaginationArrowControls\n\t\t\t\t\t\t\tvalue={ paginationArrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { paginationArrow: value } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<nav { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-pagination/edit.js"],"names":["TEMPLATE","ALLOWED_BLOCKS","QueryPaginationEdit","attributes","paginationArrow","setAttributes","clientId","hasNextPreviousBlocks","select","getBlocks","blockEditorStore","innerBlocks","find","innerBlock","includes","name","blockProps","innerBlocksProps","template","allowedBlocks","value"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;AAGA,MAAMA,QAAQ,GAAG,CAChB,CAAE,gCAAF,CADgB,EAEhB,CAAE,+BAAF,CAFgB,EAGhB,CAAE,4BAAF,CAHgB,CAAjB;AAKA,MAAMC,cAAc,GAAG,CACtB,gCADsB,EAEtB,+BAFsB,EAGtB,4BAHsB,CAAvB;;AAMe,SAASC,mBAAT,OAIX;AAAA,MAJyC;AAC5CC,IAAAA,UAAU,EAAE;AAAEC,MAAAA;AAAF,KADgC;AAE5CC,IAAAA,aAF4C;AAG5CC,IAAAA;AAH4C,GAIzC;AACH,QAAMC,qBAAqB,GAAG,qBAAaC,MAAF,IAAc;AACtD,UAAM;AAAEC,MAAAA;AAAF,QAAgBD,MAAM,CAAEE,kBAAF,CAA5B;AACA,UAAMC,WAAW,GAAGF,SAAS,CAAEH,QAAF,CAA7B;AACA;AACF;AACA;AACA;;AACE,WAAOK,WAAP,aAAOA,WAAP,uBAAOA,WAAW,CAAEC,IAAb,CAAqBC,UAAF,IAAkB;AAC3C,aAAO,CACN,4BADM,EAEN,gCAFM,EAGLC,QAHK,CAGKD,UAAU,CAACE,IAHhB,CAAP;AAIA,KALM,CAAP;AAMA,GAb6B,EAa3B,EAb2B,CAA9B;AAcA,QAAMC,UAAU,GAAG,iCAAnB;AACA,QAAMC,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,QAAQ,EAAElB,QAD+C;AAEzDmB,IAAAA,aAAa,EAAElB;AAF0C,GAAjC,CAAzB;AAIA,SACC,qDACGM,qBAAqB,IACtB,4BAAC,8BAAD,QACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,UAAJ;AAAnB,KACC,4BAAC,0DAAD;AACC,IAAA,KAAK,EAAGH,eADT;AAEC,IAAA,QAAQ,EAAKgB,KAAF,IAAa;AACvBf,MAAAA,aAAa,CAAE;AAAED,QAAAA,eAAe,EAAEgB;AAAnB,OAAF,CAAb;AACA;AAJF,IADD,CADD,CAFF,EAaC,mCAAUH,gBAAV,CAbD,CADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { QueryPaginationArrowControls } from './query-pagination-arrow-controls';\n\nconst TEMPLATE = [\n\t[ 'core/query-pagination-previous' ],\n\t[ 'core/query-pagination-numbers' ],\n\t[ 'core/query-pagination-next' ],\n];\nconst ALLOWED_BLOCKS = [\n\t'core/query-pagination-previous',\n\t'core/query-pagination-numbers',\n\t'core/query-pagination-next',\n];\n\nexport default function QueryPaginationEdit( {\n\tattributes: { paginationArrow },\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst hasNextPreviousBlocks = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst innerBlocks = getBlocks( clientId );\n\t\t/**\n\t\t * Show the `paginationArrow` control only if a\n\t\t * `QueryPaginationNext/Previous` block exists.\n\t\t */\n\t\treturn innerBlocks?.find( ( innerBlock ) => {\n\t\t\treturn [\n\t\t\t\t'core/query-pagination-next',\n\t\t\t\t'core/query-pagination-previous',\n\t\t\t].includes( innerBlock.name );\n\t\t} );\n\t}, [] );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t} );\n\treturn (\n\t\t<>\n\t\t\t{ hasNextPreviousBlocks && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<QueryPaginationArrowControls\n\t\t\t\t\t\t\tvalue={ paginationArrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { paginationArrow: value } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<nav { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
@@ -44,6 +44,7 @@ const metadata = {
44
44
  paginationArrow: "paginationArrow"
45
45
  },
46
46
  supports: {
47
+ anchor: true,
47
48
  align: true,
48
49
  reusable: false,
49
50
  html: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-pagination/index.js"],"names":["name","metadata","settings","icon","edit","save","deprecated","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,sBADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB;;;AAOA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEP,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPagination as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-pagination/index.js"],"names":["name","metadata","settings","icon","edit","save","deprecated","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,sBADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB;;;AAOA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEP,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPagination as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -20,6 +20,7 @@ function QueryPaginationArrowControls(_ref) {
20
20
  onChange
21
21
  } = _ref;
22
22
  return (0, _element.createElement)(_components.__experimentalToggleGroupControl, {
23
+ __nextHasNoMarginBottom: true,
23
24
  label: (0, _i18n.__)('Arrow'),
24
25
  value: value,
25
26
  onChange: onChange,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-pagination/query-pagination-arrow-controls.js"],"names":["QueryPaginationArrowControls","value","onChange"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAOO,SAASA,4BAAT,OAA6D;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAsB;AACnE,SACC,4BAAC,4CAAD;AACC,IAAA,KAAK,EAAG,cAAI,OAAJ,CADT;AAEC,IAAA,KAAK,EAAGD,KAFT;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,IAAI,EAAG,cACN,iEADM,CAJR;AAOC,IAAA,OAAO;AAPR,KASC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,MADP;AAEC,IAAA,KAAK,EAAG,cACP,MADO,EAEP,wDAFO;AAFT,IATD,EAgBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,OADP;AAEC,IAAA,KAAK,EAAG,cACP,OADO,EAEP,wDAFO;AAFT,IAhBD,EAuBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,SADP;AAEC,IAAA,KAAK,EAAG,cACP,SADO,EAEP,wDAFO;AAFT,IAvBD,CADD;AAiCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\n\nexport function QueryPaginationArrowControls( { value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'A decorative arrow appended to the next and previous page link.'\n\t\t\t) }\n\t\t\tisBlock\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"none\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'None',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"arrow\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Arrow',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"chevron\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Chevron',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-pagination/query-pagination-arrow-controls.js"],"names":["QueryPaginationArrowControls","value","onChange"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAOO,SAASA,4BAAT,OAA6D;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAsB;AACnE,SACC,4BAAC,4CAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAG,cAAI,OAAJ,CAFT;AAGC,IAAA,KAAK,EAAGD,KAHT;AAIC,IAAA,QAAQ,EAAGC,QAJZ;AAKC,IAAA,IAAI,EAAG,cACN,iEADM,CALR;AAQC,IAAA,OAAO;AARR,KAUC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,MADP;AAEC,IAAA,KAAK,EAAG,cACP,MADO,EAEP,wDAFO;AAFT,IAVD,EAiBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,OADP;AAEC,IAAA,KAAK,EAAG,cACP,OADO,EAEP,wDAFO;AAFT,IAjBD,EAwBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,SADP;AAEC,IAAA,KAAK,EAAG,cACP,SADO,EAEP,wDAFO;AAFT,IAxBD,CADD;AAkCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\n\nexport function QueryPaginationArrowControls( { value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'A decorative arrow appended to the next and previous page link.'\n\t\t\t) }\n\t\t\tisBlock\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"none\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'None',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"arrow\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Arrow',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"chevron\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Chevron',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"]}
@@ -36,6 +36,7 @@ const metadata = {
36
36
  },
37
37
  usesContext: ["queryId", "query", "paginationArrow"],
38
38
  supports: {
39
+ anchor: true,
39
40
  reusable: false,
40
41
  html: false,
41
42
  color: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-pagination-next/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,0BADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationNext as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-pagination-next/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,0BADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationNext as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -31,6 +31,7 @@ const metadata = {
31
31
  textdomain: "default",
32
32
  usesContext: ["queryId", "query"],
33
33
  supports: {
34
+ anchor: true,
34
35
  reusable: false,
35
36
  html: false,
36
37
  color: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-pagination-numbers/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,6BADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationNumbers as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-pagination-numbers/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,6BADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationNumbers as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -36,6 +36,7 @@ const metadata = {
36
36
  },
37
37
  usesContext: ["queryId", "query", "paginationArrow"],
38
38
  supports: {
39
+ anchor: true,
39
40
  reusable: false,
40
41
  html: false,
41
42
  color: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-pagination-previous/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,8BADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationPrevious as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-pagination-previous/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,8BADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationPrevious as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -53,6 +53,7 @@ const metadata = {
53
53
  }
54
54
  },
55
55
  supports: {
56
+ anchor: true,
56
57
  align: ["wide", "full"],
57
58
  html: false,
58
59
  color: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-title/index.js"],"names":["name","metadata","settings","icon","edit","variations","deprecated","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,UAAU,EAAVA,mBAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB;;;AAOA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEP,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { title as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-title/index.js"],"names":["name","metadata","settings","icon","edit","variations","deprecated","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,UAAU,EAAVA,mBAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB;;;AAOA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEP,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { title as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -39,6 +39,7 @@ const metadata = {
39
39
  },
40
40
  usesContext: ["postId"],
41
41
  supports: {
42
+ anchor: true,
42
43
  html: false,
43
44
  color: {
44
45
  gradients: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/read-more/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { link as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/read-more/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { link as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}