@wordpress/block-library 9.2.0 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (623) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/audio/edit.js +20 -8
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/audio/index.js +4 -0
  5. package/build/audio/index.js.map +1 -1
  6. package/build/audio/transforms.js +1 -1
  7. package/build/audio/transforms.js.map +1 -1
  8. package/build/block/edit.js +38 -24
  9. package/build/block/edit.js.map +1 -1
  10. package/build/block/index.js +5 -1
  11. package/build/block/index.js.map +1 -1
  12. package/build/button/edit.js +1 -1
  13. package/build/button/edit.js.map +1 -1
  14. package/build/buttons/index.js +26 -0
  15. package/build/buttons/index.js.map +1 -1
  16. package/build/categories/edit.js +20 -3
  17. package/build/categories/edit.js.map +1 -1
  18. package/build/categories/index.js +8 -0
  19. package/build/categories/index.js.map +1 -1
  20. package/build/columns/index.js +2 -2
  21. package/build/columns/index.js.map +1 -1
  22. package/build/cover/edit/inspector-controls.js +2 -1
  23. package/build/cover/edit/inspector-controls.js.map +1 -1
  24. package/build/embed/embed-preview.js +4 -4
  25. package/build/embed/embed-preview.js.map +1 -1
  26. package/build/embed/variations.js +39 -34
  27. package/build/embed/variations.js.map +1 -1
  28. package/build/file/edit.js +14 -6
  29. package/build/file/edit.js.map +1 -1
  30. package/build/file/index.js +4 -0
  31. package/build/file/index.js.map +1 -1
  32. package/build/file/transforms.js +2 -3
  33. package/build/file/transforms.js.map +1 -1
  34. package/build/footnotes/index.js +1 -1
  35. package/build/footnotes/index.js.map +1 -1
  36. package/build/form-input/edit.js +2 -0
  37. package/build/form-input/edit.js.map +1 -1
  38. package/build/gallery/deprecated.js +6 -54
  39. package/build/gallery/deprecated.js.map +1 -1
  40. package/build/gallery/edit.js +9 -8
  41. package/build/gallery/edit.js.map +1 -1
  42. package/build/gallery/index.js +12 -2
  43. package/build/gallery/index.js.map +1 -1
  44. package/build/gallery/save.js +0 -11
  45. package/build/gallery/save.js.map +1 -1
  46. package/build/gallery/shared.js +0 -27
  47. package/build/gallery/shared.js.map +1 -1
  48. package/build/gallery/transforms.js +29 -80
  49. package/build/gallery/transforms.js.map +1 -1
  50. package/build/group/deprecated.js +2 -5
  51. package/build/group/deprecated.js.map +1 -1
  52. package/build/group/index.js +1 -0
  53. package/build/group/index.js.map +1 -1
  54. package/build/group/placeholder.js +5 -0
  55. package/build/group/placeholder.js.map +1 -1
  56. package/build/heading/index.js +14 -1
  57. package/build/heading/index.js.map +1 -1
  58. package/build/image/edit.js +14 -22
  59. package/build/image/edit.js.map +1 -1
  60. package/build/image/image.js +54 -28
  61. package/build/image/image.js.map +1 -1
  62. package/build/image/index.js +7 -0
  63. package/build/image/index.js.map +1 -1
  64. package/build/image/transforms.js +1 -1
  65. package/build/image/transforms.js.map +1 -1
  66. package/build/image/view.js +65 -49
  67. package/build/image/view.js.map +1 -1
  68. package/build/latest-comments/index.js +9 -0
  69. package/build/latest-comments/index.js.map +1 -1
  70. package/build/list/edit.js +3 -3
  71. package/build/list/edit.js.map +1 -1
  72. package/build/list-item/edit.js +3 -3
  73. package/build/list-item/edit.js.map +1 -1
  74. package/build/list-item/hooks/index.js +0 -7
  75. package/build/list-item/hooks/index.js.map +1 -1
  76. package/build/list-item/hooks/use-merge.js +8 -1
  77. package/build/list-item/hooks/use-merge.js.map +1 -1
  78. package/build/list-item/index.js +11 -1
  79. package/build/list-item/index.js.map +1 -1
  80. package/build/loginout/index.js +3 -0
  81. package/build/loginout/index.js.map +1 -1
  82. package/build/media-text/edit.js +3 -2
  83. package/build/media-text/edit.js.map +1 -1
  84. package/build/media-text/index.js +12 -0
  85. package/build/media-text/index.js.map +1 -1
  86. package/build/navigation/edit/navigation-menu-delete-control.js +1 -0
  87. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  88. package/build/navigation/use-navigation-menu.js +5 -1
  89. package/build/navigation/use-navigation-menu.js.map +1 -1
  90. package/build/navigation-link/link-ui.js +13 -17
  91. package/build/navigation-link/link-ui.js.map +1 -1
  92. package/build/navigation-submenu/edit.js +1 -12
  93. package/build/navigation-submenu/edit.js.map +1 -1
  94. package/build/page-list/convert-to-links-modal.js +1 -1
  95. package/build/page-list/convert-to-links-modal.js.map +1 -1
  96. package/build/page-list/edit.js +2 -1
  97. package/build/page-list/edit.js.map +1 -1
  98. package/build/page-list-item/edit.js +4 -1
  99. package/build/page-list-item/edit.js.map +1 -1
  100. package/build/paragraph/index.js +6 -0
  101. package/build/paragraph/index.js.map +1 -1
  102. package/build/paragraph/transforms.js +6 -0
  103. package/build/paragraph/transforms.js.map +1 -1
  104. package/build/post-author/index.js +8 -0
  105. package/build/post-author/index.js.map +1 -1
  106. package/build/post-author-biography/index.js +3 -0
  107. package/build/post-author-biography/index.js.map +1 -1
  108. package/build/post-author-name/index.js +3 -0
  109. package/build/post-author-name/index.js.map +1 -1
  110. package/build/post-content/index.js +3 -0
  111. package/build/post-content/index.js.map +1 -1
  112. package/build/post-date/edit.js +3 -1
  113. package/build/post-date/edit.js.map +1 -1
  114. package/build/post-date/index.js +3 -0
  115. package/build/post-date/index.js.map +1 -1
  116. package/build/post-excerpt/edit.js +1 -0
  117. package/build/post-excerpt/edit.js.map +1 -1
  118. package/build/post-excerpt/index.js +3 -0
  119. package/build/post-excerpt/index.js.map +1 -1
  120. package/build/post-featured-image/index.js +3 -0
  121. package/build/post-featured-image/index.js.map +1 -1
  122. package/build/post-terms/index.js +3 -0
  123. package/build/post-terms/index.js.map +1 -1
  124. package/build/post-title/edit.js +5 -1
  125. package/build/post-title/edit.js.map +1 -1
  126. package/build/post-title/index.js +3 -0
  127. package/build/post-title/index.js.map +1 -1
  128. package/build/query/edit/inspector-controls/author-control.js +3 -1
  129. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  130. package/build/query/edit/inspector-controls/index.js +27 -8
  131. package/build/query/edit/inspector-controls/index.js.map +1 -1
  132. package/build/query/edit/inspector-controls/order-control.js +1 -0
  133. package/build/query/edit/inspector-controls/order-control.js.map +1 -1
  134. package/build/query/edit/inspector-controls/parent-control.js +2 -1
  135. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  136. package/build/query/edit/inspector-controls/sticky-control.js +1 -0
  137. package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
  138. package/build/query/edit/inspector-controls/taxonomy-controls.js +5 -2
  139. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  140. package/build/query/edit/query-content.js +11 -2
  141. package/build/query/edit/query-content.js.map +1 -1
  142. package/build/query/edit/query-placeholder.js +1 -14
  143. package/build/query/edit/query-placeholder.js.map +1 -1
  144. package/build/query/edit/query-toolbar.js +54 -61
  145. package/build/query/edit/query-toolbar.js.map +1 -1
  146. package/build/query/index.js +34 -0
  147. package/build/query/index.js.map +1 -1
  148. package/build/query/utils.js +5 -1
  149. package/build/query/utils.js.map +1 -1
  150. package/build/query/variations.js +9 -55
  151. package/build/query/variations.js.map +1 -1
  152. package/build/query-pagination-numbers/edit.js +1 -0
  153. package/build/query-pagination-numbers/edit.js.map +1 -1
  154. package/build/query-title/edit.js +11 -19
  155. package/build/query-title/edit.js.map +1 -1
  156. package/build/query-title/use-archive-label.js +95 -0
  157. package/build/query-title/use-archive-label.js.map +1 -0
  158. package/build/quote/index.js +15 -1
  159. package/build/quote/index.js.map +1 -1
  160. package/build/search/index.js +3 -0
  161. package/build/search/index.js.map +1 -1
  162. package/build/site-logo/edit.js +4 -1
  163. package/build/site-logo/edit.js.map +1 -1
  164. package/build/site-tagline/edit.js +5 -2
  165. package/build/site-tagline/edit.js.map +1 -1
  166. package/build/site-tagline/index.js +6 -1
  167. package/build/site-tagline/index.js.map +1 -1
  168. package/build/site-title/edit.js +4 -1
  169. package/build/site-title/edit.js.map +1 -1
  170. package/build/site-title/index.js +6 -1
  171. package/build/site-title/index.js.map +1 -1
  172. package/build/social-link/edit.js +27 -7
  173. package/build/social-link/edit.js.map +1 -1
  174. package/build/social-link/icons/soundcloud.js +1 -1
  175. package/build/social-link/icons/soundcloud.js.map +1 -1
  176. package/build/social-links/index.js +12 -0
  177. package/build/social-links/index.js.map +1 -1
  178. package/build/table/edit.js +8 -17
  179. package/build/table/edit.js.map +1 -1
  180. package/build/tag-cloud/edit.js +4 -1
  181. package/build/tag-cloud/edit.js.map +1 -1
  182. package/build/template-part/edit/index.js +5 -3
  183. package/build/template-part/edit/index.js.map +1 -1
  184. package/build/template-part/edit/inner-blocks.js +8 -3
  185. package/build/template-part/edit/inner-blocks.js.map +1 -1
  186. package/build/template-part/edit/placeholder.js +23 -3
  187. package/build/template-part/edit/placeholder.js.map +1 -1
  188. package/build/template-part/edit/title-modal.js +21 -9
  189. package/build/template-part/edit/title-modal.js.map +1 -1
  190. package/build/term-description/index.js +12 -0
  191. package/build/term-description/index.js.map +1 -1
  192. package/build/utils/hooks.js +17 -1
  193. package/build/utils/hooks.js.map +1 -1
  194. package/build/video/deprecated.js +4 -0
  195. package/build/video/deprecated.js.map +1 -1
  196. package/build/video/edit.js +17 -7
  197. package/build/video/edit.js.map +1 -1
  198. package/build/video/index.js +4 -0
  199. package/build/video/index.js.map +1 -1
  200. package/build/video/transforms.js +1 -1
  201. package/build/video/transforms.js.map +1 -1
  202. package/build-module/audio/edit.js +20 -8
  203. package/build-module/audio/edit.js.map +1 -1
  204. package/build-module/audio/index.js +4 -0
  205. package/build-module/audio/index.js.map +1 -1
  206. package/build-module/audio/transforms.js +1 -1
  207. package/build-module/audio/transforms.js.map +1 -1
  208. package/build-module/block/edit.js +38 -24
  209. package/build-module/block/edit.js.map +1 -1
  210. package/build-module/block/index.js +5 -1
  211. package/build-module/block/index.js.map +1 -1
  212. package/build-module/button/edit.js +1 -1
  213. package/build-module/button/edit.js.map +1 -1
  214. package/build-module/buttons/index.js +26 -0
  215. package/build-module/buttons/index.js.map +1 -1
  216. package/build-module/categories/edit.js +21 -4
  217. package/build-module/categories/edit.js.map +1 -1
  218. package/build-module/categories/index.js +8 -0
  219. package/build-module/categories/index.js.map +1 -1
  220. package/build-module/columns/index.js +2 -2
  221. package/build-module/columns/index.js.map +1 -1
  222. package/build-module/cover/edit/inspector-controls.js +2 -1
  223. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  224. package/build-module/embed/embed-preview.js +4 -4
  225. package/build-module/embed/embed-preview.js.map +1 -1
  226. package/build-module/embed/variations.js +40 -35
  227. package/build-module/embed/variations.js.map +1 -1
  228. package/build-module/file/edit.js +15 -7
  229. package/build-module/file/edit.js.map +1 -1
  230. package/build-module/file/index.js +4 -0
  231. package/build-module/file/index.js.map +1 -1
  232. package/build-module/file/transforms.js +2 -3
  233. package/build-module/file/transforms.js.map +1 -1
  234. package/build-module/footnotes/index.js +1 -1
  235. package/build-module/footnotes/index.js.map +1 -1
  236. package/build-module/form-input/edit.js +2 -0
  237. package/build-module/form-input/edit.js.map +1 -1
  238. package/build-module/gallery/deprecated.js +6 -54
  239. package/build-module/gallery/deprecated.js.map +1 -1
  240. package/build-module/gallery/edit.js +10 -9
  241. package/build-module/gallery/edit.js.map +1 -1
  242. package/build-module/gallery/index.js +11 -1
  243. package/build-module/gallery/index.js.map +1 -1
  244. package/build-module/gallery/save.js +0 -11
  245. package/build-module/gallery/save.js.map +1 -1
  246. package/build-module/gallery/shared.js +0 -25
  247. package/build-module/gallery/shared.js.map +1 -1
  248. package/build-module/gallery/transforms.js +29 -80
  249. package/build-module/gallery/transforms.js.map +1 -1
  250. package/build-module/group/deprecated.js +2 -5
  251. package/build-module/group/deprecated.js.map +1 -1
  252. package/build-module/group/index.js +1 -0
  253. package/build-module/group/index.js.map +1 -1
  254. package/build-module/group/placeholder.js +5 -0
  255. package/build-module/group/placeholder.js.map +1 -1
  256. package/build-module/heading/index.js +14 -1
  257. package/build-module/heading/index.js.map +1 -1
  258. package/build-module/image/edit.js +13 -21
  259. package/build-module/image/edit.js.map +1 -1
  260. package/build-module/image/image.js +50 -24
  261. package/build-module/image/image.js.map +1 -1
  262. package/build-module/image/index.js +7 -0
  263. package/build-module/image/index.js.map +1 -1
  264. package/build-module/image/transforms.js +1 -1
  265. package/build-module/image/transforms.js.map +1 -1
  266. package/build-module/image/view.js +65 -49
  267. package/build-module/image/view.js.map +1 -1
  268. package/build-module/latest-comments/index.js +9 -0
  269. package/build-module/latest-comments/index.js.map +1 -1
  270. package/build-module/list/edit.js +3 -3
  271. package/build-module/list/edit.js.map +1 -1
  272. package/build-module/list-item/edit.js +3 -3
  273. package/build-module/list-item/edit.js.map +1 -1
  274. package/build-module/list-item/hooks/index.js +0 -1
  275. package/build-module/list-item/hooks/index.js.map +1 -1
  276. package/build-module/list-item/hooks/use-merge.js +8 -1
  277. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  278. package/build-module/list-item/index.js +11 -1
  279. package/build-module/list-item/index.js.map +1 -1
  280. package/build-module/loginout/index.js +3 -0
  281. package/build-module/loginout/index.js.map +1 -1
  282. package/build-module/media-text/edit.js +3 -2
  283. package/build-module/media-text/edit.js.map +1 -1
  284. package/build-module/media-text/index.js +12 -0
  285. package/build-module/media-text/index.js.map +1 -1
  286. package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -0
  287. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  288. package/build-module/navigation/use-navigation-menu.js +5 -1
  289. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  290. package/build-module/navigation-link/link-ui.js +13 -17
  291. package/build-module/navigation-link/link-ui.js.map +1 -1
  292. package/build-module/navigation-submenu/edit.js +1 -12
  293. package/build-module/navigation-submenu/edit.js.map +1 -1
  294. package/build-module/page-list/convert-to-links-modal.js +1 -1
  295. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  296. package/build-module/page-list/edit.js +2 -1
  297. package/build-module/page-list/edit.js.map +1 -1
  298. package/build-module/page-list-item/edit.js +4 -1
  299. package/build-module/page-list-item/edit.js.map +1 -1
  300. package/build-module/paragraph/index.js +6 -0
  301. package/build-module/paragraph/index.js.map +1 -1
  302. package/build-module/paragraph/transforms.js +6 -0
  303. package/build-module/paragraph/transforms.js.map +1 -1
  304. package/build-module/post-author/index.js +8 -0
  305. package/build-module/post-author/index.js.map +1 -1
  306. package/build-module/post-author-biography/index.js +3 -0
  307. package/build-module/post-author-biography/index.js.map +1 -1
  308. package/build-module/post-author-name/index.js +3 -0
  309. package/build-module/post-author-name/index.js.map +1 -1
  310. package/build-module/post-content/index.js +3 -0
  311. package/build-module/post-content/index.js.map +1 -1
  312. package/build-module/post-date/edit.js +4 -2
  313. package/build-module/post-date/edit.js.map +1 -1
  314. package/build-module/post-date/index.js +3 -0
  315. package/build-module/post-date/index.js.map +1 -1
  316. package/build-module/post-excerpt/edit.js +1 -0
  317. package/build-module/post-excerpt/edit.js.map +1 -1
  318. package/build-module/post-excerpt/index.js +3 -0
  319. package/build-module/post-excerpt/index.js.map +1 -1
  320. package/build-module/post-featured-image/index.js +3 -0
  321. package/build-module/post-featured-image/index.js.map +1 -1
  322. package/build-module/post-terms/index.js +3 -0
  323. package/build-module/post-terms/index.js.map +1 -1
  324. package/build-module/post-title/edit.js +5 -1
  325. package/build-module/post-title/edit.js.map +1 -1
  326. package/build-module/post-title/index.js +3 -0
  327. package/build-module/post-title/index.js.map +1 -1
  328. package/build-module/query/edit/inspector-controls/author-control.js +3 -1
  329. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  330. package/build-module/query/edit/inspector-controls/index.js +28 -9
  331. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  332. package/build-module/query/edit/inspector-controls/order-control.js +1 -0
  333. package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
  334. package/build-module/query/edit/inspector-controls/parent-control.js +2 -1
  335. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  336. package/build-module/query/edit/inspector-controls/sticky-control.js +1 -0
  337. package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
  338. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +6 -4
  339. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  340. package/build-module/query/edit/query-content.js +11 -2
  341. package/build-module/query/edit/query-content.js.map +1 -1
  342. package/build-module/query/edit/query-placeholder.js +1 -14
  343. package/build-module/query/edit/query-placeholder.js.map +1 -1
  344. package/build-module/query/edit/query-toolbar.js +55 -62
  345. package/build-module/query/edit/query-toolbar.js.map +1 -1
  346. package/build-module/query/index.js +34 -0
  347. package/build-module/query/index.js.map +1 -1
  348. package/build-module/query/utils.js +5 -1
  349. package/build-module/query/utils.js.map +1 -1
  350. package/build-module/query/variations.js +4 -50
  351. package/build-module/query/variations.js.map +1 -1
  352. package/build-module/query-pagination-numbers/edit.js +1 -0
  353. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  354. package/build-module/query-title/edit.js +12 -20
  355. package/build-module/query-title/edit.js.map +1 -1
  356. package/build-module/query-title/use-archive-label.js +88 -0
  357. package/build-module/query-title/use-archive-label.js.map +1 -0
  358. package/build-module/quote/index.js +15 -1
  359. package/build-module/quote/index.js.map +1 -1
  360. package/build-module/search/index.js +3 -0
  361. package/build-module/search/index.js.map +1 -1
  362. package/build-module/site-logo/edit.js +4 -1
  363. package/build-module/site-logo/edit.js.map +1 -1
  364. package/build-module/site-tagline/edit.js +5 -2
  365. package/build-module/site-tagline/edit.js.map +1 -1
  366. package/build-module/site-tagline/index.js +6 -1
  367. package/build-module/site-tagline/index.js.map +1 -1
  368. package/build-module/site-title/edit.js +4 -1
  369. package/build-module/site-title/edit.js.map +1 -1
  370. package/build-module/site-title/index.js +6 -1
  371. package/build-module/site-title/index.js.map +1 -1
  372. package/build-module/social-link/edit.js +28 -8
  373. package/build-module/social-link/edit.js.map +1 -1
  374. package/build-module/social-link/icons/soundcloud.js +1 -1
  375. package/build-module/social-link/icons/soundcloud.js.map +1 -1
  376. package/build-module/social-links/index.js +12 -0
  377. package/build-module/social-links/index.js.map +1 -1
  378. package/build-module/table/edit.js +9 -18
  379. package/build-module/table/edit.js.map +1 -1
  380. package/build-module/tag-cloud/edit.js +4 -1
  381. package/build-module/tag-cloud/edit.js.map +1 -1
  382. package/build-module/template-part/edit/index.js +5 -3
  383. package/build-module/template-part/edit/index.js.map +1 -1
  384. package/build-module/template-part/edit/inner-blocks.js +8 -3
  385. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  386. package/build-module/template-part/edit/placeholder.js +23 -3
  387. package/build-module/template-part/edit/placeholder.js.map +1 -1
  388. package/build-module/template-part/edit/title-modal.js +21 -9
  389. package/build-module/template-part/edit/title-modal.js.map +1 -1
  390. package/build-module/term-description/index.js +12 -0
  391. package/build-module/term-description/index.js.map +1 -1
  392. package/build-module/utils/hooks.js +16 -1
  393. package/build-module/utils/hooks.js.map +1 -1
  394. package/build-module/video/deprecated.js +4 -0
  395. package/build-module/video/deprecated.js.map +1 -1
  396. package/build-module/video/edit.js +18 -8
  397. package/build-module/video/edit.js.map +1 -1
  398. package/build-module/video/index.js +4 -0
  399. package/build-module/video/index.js.map +1 -1
  400. package/build-module/video/transforms.js +1 -1
  401. package/build-module/video/transforms.js.map +1 -1
  402. package/build-style/categories/editor-rtl.css +4 -0
  403. package/build-style/categories/editor.css +4 -0
  404. package/build-style/categories/style-rtl.css +4 -0
  405. package/build-style/categories/style.css +4 -0
  406. package/build-style/editor-rtl.css +16 -12
  407. package/build-style/editor.css +16 -12
  408. package/build-style/image/editor-rtl.css +8 -4
  409. package/build-style/image/editor.css +8 -4
  410. package/build-style/image/style-rtl.css +19 -0
  411. package/build-style/image/style.css +19 -0
  412. package/build-style/list/style-rtl.css +1 -1
  413. package/build-style/list/style.css +1 -1
  414. package/build-style/navigation/style-rtl.css +1 -4
  415. package/build-style/navigation/style.css +1 -4
  416. package/build-style/post-comments-form/style-rtl.css +12 -11
  417. package/build-style/post-comments-form/style.css +12 -11
  418. package/build-style/query/editor-rtl.css +3 -7
  419. package/build-style/query/editor.css +3 -7
  420. package/build-style/search/editor-rtl.css +1 -1
  421. package/build-style/search/editor.css +1 -1
  422. package/build-style/social-links/style-rtl.css +93 -93
  423. package/build-style/social-links/style.css +93 -93
  424. package/build-style/style-rtl.css +131 -109
  425. package/build-style/style.css +131 -109
  426. package/build-style/term-description/style-rtl.css +1 -0
  427. package/build-style/term-description/style.css +1 -0
  428. package/package.json +35 -35
  429. package/src/audio/block.json +4 -0
  430. package/src/audio/edit.js +19 -7
  431. package/src/audio/transforms.js +1 -1
  432. package/src/block/block.json +5 -1
  433. package/src/block/edit.js +58 -28
  434. package/src/block/test/edit.native.js +6 -2
  435. package/src/button/edit.js +1 -1
  436. package/src/button/index.php +14 -1
  437. package/src/buttons/block.json +20 -0
  438. package/src/buttons/index.js +6 -0
  439. package/src/categories/block.json +8 -0
  440. package/src/categories/edit.js +32 -4
  441. package/src/categories/editor.scss +4 -0
  442. package/src/categories/index.php +4 -1
  443. package/src/categories/style.scss +4 -0
  444. package/src/columns/index.js +1 -1
  445. package/src/cover/edit/inspector-controls.js +1 -0
  446. package/src/embed/embed-preview.js +4 -6
  447. package/src/embed/test/__snapshots__/index.native.js.snap +8 -8
  448. package/src/embed/test/index.js +1 -1
  449. package/src/embed/test/index.native.js +24 -23
  450. package/src/embed/variations.js +43 -35
  451. package/src/file/block.json +4 -0
  452. package/src/file/edit.js +19 -6
  453. package/src/file/transforms.js +1 -2
  454. package/src/footnotes/index.js +1 -2
  455. package/src/form-input/edit.js +2 -0
  456. package/src/gallery/block.json +10 -0
  457. package/src/gallery/deprecated.js +6 -55
  458. package/src/gallery/edit.js +13 -10
  459. package/src/gallery/gallery-styles.native.scss +0 -2
  460. package/src/gallery/index.js +1 -1
  461. package/src/gallery/save.js +0 -10
  462. package/src/gallery/shared.js +0 -28
  463. package/src/gallery/transforms.js +56 -99
  464. package/src/group/block.json +1 -0
  465. package/src/group/deprecated.js +3 -7
  466. package/src/group/placeholder.js +7 -0
  467. package/src/heading/block.json +12 -0
  468. package/src/heading/index.js +1 -0
  469. package/src/image/block.json +7 -0
  470. package/src/image/edit.js +11 -20
  471. package/src/image/editor.scss +6 -1
  472. package/src/image/image.js +91 -49
  473. package/src/image/index.php +58 -20
  474. package/src/image/style.scss +22 -0
  475. package/src/image/test/edit.native.js +1 -0
  476. package/src/image/transforms.js +1 -1
  477. package/src/image/view.js +69 -49
  478. package/src/latest-comments/block.json +9 -0
  479. package/src/list/edit.js +3 -3
  480. package/src/list/style.scss +1 -1
  481. package/src/list-item/block.json +11 -1
  482. package/src/list-item/edit.js +3 -3
  483. package/src/list-item/hooks/index.js +0 -1
  484. package/src/list-item/hooks/use-merge.js +19 -5
  485. package/src/loginout/block.json +3 -0
  486. package/src/media-text/block.json +12 -0
  487. package/src/media-text/edit.js +3 -2
  488. package/src/navigation/edit/navigation-menu-delete-control.js +1 -0
  489. package/src/navigation/index.php +1 -1
  490. package/src/navigation/style.scss +4 -9
  491. package/src/navigation/test/use-navigation-menu.js +54 -15
  492. package/src/navigation/use-navigation-menu.js +5 -1
  493. package/src/navigation-link/link-ui.js +8 -14
  494. package/src/navigation-submenu/edit.js +2 -14
  495. package/src/page-list/convert-to-links-modal.js +1 -1
  496. package/src/page-list/edit.js +2 -1
  497. package/src/page-list-item/edit.js +4 -4
  498. package/src/paragraph/block.json +6 -0
  499. package/src/post-author/index.js +8 -0
  500. package/src/post-author-biography/block.json +3 -0
  501. package/src/post-author-name/block.json +3 -0
  502. package/src/post-comments-form/style.scss +16 -13
  503. package/src/post-content/block.json +3 -0
  504. package/src/post-date/block.json +3 -0
  505. package/src/post-date/edit.js +5 -1
  506. package/src/post-date/index.php +8 -2
  507. package/src/post-excerpt/block.json +3 -0
  508. package/src/post-excerpt/edit.js +1 -0
  509. package/src/post-featured-image/block.json +3 -0
  510. package/src/post-terms/block.json +3 -0
  511. package/src/post-title/block.json +3 -0
  512. package/src/post-title/edit.js +5 -5
  513. package/src/query/edit/inspector-controls/author-control.js +2 -0
  514. package/src/query/edit/inspector-controls/index.js +44 -16
  515. package/src/query/edit/inspector-controls/order-control.js +1 -0
  516. package/src/query/edit/inspector-controls/parent-control.js +1 -0
  517. package/src/query/edit/inspector-controls/sticky-control.js +1 -0
  518. package/src/query/edit/inspector-controls/taxonomy-controls.js +8 -3
  519. package/src/query/edit/query-content.js +17 -3
  520. package/src/query/edit/query-placeholder.js +1 -21
  521. package/src/query/edit/query-toolbar.js +60 -72
  522. package/src/query/editor.scss +4 -9
  523. package/src/query/index.js +40 -0
  524. package/src/query/utils.js +4 -0
  525. package/src/query/variations.js +4 -46
  526. package/src/query-pagination-numbers/edit.js +1 -0
  527. package/src/query-title/edit.js +10 -17
  528. package/src/query-title/use-archive-label.js +99 -0
  529. package/src/quote/block.json +15 -1
  530. package/src/search/block.json +3 -0
  531. package/src/search/editor.scss +1 -1
  532. package/src/site-logo/edit.js +4 -1
  533. package/src/site-tagline/block.json +6 -1
  534. package/src/site-tagline/edit.js +5 -2
  535. package/src/site-title/edit.js +4 -1
  536. package/src/site-title/index.js +6 -1
  537. package/src/social-link/edit.js +29 -3
  538. package/src/social-link/icons/soundcloud.js +1 -1
  539. package/src/social-link/socials-with-bg.scss +1 -1
  540. package/src/social-link/socials-without-bg.scss +1 -1
  541. package/src/social-links/block.json +12 -0
  542. package/src/social-links/style.scss +2 -2
  543. package/src/table/edit.js +11 -24
  544. package/src/tag-cloud/edit.js +7 -1
  545. package/src/template-part/edit/index.js +5 -3
  546. package/src/template-part/edit/inner-blocks.js +8 -5
  547. package/src/template-part/edit/placeholder.js +31 -6
  548. package/src/template-part/edit/title-modal.js +19 -5
  549. package/src/term-description/block.json +12 -0
  550. package/src/term-description/style.scss +2 -0
  551. package/src/utils/hooks.js +19 -2
  552. package/src/video/block.json +4 -0
  553. package/src/video/edit.js +23 -8
  554. package/src/video/transforms.js +1 -1
  555. package/tsconfig.tsbuildinfo +1 -1
  556. package/build/gallery/edit-wrapper.js +0 -37
  557. package/build/gallery/edit-wrapper.js.map +0 -1
  558. package/build/gallery/v1/constants.js +0 -10
  559. package/build/gallery/v1/constants.js.map +0 -1
  560. package/build/gallery/v1/edit.js +0 -399
  561. package/build/gallery/v1/edit.js.map +0 -1
  562. package/build/gallery/v1/gallery-button.native.js +0 -55
  563. package/build/gallery/v1/gallery-button.native.js.map +0 -1
  564. package/build/gallery/v1/gallery-image.js +0 -285
  565. package/build/gallery/v1/gallery-image.js.map +0 -1
  566. package/build/gallery/v1/gallery-image.native.js +0 -297
  567. package/build/gallery/v1/gallery-image.native.js.map +0 -1
  568. package/build/gallery/v1/gallery.js +0 -112
  569. package/build/gallery/v1/gallery.js.map +0 -1
  570. package/build/gallery/v1/gallery.native.js +0 -139
  571. package/build/gallery/v1/gallery.native.js.map +0 -1
  572. package/build/gallery/v1/save.js +0 -81
  573. package/build/gallery/v1/save.js.map +0 -1
  574. package/build/gallery/v1/shared.js +0 -17
  575. package/build/gallery/v1/shared.js.map +0 -1
  576. package/build/gallery/v1/tiles.native.js +0 -83
  577. package/build/gallery/v1/tiles.native.js.map +0 -1
  578. package/build/list-item/hooks/use-split.js +0 -39
  579. package/build/list-item/hooks/use-split.js.map +0 -1
  580. package/build/utils/constants.js +0 -15
  581. package/build/utils/constants.js.map +0 -1
  582. package/build-module/gallery/edit-wrapper.js +0 -31
  583. package/build-module/gallery/edit-wrapper.js.map +0 -1
  584. package/build-module/gallery/v1/constants.js +0 -4
  585. package/build-module/gallery/v1/constants.js.map +0 -1
  586. package/build-module/gallery/v1/edit.js +0 -393
  587. package/build-module/gallery/v1/edit.js.map +0 -1
  588. package/build-module/gallery/v1/gallery-button.native.js +0 -46
  589. package/build-module/gallery/v1/gallery-button.native.js.map +0 -1
  590. package/build-module/gallery/v1/gallery-image.js +0 -279
  591. package/build-module/gallery/v1/gallery-image.js.map +0 -1
  592. package/build-module/gallery/v1/gallery-image.native.js +0 -291
  593. package/build-module/gallery/v1/gallery-image.native.js.map +0 -1
  594. package/build-module/gallery/v1/gallery.js +0 -104
  595. package/build-module/gallery/v1/gallery.js.map +0 -1
  596. package/build-module/gallery/v1/gallery.native.js +0 -131
  597. package/build-module/gallery/v1/gallery.native.js.map +0 -1
  598. package/build-module/gallery/v1/save.js +0 -74
  599. package/build-module/gallery/v1/save.js.map +0 -1
  600. package/build-module/gallery/v1/shared.js +0 -10
  601. package/build-module/gallery/v1/shared.js.map +0 -1
  602. package/build-module/gallery/v1/tiles.native.js +0 -75
  603. package/build-module/gallery/v1/tiles.native.js.map +0 -1
  604. package/build-module/list-item/hooks/use-split.js +0 -32
  605. package/build-module/list-item/hooks/use-split.js.map +0 -1
  606. package/build-module/utils/constants.js +0 -9
  607. package/build-module/utils/constants.js.map +0 -1
  608. package/src/gallery/edit-wrapper.js +0 -27
  609. package/src/gallery/v1/constants.js +0 -3
  610. package/src/gallery/v1/edit.js +0 -450
  611. package/src/gallery/v1/gallery-button.native.js +0 -47
  612. package/src/gallery/v1/gallery-image-style.native.scss +0 -109
  613. package/src/gallery/v1/gallery-image.js +0 -293
  614. package/src/gallery/v1/gallery-image.native.js +0 -348
  615. package/src/gallery/v1/gallery-styles.native.scss +0 -8
  616. package/src/gallery/v1/gallery.js +0 -125
  617. package/src/gallery/v1/gallery.native.js +0 -162
  618. package/src/gallery/v1/save.js +0 -98
  619. package/src/gallery/v1/shared.js +0 -19
  620. package/src/gallery/v1/tiles-styles.native.scss +0 -11
  621. package/src/gallery/v1/tiles.native.js +0 -79
  622. package/src/list-item/hooks/use-split.js +0 -33
  623. package/src/utils/constants.js +0 -8
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { ToolbarGroup, Dropdown, ToolbarButton, BaseControl, __experimentalNumberControl as NumberControl } from '@wordpress/components';
5
- import { useInstanceId } from '@wordpress/compose';
4
+ import { ToolbarGroup, Dropdown, ToolbarButton, __experimentalNumberControl as NumberControl } from '@wordpress/components';
6
5
  import { __ } from '@wordpress/i18n';
7
6
  import { settings } from '@wordpress/icons';
8
7
 
@@ -23,7 +22,6 @@ export default function QueryToolbar({
23
22
  clientId
24
23
  }) {
25
24
  const hasPatterns = !!usePatterns(clientId, name).length;
26
- const maxPageInputId = useInstanceId(QueryToolbar, 'blocks-query-pagination-max-page-input');
27
25
  return /*#__PURE__*/_jsxs(_Fragment, {
28
26
  children: [!query.inherit && /*#__PURE__*/_jsx(ToolbarGroup, {
29
27
  children: /*#__PURE__*/_jsx(Dropdown, {
@@ -36,65 +34,60 @@ export default function QueryToolbar({
36
34
  onClick: onToggle
37
35
  }),
38
36
  renderContent: () => /*#__PURE__*/_jsxs(_Fragment, {
39
- children: [/*#__PURE__*/_jsx(BaseControl, {
40
- children: /*#__PURE__*/_jsx(NumberControl, {
41
- __unstableInputWidth: "60px",
42
- label: __('Items per Page'),
43
- labelPosition: "edge",
44
- min: 1,
45
- max: 100,
46
- onChange: value => {
47
- if (isNaN(value) || value < 1 || value > 100) {
48
- return;
49
- }
50
- setQuery({
51
- perPage: value
52
- });
53
- },
54
- step: "1",
55
- value: query.perPage,
56
- isDragEnabled: false
57
- })
58
- }), /*#__PURE__*/_jsx(BaseControl, {
59
- children: /*#__PURE__*/_jsx(NumberControl, {
60
- __unstableInputWidth: "60px",
61
- label: __('Offset'),
62
- labelPosition: "edge",
63
- min: 0,
64
- max: 100,
65
- onChange: value => {
66
- if (isNaN(value) || value < 0 || value > 100) {
67
- return;
68
- }
69
- setQuery({
70
- offset: value
71
- });
72
- },
73
- step: "1",
74
- value: query.offset,
75
- isDragEnabled: false
76
- })
77
- }), /*#__PURE__*/_jsx(BaseControl, {
78
- id: maxPageInputId,
79
- help: __('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).'),
80
- children: /*#__PURE__*/_jsx(NumberControl, {
81
- id: maxPageInputId,
82
- __unstableInputWidth: "60px",
83
- label: __('Max page to show'),
84
- labelPosition: "edge",
85
- min: 0,
86
- onChange: value => {
87
- if (isNaN(value) || value < 0) {
88
- return;
89
- }
90
- setQuery({
91
- pages: value
92
- });
93
- },
94
- step: "1",
95
- value: query.pages,
96
- isDragEnabled: false
97
- })
37
+ children: [/*#__PURE__*/_jsx(NumberControl, {
38
+ __unstableInputWidth: "60px",
39
+ className: "block-library-query-toolbar__popover-number-control",
40
+ label: __('Items per Page'),
41
+ labelPosition: "edge",
42
+ min: 1,
43
+ max: 100,
44
+ onChange: value => {
45
+ if (isNaN(value) || value < 1 || value > 100) {
46
+ return;
47
+ }
48
+ setQuery({
49
+ perPage: value
50
+ });
51
+ },
52
+ step: "1",
53
+ value: query.perPage,
54
+ isDragEnabled: false
55
+ }), /*#__PURE__*/_jsx(NumberControl, {
56
+ __unstableInputWidth: "60px",
57
+ className: "block-library-query-toolbar__popover-number-control",
58
+ label: __('Offset'),
59
+ labelPosition: "edge",
60
+ min: 0,
61
+ max: 100,
62
+ onChange: value => {
63
+ if (isNaN(value) || value < 0 || value > 100) {
64
+ return;
65
+ }
66
+ setQuery({
67
+ offset: value
68
+ });
69
+ },
70
+ step: "1",
71
+ value: query.offset,
72
+ isDragEnabled: false
73
+ }), /*#__PURE__*/_jsx(NumberControl, {
74
+ __unstableInputWidth: "60px",
75
+ className: "block-library-query-toolbar__popover-number-control",
76
+ label: __('Max pages to show'),
77
+ labelPosition: "edge",
78
+ min: 0,
79
+ onChange: value => {
80
+ if (isNaN(value) || value < 0) {
81
+ return;
82
+ }
83
+ setQuery({
84
+ pages: value
85
+ });
86
+ },
87
+ step: "1",
88
+ value: query.pages,
89
+ isDragEnabled: false,
90
+ help: __('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
98
91
  })]
99
92
  })
100
93
  })
@@ -1 +1 @@
1
- {"version":3,"names":["ToolbarGroup","Dropdown","ToolbarButton","BaseControl","__experimentalNumberControl","NumberControl","useInstanceId","__","settings","usePatterns","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","QueryToolbar","attributes","query","setQuery","openPatternSelectionModal","name","clientId","hasPatterns","length","maxPageInputId","children","inherit","contentClassName","renderToggle","onToggle","icon","label","onClick","renderContent","__unstableInputWidth","labelPosition","min","max","onChange","value","isNaN","perPage","step","isDragEnabled","offset","id","help","pages","className"],"sources":["@wordpress/block-library/src/query/edit/query-toolbar.js"],"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 } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { usePatterns } from '../utils';\n\nexport default function QueryToolbar( {\n\tattributes: { query },\n\tsetQuery,\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\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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AG,CAAG;cACTE,QAAQ,EAAKC,KAAK,IAAM;gBACvB,IAAKC,KAAK,CAAED,KAAM,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAG;kBAClC;gBACD;gBACArB,QAAQ,CAAE;kBAAE6B,KAAK,EAAER;gBAAM,CAAE,CAAC;cAC7B,CAAG;cACHG,IAAI,EAAC,GAAG;cACRH,KAAK,EAAGtB,KAAK,CAAC8B,KAAO;cACrBJ,aAAa,EAAG;YAAO,CACvB;UAAC,CACU,CAAC;QAAA,CACb;MACA,CACH;IAAC,CACW,CACd,EACCrB,WAAW,iBACZZ,IAAA,CAACX,YAAY;MAACiD,SAAS,EAAC,6CAA6C;MAAAvB,QAAA,eACpEf,IAAA,CAACT,aAAa;QAAC+B,OAAO,EAAGb,yBAA2B;QAAAM,QAAA,EACjDnB,EAAE,CAAE,SAAU;MAAC,CACH;IAAC,CACH,CACd;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["ToolbarGroup","Dropdown","ToolbarButton","__experimentalNumberControl","NumberControl","__","settings","usePatterns","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","QueryToolbar","attributes","query","setQuery","openPatternSelectionModal","name","clientId","hasPatterns","length","children","inherit","contentClassName","renderToggle","onToggle","icon","label","onClick","renderContent","__unstableInputWidth","className","labelPosition","min","max","onChange","value","isNaN","perPage","step","isDragEnabled","offset","pages","help"],"sources":["@wordpress/block-library/src/query/edit/query-toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarGroup,\n\tDropdown,\n\tToolbarButton,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { usePatterns } from '../utils';\n\nexport default function QueryToolbar( {\n\tattributes: { query },\n\tsetQuery,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst hasPatterns = !! usePatterns( clientId, name ).length;\n\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<NumberControl\n\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-query-toolbar__popover-number-control\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Items per Page' ) }\n\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tisNaN( value ) ||\n\t\t\t\t\t\t\t\t\t\t\tvalue < 1 ||\n\t\t\t\t\t\t\t\t\t\t\tvalue > 100\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\t\t\tperPage: value,\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\tvalue={ query.perPage }\n\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-query-toolbar__popover-number-control\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Offset' ) }\n\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tisNaN( value ) ||\n\t\t\t\t\t\t\t\t\t\t\tvalue < 0 ||\n\t\t\t\t\t\t\t\t\t\t\tvalue > 100\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tsetQuery( { offset: value } );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\tvalue={ query.offset }\n\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"60px\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-query-toolbar__popover-number-control\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Max pages to show' ) }\n\t\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\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\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tsetQuery( { pages: value } );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\tvalue={ query.pages }\n\t\t\t\t\t\t\t\t\tisDragEnabled={ false }\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</>\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</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,YAAY,EACZC,QAAQ,EACRC,aAAa,EACbC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEvC,eAAe,SAASC,YAAYA,CAAE;EACrCC,UAAU,EAAE;IAAEC;EAAM,CAAC;EACrBC,QAAQ;EACRC,yBAAyB;EACzBC,IAAI;EACJC;AACD,CAAC,EAAG;EACH,MAAMC,WAAW,GAAG,CAAC,CAAEd,WAAW,CAAEa,QAAQ,EAAED,IAAK,CAAC,CAACG,MAAM;EAE3D,oBACCT,KAAA,CAAAF,SAAA;IAAAY,QAAA,GACG,CAAEP,KAAK,CAACQ,OAAO,iBAChBf,IAAA,CAACT,YAAY;MAAAuB,QAAA,eACZd,IAAA,CAACR,Q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GAAG;YACRH,KAAK,EAAGtB,KAAK,CAAC2B,MAAQ;YACtBD,aAAa,EAAG;UAAO,CACvB,CAAC,eACFjC,IAAA,CAACL,aAAa;YACb4B,oBAAoB,EAAC,MAAM;YAC3BC,SAAS,EAAC,qDAAqD;YAC/DJ,KAAK,EAAGxB,EAAE,CAAE,mBAAoB,CAAG;YACnC6B,aAAa,EAAC,MAAM;YACpBC,GAAG,EAAG,CAAG;YACTE,QAAQ,EAAKC,KAAK,IAAM;cACvB,IAAKC,KAAK,CAAED,KAAM,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAG;gBAClC;cACD;cACArB,QAAQ,CAAE;gBAAE2B,KAAK,EAAEN;cAAM,CAAE,CAAC;YAC7B,CAAG;YACHG,IAAI,EAAC,GAAG;YACRH,KAAK,EAAGtB,KAAK,CAAC4B,KAAO;YACrBF,aAAa,EAAG,KAAO;YACvBG,IAAI,EAAGxC,EAAE,CACR,uGACD;UAAG,CACH,CAAC;QAAA,CACD;MACA,CACH;IAAC,CACW,CACd,EACCgB,WAAW,iBACZZ,IAAA,CAACT,YAAY;MAACiC,SAAS,EAAC,6CAA6C;MAAAV,QAAA,eACpEd,IAAA,CAACP,aAAa;QAAC4B,OAAO,EAAGZ,yBAA2B;QAAAK,QAAA,EACjDlB,EAAE,CAAE,SAAU;MAAC,CACH;IAAC,CACH,CACd;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -74,6 +74,40 @@ export { metadata, name };
74
74
  export const settings = {
75
75
  icon,
76
76
  edit,
77
+ example: {
78
+ viewportWidth: 650,
79
+ attributes: {
80
+ namespace: 'core/posts-list',
81
+ query: {
82
+ perPage: 4,
83
+ pages: 1,
84
+ offset: 0,
85
+ postType: 'post',
86
+ order: 'desc',
87
+ orderBy: 'date',
88
+ author: '',
89
+ search: '',
90
+ sticky: 'exclude',
91
+ inherit: false
92
+ }
93
+ },
94
+ innerBlocks: [{
95
+ name: 'core/post-template',
96
+ attributes: {
97
+ layout: {
98
+ type: 'grid',
99
+ columnCount: 2
100
+ }
101
+ },
102
+ innerBlocks: [{
103
+ name: 'core/post-title'
104
+ }, {
105
+ name: 'core/post-date'
106
+ }, {
107
+ name: 'core/post-excerpt'
108
+ }]
109
+ }]
110
+ },
77
111
  save,
78
112
  variations,
79
113
  deprecated
@@ -1 +1 @@
1
- {"version":3,"names":["loop","icon","initBlock","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","queryId","type","query","perPage","pages","offset","postType","order","orderBy","author","search","exclude","sticky","inherit","taxQuery","parents","tagName","namespace","enhancedPagination","providesContext","displayLayout","supports","align","html","layout","interactivity","editorStyle","edit","save","variations","deprecated","settings","init"],"sources":["@wordpress/block-library/src/query/index.js"],"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';\nimport variations from './variations';\nimport deprecated from './deprecated';\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 = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAI,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;IAAA;IAAAC,KAAA;MAAAD,IAAA;MAAA;QAAAE,OAAA;QAAAC,KAAA;QAAAC,MAAA;QAAAC,QAAA;QAAAC,KAAA;QAAAC,OAAA;QAAAC,MAAA;QAAAC,MAAA;QAAAC,OAAA;QAAAC,MAAA;QAAAC,OAAA;QAAAC,QAAA;QAAAC,OAAA;MAAA;IAAA;IAAAC,OAAA;MAAAf,IAAA;MAAA;IAAA;IAAAgB,SAAA;MAAAhB,IAAA;IAAA;IAAAiB,kBAAA;MAAAjB,IAAA;MAAA;IAAA;EAAA;EAAAkB,eAAA;IAAAnB,OAAA;IAAAE,KAAA;IAAAkB,aAAA;IAAAF,kBAAA;EAAA;EAAAG,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,MAAA;IAAAC,aAAA;EAAA;EAAAC,WAAA;AAAA;AAE5C,OAAOC,IAAI,MAAM,QAAQ;AACzB,OAAOC,IAAI,MAAM,QAAQ;AACzB,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,UAAU,MAAM,cAAc;AAErC,MAAM;EAAEpC;AAAK,CAAC,GAAGH,QAAQ;AACzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMqC,QAAQ,GAAG;EACvB1C,IAAI;EACJsC,IAAI;EACJC,IAAI;EACJC,UAAU;EACVC;AACD,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAM1C,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAEwC;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["loop","icon","initBlock","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","queryId","type","query","perPage","pages","offset","postType","order","orderBy","author","search","exclude","sticky","inherit","taxQuery","parents","tagName","namespace","enhancedPagination","providesContext","displayLayout","supports","align","html","layout","interactivity","editorStyle","edit","save","variations","deprecated","settings","example","viewportWidth","innerBlocks","columnCount","init"],"sources":["@wordpress/block-library/src/query/index.js"],"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';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\texample: {\n\t\tviewportWidth: 650,\n\t\tattributes: {\n\t\t\tnamespace: 'core/posts-list',\n\t\t\tquery: {\n\t\t\t\tperPage: 4,\n\t\t\t\tpages: 1,\n\t\t\t\toffset: 0,\n\t\t\t\tpostType: 'post',\n\t\t\t\torder: 'desc',\n\t\t\t\torderBy: 'date',\n\t\t\t\tauthor: '',\n\t\t\t\tsearch: '',\n\t\t\t\tsticky: 'exclude',\n\t\t\t\tinherit: false,\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/post-template',\n\t\t\t\tattributes: {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tinnerBlocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-title',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-date',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-excerpt',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAI,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;IAAA;IAAAC,KAAA;MAAAD,IAAA;MAAA;QAAAE,OAAA;QAAAC,KAAA;QAAAC,MAAA;QAAAC,QAAA;QAAAC,KAAA;QAAAC,OAAA;QAAAC,MAAA;QAAAC,MAAA;QAAAC,OAAA;QAAAC,MAAA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AAI,EAAE;MACP,CAAC;IAEH,CAAC;EAEH,CAAC;EACDkC,IAAI;EACJC,UAAU;EACVC;AACD,CAAC;AAED,OAAO,MAAMM,IAAI,GAAGA,CAAA,KAAM9C,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAEwC;AAAS,CAAE,CAAC","ignoreList":[]}
@@ -207,7 +207,8 @@ export const getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) =>
207
207
  query: {
208
208
  postType,
209
209
  inherit
210
- }
210
+ },
211
+ namespace
211
212
  } = queryBlockAttributes;
212
213
  const clonedBlocks = blocks.map(block => cloneBlock(block));
213
214
  const queryClientIds = [];
@@ -220,6 +221,9 @@ export const getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) =>
220
221
  postType,
221
222
  inherit
222
223
  };
224
+ if (namespace) {
225
+ block.attributes.namespace = namespace;
226
+ }
223
227
  queryClientIds.push(block.clientId);
224
228
  }
225
229
  block.innerBlocks?.forEach(innerBlock => {
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useMemo","store","coreStore","blockEditorStore","decodeEntities","cloneBlock","getBlockSupport","blocksStore","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","usePostTypes","postTypes","select","getPostTypes","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","visibility","publicly_queryable","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","getActiveBlockVariation","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","hasActiveVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","namespace","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","blockSupportsInteractivity","Object","is","blockSupportsInteractivityClientNavigation","blockInteractivity","hasBlocksFromPlugins","hasPostContentBlock","hasUnsupportedBlocks"],"sources":["@wordpress/block-library/src/query/utils.js"],"sourcesContent":["/**\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 {\n\tcloneBlock,\n\tgetBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\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 return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\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( getValueFromObjectPath( 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 ) {\n\t\t\treturn;\n\t\t}\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\treturn getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn taxonomies?.filter(\n\t\t\t( { visibility } ) => !! visibility?.publicly_queryable\n\t\t);\n\t}, [ 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\t'core/query',\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\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `core/query/${ activeVariationName }`;\n\tconst hasActiveVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn false;\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\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\tblockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t\treturn activePatterns.length > 0;\n\t\t},\n\t\t[ clientId, activeVariationName, blockName ]\n\t);\n\treturn hasActiveVariationPatterns ? blockName : 'core/query';\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\t'core/query',\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( 'core/query', '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\n/**\n * The object returned by useUnsupportedBlocks with info about the type of\n * unsupported blocks present inside the Query block.\n *\n * @typedef {Object} UnsupportedBlocksInfo\n * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present.\n * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present.\n * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks.\n */\n\n/**\n * Hook that returns an object with information about the unsupported blocks\n * present inside a Query Loop with the given `clientId`. The returned object\n * contains props that are true when a certain type of unsupported block is\n * present.\n *\n * @param {string} clientId The block's client ID.\n * @return {UnsupportedBlocksInfo} The object containing the information.\n */\nexport const useUnsupportedBlocks = ( clientId ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getClientIdsOfDescendants, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst blocks = {};\n\t\t\tgetClientIdsOfDescendants( clientId ).forEach(\n\t\t\t\t( descendantClientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( descendantClientId );\n\t\t\t\t\t/*\n\t\t\t\t\t * Client side navigation can be true in two states:\n\t\t\t\t\t * - supports.interactivity = true;\n\t\t\t\t\t * - supports.interactivity.clientNavigation = true;\n\t\t\t\t\t */\n\t\t\t\t\tconst blockSupportsInteractivity = Object.is(\n\t\t\t\t\t\tgetBlockSupport( blockName, 'interactivity' ),\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\tconst blockSupportsInteractivityClientNavigation =\n\t\t\t\t\t\tgetBlockSupport(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\t'interactivity.clientNavigation'\n\t\t\t\t\t\t);\n\t\t\t\t\tconst blockInteractivity =\n\t\t\t\t\t\tblockSupportsInteractivity ||\n\t\t\t\t\t\tblockSupportsInteractivityClientNavigation;\n\t\t\t\t\tif ( ! blockInteractivity ) {\n\t\t\t\t\t\tblocks.hasBlocksFromPlugins = true;\n\t\t\t\t\t} else if ( blockName === 'core/post-content' ) {\n\t\t\t\t\t\tblocks.hasPostContentBlock = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\tblocks.hasUnsupportedBlocks =\n\t\t\t\tblocks.hasBlocksFromPlugins || blocks.hasPostContentBlock;\n\t\t\treturn blocks;\n\t\t},\n\t\t[ clientId ]\n\t);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,cAAc,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ACbiC,MAAM,IAAM;IACb,MAAM;MAAE+D,yBAAyB;MAAEC;IAAa,CAAC,GAChDhE,MAAM,CAAE7B,gBAAiB,CAAC;IAC3B,MAAM6D,MAAM,GAAG,CAAC,CAAC;IACjB+B,yBAAyB,CAAEtB,QAAS,CAAC,CAAC/C,OAAO,CAC1CuE,kBAAkB,IAAM;MACzB,MAAMlB,SAAS,GAAGiB,YAAY,CAAEC,kBAAmB,CAAC;MACpD;AACL;AACA;AACA;AACA;MACK,MAAMC,0BAA0B,GAAGC,MAAM,CAACC,EAAE,CAC3C9F,eAAe,CAAEyE,SAAS,EAAE,eAAgB,CAAC,EAC7C,IACD,CAAC;MACD,MAAMsB,0CAA0C,GAC/C/F,eAAe,CACdyE,SAAS,EACT,gCACD,CAAC;MACF,MAAMuB,kBAAkB,GACvBJ,0BAA0B,IAC1BG,0CAA0C;MAC3C,IAAK,CAAEC,kBAAkB,EAAG;QAC3BtC,MAAM,CAACuC,oBAAoB,GAAG,IAAI;MACnC,CAAC,MAAM,IAAKxB,SAAS,KAAK,mBAAmB,EAAG;QAC/Cf,MAAM,CAACwC,mBAAmB,GAAG,IAAI;MAClC;IACD,CACD,CAAC;IACDxC,MAAM,CAACyC,oBAAoB,GAC1BzC,MAAM,CAACuC,oBAAoB,IAAIvC,MAAM,CAACwC,mBAAmB;IAC1D,OAAOxC,MAAM;EACd,CAAC,EACD,CAAES,QAAQ,CACX,CAAC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useMemo","store","coreStore","blockEditorStore","decodeEntities","cloneBlock","getBlockSupport","blocksStore","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","usePostTypes","postTypes","select","getPostTypes","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","visibility","publicly_queryable","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","getActiveBlockVariation","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","namespace","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","hasActiveVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","blockSupportsInteractivity","Object","is","blockSupportsInteractivityClientNavigation","blockInteractivity","hasBlocksFromPlugins","hasPostContentBlock","hasUnsupportedBlocks"],"sources":["@wordpress/block-library/src/query/utils.js"],"sourcesContent":["/**\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 {\n\tcloneBlock,\n\tgetBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\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 return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\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( getValueFromObjectPath( 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 ) {\n\t\t\treturn;\n\t\t}\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\treturn getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn taxonomies?.filter(\n\t\t\t( { visibility } ) => !! visibility?.publicly_queryable\n\t\t);\n\t}, [ 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\t'core/query',\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\tnamespace,\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\tif ( namespace ) {\n\t\t\t\tblock.attributes.namespace = namespace;\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\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `core/query/${ activeVariationName }`;\n\tconst hasActiveVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn false;\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\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\tblockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t\treturn activePatterns.length > 0;\n\t\t},\n\t\t[ clientId, activeVariationName, blockName ]\n\t);\n\treturn hasActiveVariationPatterns ? blockName : 'core/query';\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\t'core/query',\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( 'core/query', '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\n/**\n * The object returned by useUnsupportedBlocks with info about the type of\n * unsupported blocks present inside the Query block.\n *\n * @typedef {Object} UnsupportedBlocksInfo\n * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present.\n * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present.\n * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks.\n */\n\n/**\n * Hook that returns an object with information about the unsupported blocks\n * present inside a Query Loop with the given `clientId`. The returned object\n * contains props that are true when a certain type of unsupported block is\n * present.\n *\n * @param {string} clientId The block's client ID.\n * @return {UnsupportedBlocksInfo} The object containing the information.\n */\nexport const useUnsupportedBlocks = ( clientId ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getClientIdsOfDescendants, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst blocks = {};\n\t\t\tgetClientIdsOfDescendants( clientId ).forEach(\n\t\t\t\t( descendantClientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( descendantClientId );\n\t\t\t\t\t/*\n\t\t\t\t\t * Client side navigation can be true in two states:\n\t\t\t\t\t * - supports.interactivity = true;\n\t\t\t\t\t * - supports.interactivity.clientNavigation = true;\n\t\t\t\t\t */\n\t\t\t\t\tconst blockSupportsInteractivity = Object.is(\n\t\t\t\t\t\tgetBlockSupport( blockName, 'interactivity' ),\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\tconst blockSupportsInteractivityClientNavigation =\n\t\t\t\t\t\tgetBlockSupport(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\t'interactivity.clientNavigation'\n\t\t\t\t\t\t);\n\t\t\t\t\tconst blockInteractivity =\n\t\t\t\t\t\tblockSupportsInteractivity ||\n\t\t\t\t\t\tblockSupportsInteractivityClientNavigation;\n\t\t\t\t\tif ( ! blockInteractivity ) {\n\t\t\t\t\t\tblocks.hasBlocksFromPlugins = true;\n\t\t\t\t\t} else if ( blockName === 'core/post-content' ) {\n\t\t\t\t\t\tblocks.hasPostContentBlock = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\tblocks.hasUnsupportedBlocks =\n\t\t\t\tblocks.hasBlocksFromPlugins || blocks.hasPostContentBlock;\n\t\t\treturn blocks;\n\t\t},\n\t\t[ clientId ]\n\t);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SACCC,UAAU,EACVC,eAAe,EACfL,KAAK,IAAIM,WAAW,QACd,mBAAmB;;AAE1B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAKC,QAAQ,IAAM;EAC9C,MAAMC,OAAO,GAAGD,QAAQ,EAAEE,MAAM,CAC/B,CAAEC,WAAW,EAAEC,MAAM,KAAM;IAC1B,MAAM;MAAEC,OAAO;MAAEC,SAAS;MAAEC;IAAM,CAAC,GAAGJ,WAAW;IACjDE,OAAO,CAAED,MAAM,CAACI,EAAE,CAAE,GAAGJ,MAAM;IAC7BE,SAAS,CAAEF,MAAM,CAACK,IAAI,CAAE,GAAGL,MAAM;IACjCG,KAAK,CAACG,IAAI,CAAEN,MAAM,CAACK,IAAK,CAAC;IACzB,OAAON,WAAW;EACnB,CAAC,EACD;IAAEE,OAAO,EAAE,CAAC,CAAC;IAAEC,SAAS,EAAE,CAAC,CAAC;IAAEC,KAAK,EAAE;EAAG,CACzC,CAAC;EACD,OAAO;IACNP,QAAQ;IACR,GAAGC;EACJ,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,sBAAsB,GAAGA,CAAEC,MAAM,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AAoB,IAAIvC,MAAM,CAACwC,mBAAmB;IAC1D,OAAOxC,MAAM;EACd,CAAC,EACD,CAAEU,QAAQ,CACX,CAAC;AACF,CAAC","ignoreList":[]}
@@ -2,83 +2,37 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { postList } from '@wordpress/icons';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
9
  import { titleDate, titleExcerpt, titleDateExcerpt, imageDateTitle } from './icons';
11
- const QUERY_DEFAULT_ATTRIBUTES = {
12
- query: {
13
- perPage: 3,
14
- pages: 0,
15
- offset: 0,
16
- postType: 'post',
17
- order: 'desc',
18
- orderBy: 'date',
19
- author: '',
20
- search: '',
21
- exclude: [],
22
- sticky: '',
23
- inherit: false
24
- }
25
- };
26
10
  const variations = [{
27
- name: 'posts-list',
28
- title: __('Posts List'),
29
- description: __('Display a list of your most recent posts, excluding sticky posts.'),
30
- icon: postList,
31
- attributes: {
32
- namespace: 'core/posts-list',
33
- query: {
34
- perPage: 4,
35
- pages: 1,
36
- offset: 0,
37
- postType: 'post',
38
- order: 'desc',
39
- orderBy: 'date',
40
- author: '',
41
- search: '',
42
- sticky: 'exclude',
43
- inherit: false
44
- }
45
- },
46
- scope: ['inserter'],
47
- isActive: ['namespace', 'query.postType']
48
- }, {
49
11
  name: 'title-date',
50
12
  title: __('Title & Date'),
51
13
  icon: titleDate,
52
- attributes: {
53
- ...QUERY_DEFAULT_ATTRIBUTES
54
- },
14
+ attributes: {},
55
15
  innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']],
56
16
  scope: ['block']
57
17
  }, {
58
18
  name: 'title-excerpt',
59
19
  title: __('Title & Excerpt'),
60
20
  icon: titleExcerpt,
61
- attributes: {
62
- ...QUERY_DEFAULT_ATTRIBUTES
63
- },
21
+ attributes: {},
64
22
  innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
65
23
  scope: ['block']
66
24
  }, {
67
25
  name: 'title-date-excerpt',
68
26
  title: __('Title, Date, & Excerpt'),
69
27
  icon: titleDateExcerpt,
70
- attributes: {
71
- ...QUERY_DEFAULT_ATTRIBUTES
72
- },
28
+ attributes: {},
73
29
  innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
74
30
  scope: ['block']
75
31
  }, {
76
32
  name: 'image-date-title',
77
33
  title: __('Image, Date, & Title'),
78
34
  icon: imageDateTitle,
79
- attributes: {
80
- ...QUERY_DEFAULT_ATTRIBUTES
81
- },
35
+ attributes: {},
82
36
  innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']],
83
37
  scope: ['block']
84
38
  }];
@@ -1 +1 @@
1
- {"version":3,"names":["__","postList","titleDate","titleExcerpt","titleDateExcerpt","imageDateTitle","QUERY_DEFAULT_ATTRIBUTES","query","perPage","pages","offset","postType","order","orderBy","author","search","exclude","sticky","inherit","variations","name","title","description","icon","attributes","namespace","scope","isActive","innerBlocks"],"sources":["@wordpress/block-library/src/query/variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { postList } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\ttitleDate,\n\ttitleExcerpt,\n\ttitleDateExcerpt,\n\timageDateTitle,\n} from './icons';\n\nconst QUERY_DEFAULT_ATTRIBUTES = {\n\tquery: {\n\t\tperPage: 3,\n\t\tpages: 0,\n\t\toffset: 0,\n\t\tpostType: 'post',\n\t\torder: 'desc',\n\t\torderBy: 'date',\n\t\tauthor: '',\n\t\tsearch: '',\n\t\texclude: [],\n\t\tsticky: '',\n\t\tinherit: false,\n\t},\n};\n\nconst variations = [\n\t{\n\t\tname: 'posts-list',\n\t\ttitle: __( 'Posts List' ),\n\t\tdescription: __(\n\t\t\t'Display a list of your most recent posts, excluding sticky posts.'\n\t\t),\n\t\ticon: postList,\n\t\tattributes: {\n\t\t\tnamespace: 'core/posts-list',\n\t\t\tquery: {\n\t\t\t\tperPage: 4,\n\t\t\t\tpages: 1,\n\t\t\t\toffset: 0,\n\t\t\t\tpostType: 'post',\n\t\t\t\torder: 'desc',\n\t\t\t\torderBy: 'date',\n\t\t\t\tauthor: '',\n\t\t\t\tsearch: '',\n\t\t\t\tsticky: 'exclude',\n\t\t\t\tinherit: false,\n\t\t\t},\n\t\t},\n\t\tscope: [ 'inserter' ],\n\t\tisActive: [ 'namespace', 'query.postType' ],\n\t},\n\t{\n\t\tname: 'title-date',\n\t\ttitle: __( 'Title & Date' ),\n\t\ticon: titleDate,\n\t\tattributes: { ...QUERY_DEFAULT_ATTRIBUTES },\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[ [ 'core/post-title' ], [ 'core/post-date' ] ],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'title-excerpt',\n\t\ttitle: __( 'Title & Excerpt' ),\n\t\ticon: titleExcerpt,\n\t\tattributes: { ...QUERY_DEFAULT_ATTRIBUTES },\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[ [ 'core/post-title' ], [ 'core/post-excerpt' ] ],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'title-date-excerpt',\n\t\ttitle: __( 'Title, Date, & Excerpt' ),\n\t\ticon: titleDateExcerpt,\n\t\tattributes: { ...QUERY_DEFAULT_ATTRIBUTES },\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[\n\t\t\t\t\t[ 'core/post-title' ],\n\t\t\t\t\t[ 'core/post-date' ],\n\t\t\t\t\t[ 'core/post-excerpt' ],\n\t\t\t\t],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'image-date-title',\n\t\ttitle: __( 'Image, Date, & Title' ),\n\t\ticon: imageDateTitle,\n\t\tattributes: { ...QUERY_DEFAULT_ATTRIBUTES },\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[\n\t\t\t\t\t[ 'core/post-featured-image' ],\n\t\t\t\t\t[ 'core/post-date' ],\n\t\t\t\t\t[ 'core/post-title' ],\n\t\t\t\t],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n];\n\nexport default variations;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;AACA,SACCC,SAAS,EACTC,YAAY,EACZC,gBAAgB,EAChBC,cAAc,QACR,SAAS;AAEhB,MAAMC,wBAAwB,GAAG;EAChCC,KAAK,EAAE;IACNC,OAAO,EAAE,CAAC;IACVC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,QAAQ,EAAE,MAAM;IAChBC,KAAK,EAAE,MAAM;IACbC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,EAAE;IACVC,MAAM,EAAE,EAAE;IACVC,OAAO,EAAE,EAAE;IACXC,MAAM,EAAE,EAAE;IACVC,OAAO,EAAE;EACV;AACD,CAAC;AAED,MAAMC,UAAU,GAAG,CAClB;EACCC,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAErB,EAAE,C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;EACDF,KAAK,EAAE,CAAE,OAAO;AACjB,CAAC,EACD;EACCN,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAErB,EAAE,CAAE,wBAAyB,CAAC;EACrCuB,IAAI,EAAEnB,gBAAgB;EACtBoB,UAAU,EAAE;IAAE,GAAGlB;EAAyB,CAAC;EAC3CsB,WAAW,EAAE,CACZ,CACC,oBAAoB,EACpB,CAAC,CAAC,EACF,CACC,CAAE,iBAAiB,CAAE,EACrB,CAAE,gBAAgB,CAAE,EACpB,CAAE,mBAAmB,CAAE,CACvB,CACD,EACD,CAAE,uBAAuB,CAAE,EAC3B,CAAE,uBAAuB,CAAE,CAC3B;EACDF,KAAK,EAAE,CAAE,OAAO;AACjB,CAAC,EACD;EACCN,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAErB,EAAE,CAAE,sBAAuB,CAAC;EACnCuB,IAAI,EAAElB,cAAc;EACpBmB,UAAU,EAAE;IAAE,GAAGlB;EAAyB,CAAC;EAC3CsB,WAAW,EAAE,CACZ,CACC,oBAAoB,EACpB,CAAC,CAAC,EACF,CACC,CAAE,0BAA0B,CAAE,EAC9B,CAAE,gBAAgB,CAAE,EACpB,CAAE,iBAAiB,CAAE,CACrB,CACD,EACD,CAAE,uBAAuB,CAAE,EAC3B,CAAE,uBAAuB,CAAE,CAC3B;EACDF,KAAK,EAAE,CAAE,OAAO;AACjB,CAAC,CACD;AAED,eAAeP,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["__","titleDate","titleExcerpt","titleDateExcerpt","imageDateTitle","variations","name","title","icon","attributes","innerBlocks","scope"],"sources":["@wordpress/block-library/src/query/variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\ttitleDate,\n\ttitleExcerpt,\n\ttitleDateExcerpt,\n\timageDateTitle,\n} from './icons';\n\nconst variations = [\n\t{\n\t\tname: 'title-date',\n\t\ttitle: __( 'Title & Date' ),\n\t\ticon: titleDate,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[ [ 'core/post-title' ], [ 'core/post-date' ] ],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'title-excerpt',\n\t\ttitle: __( 'Title & Excerpt' ),\n\t\ticon: titleExcerpt,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[ [ 'core/post-title' ], [ 'core/post-excerpt' ] ],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'title-date-excerpt',\n\t\ttitle: __( 'Title, Date, & Excerpt' ),\n\t\ticon: titleDateExcerpt,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[\n\t\t\t\t\t[ 'core/post-title' ],\n\t\t\t\t\t[ 'core/post-date' ],\n\t\t\t\t\t[ 'core/post-excerpt' ],\n\t\t\t\t],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'image-date-title',\n\t\ttitle: __( 'Image, Date, & Title' ),\n\t\ticon: imageDateTitle,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[\n\t\t\t\t\t[ 'core/post-featured-image' ],\n\t\t\t\t\t[ 'core/post-date' ],\n\t\t\t\t\t[ 'core/post-title' ],\n\t\t\t\t],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],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B,CAAE,mBAAmB,CAAE,CACvB,CACD,EACD,CAAE,uBAAuB,CAAE,EAC3B,CAAE,uBAAuB,CAAE,CAC3B;EACDC,KAAK,EAAE,CAAE,OAAO;AACjB,CAAC,EACD;EACCL,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAEP,EAAE,CAAE,sBAAuB,CAAC;EACnCQ,IAAI,EAAEJ,cAAc;EACpBK,UAAU,EAAE,CAAC,CAAC;EACdC,WAAW,EAAE,CACZ,CACC,oBAAoB,EACpB,CAAC,CAAC,EACF,CACC,CAAE,0BAA0B,CAAE,EAC9B,CAAE,gBAAgB,CAAE,EACpB,CAAE,iBAAiB,CAAE,CACrB,CACD,EACD,CAAE,uBAAuB,CAAE,EAC3B,CAAE,uBAAuB,CAAE,CAC3B;EACDC,KAAK,EAAE,CAAE,OAAO;AACjB,CAAC,CACD;AAED,eAAeN,UAAU","ignoreList":[]}
@@ -49,6 +49,7 @@ export default function QueryPaginationNumbersEdit({
49
49
  children: /*#__PURE__*/_jsx(PanelBody, {
50
50
  title: __('Settings'),
51
51
  children: /*#__PURE__*/_jsx(RangeControl, {
52
+ __nextHasNoMarginBottom: true,
52
53
  label: __('Number of links'),
53
54
  help: __('Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'),
54
55
  value: midSize,
@@ -1 +1 @@
1
- {"version":3,"names":["__","InspectorControls","useBlockProps","PanelBody","RangeControl","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","createPaginationItem","content","Tag","extraClass","className","children","previewPaginationNumbers","midSize","paginationItems","i","push","QueryPaginationNumbersEdit","attributes","setAttributes","paginationNumbers","parseInt","title","label","help","value","onChange","min","max","withInputField"],"sources":["@wordpress/block-library/src/query-pagination-numbers/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { PanelBody, RangeControl } from '@wordpress/components';\n\nconst createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => (\n\t<Tag key={ content } className={ `page-numbers ${ extraClass }` }>\n\t\t{ content }\n\t</Tag>\n);\n\nconst previewPaginationNumbers = ( midSize ) => {\n\tconst paginationItems = [];\n\n\t// First set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( i ) );\n\t}\n\n\t// Current pagination item.\n\tpaginationItems.push(\n\t\tcreatePaginationItem( midSize + 1, 'span', 'current' )\n\t);\n\n\t// Second set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( midSize + 1 + i ) );\n\t}\n\n\t// Dots.\n\tpaginationItems.push( createPaginationItem( '...', 'span', 'dots' ) );\n\n\t// Last pagination item.\n\tpaginationItems.push( createPaginationItem( midSize * 2 + 3 ) );\n\n\treturn <>{ paginationItems }</>;\n};\n\nexport default function QueryPaginationNumbersEdit( {\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { midSize } = attributes;\n\tconst paginationNumbers = previewPaginationNumbers(\n\t\tparseInt( midSize, 10 )\n\t);\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tlabel={ __( 'Number of links' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ midSize }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tmidSize: parseInt( value, 10 ),\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ 5 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div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AAE,CAAC;EAE/D,oBAAOZ,IAAA,CAAAE,SAAA;IAAAQ,QAAA,EAAIG;EAAe,CAAI,CAAC;AAChC,CAAC;AAED,eAAe,SAASG,0BAA0BA,CAAE;EACnDC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAM;IAAEN;EAAQ,CAAC,GAAGK,UAAU;EAC9B,MAAME,iBAAiB,GAAGR,wBAAwB,CACjDS,QAAQ,CAAER,OAAO,EAAE,EAAG,CACvB,CAAC;EACD,oBACCR,KAAA,CAAAF,SAAA;IAAAQ,QAAA,gBACCV,IAAA,CAACL,iBAAiB;MAAAe,QAAA,eACjBV,IAAA,CAACH,SAAS;QAACwB,KAAK,EAAG3B,EAAE,CAAE,UAAW,CAAG;QAAAgB,QAAA,eACpCV,IAAA,CAACF,YAAY;UACZwB,KAAK,EAAG5B,EAAE,CAAE,iBAAkB,CAAG;UACjC6B,IAAI,EAAG7B,EAAE,CACR,2IACD,CAAG;UACH8B,KAAK,EAAGZ,OAAS;UACjBa,QAAQ,EAAKD,KAAK,IAAM;YACvBN,aAAa,CAAE;cACdN,OAAO,EAAEQ,QAAQ,CAAEI,KAAK,EAAE,EAAG;YAC9B,CAAE,CAAC;UACJ,CAAG;UACHE,GAAG,EAAG,CAAG;UACTC,GAAG,EAAG,CAAG;UACTC,cAAc,EAAG;QAAO,CACxB;MAAC,CACQ;IAAC,CACM,CAAC,eACpB5B,IAAA;MAAA,GAAUJ,aAAa,CAAC,CAAC;MAAAc,QAAA,EAAKS;IAAiB,CAAO,CAAC;EAAA,CACtD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","InspectorControls","useBlockProps","PanelBody","RangeControl","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","createPaginationItem","content","Tag","extraClass","className","children","previewPaginationNumbers","midSize","paginationItems","i","push","QueryPaginationNumbersEdit","attributes","setAttributes","paginationNumbers","parseInt","title","__nextHasNoMarginBottom","label","help","value","onChange","min","max","withInputField"],"sources":["@wordpress/block-library/src/query-pagination-numbers/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { PanelBody, RangeControl } from '@wordpress/components';\n\nconst createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => (\n\t<Tag key={ content } className={ `page-numbers ${ extraClass }` }>\n\t\t{ content }\n\t</Tag>\n);\n\nconst previewPaginationNumbers = ( midSize ) => {\n\tconst paginationItems = [];\n\n\t// First set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( i ) );\n\t}\n\n\t// Current pagination item.\n\tpaginationItems.push(\n\t\tcreatePaginationItem( midSize + 1, 'span', 'current' )\n\t);\n\n\t// Second set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( midSize + 1 + i ) );\n\t}\n\n\t// Dots.\n\tpaginationItems.push( createPaginationItem( '...', 'span', 'dots' ) );\n\n\t// Last pagination item.\n\tpaginationItems.push( createPaginationItem( midSize * 2 + 3 ) );\n\n\treturn <>{ paginationItems }</>;\n};\n\nexport default function QueryPaginationNumbersEdit( {\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { midSize } = attributes;\n\tconst paginationNumbers = previewPaginationNumbers(\n\t\tparseInt( midSize, 10 )\n\t);\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Number of links' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ midSize }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tmidSize: parseInt( value, 10 ),\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ 5 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...useBlockProps() }>{ paginationNumbers }</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,yBAAyB;AAC1E,SAASC,SAAS,EAAEC,YAAY,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,oBAAoB,GAAGA,CAAEC,OAAO,EAAEC,GAAG,GAAG,GAAG,EAAEC,UAAU,GAAG,EAAE,kBACjER,IAAA,CAACO,GAAG;EAAiBE,SAAS,EAAI,gBAAgBD,UAAY,EAAG;EAAAE,QAAA,EAC9DJ;AAAO,GADCA,OAEN,CACL;AAED,MAAMK,wBAAwB,GAAKC,OAAO,IAAM;EAC/C,MAAMC,eAAe,GAAG,EAAE;;EAE1B;EACA,KAAM,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIF,OAAO,EAAEE,CAAC,EAAE,EAAG;IACpCD,eAAe,CAACE,IAAI,CAAEV,oBAAoB,CAAES,CAAE,CAAE,CAAC;EAClD;;EAEA;EACAD,eAAe,CAACE,IAAI,CACnBV,oBAAoB,CAAEO,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,SAAU,CACtD,CAAC;;EAED;EACA,KAAM,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIF,OAAO,EAAEE,CAAC,EAAE,EAAG;IACpCD,eAAe,CAACE,IAAI,CAAEV,oBAAoB,CAAEO,OAAO,GAAG,CAA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@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { AlignmentControl, BlockControls, InspectorControls, useBlockProps, Warning, HeadingLevelDropdown, store as blockEditorStore } from '@wordpress/block-editor';
9
+ import { AlignmentControl, BlockControls, InspectorControls, useBlockProps, Warning, HeadingLevelDropdown } from '@wordpress/block-editor';
10
10
  import { ToggleControl, PanelBody } from '@wordpress/components';
11
11
  import { __, sprintf } from '@wordpress/i18n';
12
- import { useSelect } from '@wordpress/data';
12
+
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+ import { useArchiveLabel } from './use-archive-label';
13
17
  import { jsx as _jsx } from "react/jsx-runtime";
14
18
  import { Fragment as _Fragment } from "react/jsx-runtime";
15
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -25,21 +29,9 @@ export default function QueryTitleEdit({
25
29
  setAttributes
26
30
  }) {
27
31
  const {
28
- archiveTypeTitle,
32
+ archiveTypeLabel,
29
33
  archiveNameLabel
30
- } = useSelect(select => {
31
- const {
32
- getSettings
33
- } = select(blockEditorStore);
34
- const {
35
- __experimentalArchiveTitleNameLabel,
36
- __experimentalArchiveTitleTypeLabel
37
- } = getSettings();
38
- return {
39
- archiveTypeTitle: __experimentalArchiveTitleTypeLabel,
40
- archiveNameLabel: __experimentalArchiveTitleNameLabel
41
- };
42
- });
34
+ } = useArchiveLabel();
43
35
  const TagName = `h${level}`;
44
36
  const blockProps = useBlockProps({
45
37
  className: clsx('wp-block-query-title__placeholder', {
@@ -57,20 +49,20 @@ export default function QueryTitleEdit({
57
49
  let titleElement;
58
50
  if (type === 'archive') {
59
51
  let title;
60
- if (archiveTypeTitle) {
52
+ if (archiveTypeLabel) {
61
53
  if (showPrefix) {
62
54
  if (archiveNameLabel) {
63
55
  title = sprintf( /* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */
64
- __('%1$s: %2$s'), archiveTypeTitle, archiveNameLabel);
56
+ __('%1$s: %2$s'), archiveTypeLabel, archiveNameLabel);
65
57
  } else {
66
58
  title = sprintf( /* translators: %s: Archive type title e.g: "Category", "Tag"... */
67
- __('%s: Name'), archiveTypeTitle);
59
+ __('%s: Name'), archiveTypeLabel);
68
60
  }
69
61
  } else if (archiveNameLabel) {
70
62
  title = archiveNameLabel;
71
63
  } else {
72
64
  title = sprintf( /* translators: %s: Archive type title e.g: "Category", "Tag"... */
73
- __('%s name'), archiveTypeTitle);
65
+ __('%s name'), archiveTypeLabel);
74
66
  }
75
67
  } else {
76
68
  title = showPrefix ? __('Archive type: Name') : __('Archive title');