@wordpress/block-library 9.4.0 → 9.5.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 (585) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/avatar/edit.js +1 -0
  3. package/build/avatar/edit.js.map +1 -1
  4. package/build/categories/index.js +12 -0
  5. package/build/categories/index.js.map +1 -1
  6. package/build/column/edit.js +2 -2
  7. package/build/column/edit.js.map +1 -1
  8. package/build/column/index.js +2 -0
  9. package/build/column/index.js.map +1 -1
  10. package/build/comment-template/index.js +12 -0
  11. package/build/comment-template/index.js.map +1 -1
  12. package/build/comments-title/deprecated.js +3 -0
  13. package/build/comments-title/deprecated.js.map +1 -1
  14. package/build/comments-title/edit.js +3 -1
  15. package/build/comments-title/edit.js.map +1 -1
  16. package/build/comments-title/index.js +3 -0
  17. package/build/comments-title/index.js.map +1 -1
  18. package/build/details/edit.js +1 -0
  19. package/build/details/edit.js.map +1 -1
  20. package/build/form/edit.js +4 -4
  21. package/build/form/edit.js.map +1 -1
  22. package/build/form-input/edit.js +1 -0
  23. package/build/form-input/edit.js.map +1 -1
  24. package/build/gallery/edit.js +42 -8
  25. package/build/gallery/edit.js.map +1 -1
  26. package/build/gallery/gap-styles.js +1 -9
  27. package/build/gallery/gap-styles.js.map +1 -1
  28. package/build/gallery/use-image-sizes.js +2 -2
  29. package/build/gallery/use-image-sizes.js.map +1 -1
  30. package/build/group/index.js +27 -30
  31. package/build/group/index.js.map +1 -1
  32. package/build/group/variations.js +51 -3
  33. package/build/group/variations.js.map +1 -1
  34. package/build/heading/edit.js +2 -0
  35. package/build/heading/edit.js.map +1 -1
  36. package/build/heading/index.js +3 -0
  37. package/build/heading/index.js.map +1 -1
  38. package/build/image/view.js +1 -1
  39. package/build/image/view.js.map +1 -1
  40. package/build/latest-posts/edit.js +1 -0
  41. package/build/latest-posts/edit.js.map +1 -1
  42. package/build/list/index.js +1 -1
  43. package/build/list/ordered-list-settings.js +19 -17
  44. package/build/list/ordered-list-settings.js.map +1 -1
  45. package/build/list-item/index.js +3 -2
  46. package/build/list-item/index.js.map +1 -1
  47. package/build/loginout/index.js +14 -1
  48. package/build/loginout/index.js.map +1 -1
  49. package/build/navigation/edit/index.js +5 -4
  50. package/build/navigation/edit/index.js.map +1 -1
  51. package/build/post-comments-form/index.js +12 -0
  52. package/build/post-comments-form/index.js.map +1 -1
  53. package/build/post-content/index.js +1 -0
  54. package/build/post-content/index.js.map +1 -1
  55. package/build/post-date/index.js +12 -0
  56. package/build/post-date/index.js.map +1 -1
  57. package/build/post-excerpt/index.js +12 -0
  58. package/build/post-excerpt/index.js.map +1 -1
  59. package/build/post-navigation-link/edit.js +2 -0
  60. package/build/post-navigation-link/edit.js.map +1 -1
  61. package/build/post-terms/index.js +12 -0
  62. package/build/post-terms/index.js.map +1 -1
  63. package/build/post-time-to-read/index.js +6 -0
  64. package/build/post-time-to-read/index.js.map +1 -1
  65. package/build/post-title/edit.js +4 -2
  66. package/build/post-title/edit.js.map +1 -1
  67. package/build/post-title/index.js +15 -0
  68. package/build/post-title/index.js.map +1 -1
  69. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -0
  70. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  71. package/build/query/edit/inspector-controls/index.js +69 -9
  72. package/build/query/edit/inspector-controls/index.js.map +1 -1
  73. package/build/query/edit/inspector-controls/offset-controls.js +37 -0
  74. package/build/query/edit/inspector-controls/offset-controls.js.map +1 -0
  75. package/build/query/edit/inspector-controls/pages-control.js +36 -0
  76. package/build/query/edit/inspector-controls/pages-control.js.map +1 -0
  77. package/build/query/edit/inspector-controls/per-page-control.js +40 -0
  78. package/build/query/edit/inspector-controls/per-page-control.js.map +1 -0
  79. package/build/query/edit/inspector-controls/sticky-control.js +1 -1
  80. package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
  81. package/build/query/edit/query-toolbar.js +3 -76
  82. package/build/query/edit/query-toolbar.js.map +1 -1
  83. package/build/query/utils.js +10 -5
  84. package/build/query/utils.js.map +1 -1
  85. package/build/query-title/edit.js +2 -0
  86. package/build/query-title/edit.js.map +1 -1
  87. package/build/query-title/index.js +3 -0
  88. package/build/query-title/index.js.map +1 -1
  89. package/build/site-logo/edit.js +15 -8
  90. package/build/site-logo/edit.js.map +1 -1
  91. package/build/site-tagline/edit.js +3 -3
  92. package/build/site-tagline/edit.js.map +1 -1
  93. package/build/site-tagline/index.js +12 -1
  94. package/build/site-tagline/index.js.map +1 -1
  95. package/build/site-title/edit.js +2 -2
  96. package/build/site-title/edit.js.map +1 -1
  97. package/build/site-title/index.js +10 -0
  98. package/build/site-title/index.js.map +1 -1
  99. package/build/social-link/edit.js +0 -1
  100. package/build/social-link/edit.js.map +1 -1
  101. package/build/spacer/controls.js +8 -13
  102. package/build/spacer/controls.js.map +1 -1
  103. package/build/table-of-contents/index.js +14 -1
  104. package/build/table-of-contents/index.js.map +1 -1
  105. package/build/tag-cloud/edit.js +38 -32
  106. package/build/tag-cloud/edit.js.map +1 -1
  107. package/build/tag-cloud/index.js +1 -1
  108. package/build/template-part/edit/index.js +7 -6
  109. package/build/template-part/edit/index.js.map +1 -1
  110. package/build/template-part/edit/inner-blocks.js +6 -4
  111. package/build/template-part/edit/inner-blocks.js.map +1 -1
  112. package/build-module/avatar/edit.js +1 -0
  113. package/build-module/avatar/edit.js.map +1 -1
  114. package/build-module/categories/index.js +12 -0
  115. package/build-module/categories/index.js.map +1 -1
  116. package/build-module/column/edit.js +2 -2
  117. package/build-module/column/edit.js.map +1 -1
  118. package/build-module/column/index.js +2 -0
  119. package/build-module/column/index.js.map +1 -1
  120. package/build-module/comment-template/index.js +12 -0
  121. package/build-module/comment-template/index.js.map +1 -1
  122. package/build-module/comments-title/deprecated.js +3 -0
  123. package/build-module/comments-title/deprecated.js.map +1 -1
  124. package/build-module/comments-title/edit.js +3 -1
  125. package/build-module/comments-title/edit.js.map +1 -1
  126. package/build-module/comments-title/index.js +3 -0
  127. package/build-module/comments-title/index.js.map +1 -1
  128. package/build-module/details/edit.js +1 -0
  129. package/build-module/details/edit.js.map +1 -1
  130. package/build-module/form/edit.js +4 -4
  131. package/build-module/form/edit.js.map +1 -1
  132. package/build-module/form-input/edit.js +1 -0
  133. package/build-module/form-input/edit.js.map +1 -1
  134. package/build-module/gallery/edit.js +43 -9
  135. package/build-module/gallery/edit.js.map +1 -1
  136. package/build-module/gallery/gap-styles.js +1 -9
  137. package/build-module/gallery/gap-styles.js.map +1 -1
  138. package/build-module/gallery/use-image-sizes.js +2 -2
  139. package/build-module/gallery/use-image-sizes.js.map +1 -1
  140. package/build-module/group/index.js +27 -30
  141. package/build-module/group/index.js.map +1 -1
  142. package/build-module/group/variations.js +51 -3
  143. package/build-module/group/variations.js.map +1 -1
  144. package/build-module/heading/edit.js +2 -0
  145. package/build-module/heading/edit.js.map +1 -1
  146. package/build-module/heading/index.js +3 -0
  147. package/build-module/heading/index.js.map +1 -1
  148. package/build-module/image/view.js +1 -1
  149. package/build-module/image/view.js.map +1 -1
  150. package/build-module/latest-posts/edit.js +1 -0
  151. package/build-module/latest-posts/edit.js.map +1 -1
  152. package/build-module/list/index.js +1 -1
  153. package/build-module/list/ordered-list-settings.js +19 -17
  154. package/build-module/list/ordered-list-settings.js.map +1 -1
  155. package/build-module/list-item/index.js +3 -2
  156. package/build-module/list-item/index.js.map +1 -1
  157. package/build-module/loginout/index.js +14 -1
  158. package/build-module/loginout/index.js.map +1 -1
  159. package/build-module/navigation/edit/index.js +5 -4
  160. package/build-module/navigation/edit/index.js.map +1 -1
  161. package/build-module/post-comments-form/index.js +12 -0
  162. package/build-module/post-comments-form/index.js.map +1 -1
  163. package/build-module/post-content/index.js +1 -0
  164. package/build-module/post-content/index.js.map +1 -1
  165. package/build-module/post-date/index.js +12 -0
  166. package/build-module/post-date/index.js.map +1 -1
  167. package/build-module/post-excerpt/index.js +12 -0
  168. package/build-module/post-excerpt/index.js.map +1 -1
  169. package/build-module/post-navigation-link/edit.js +2 -0
  170. package/build-module/post-navigation-link/edit.js.map +1 -1
  171. package/build-module/post-terms/index.js +12 -0
  172. package/build-module/post-terms/index.js.map +1 -1
  173. package/build-module/post-time-to-read/index.js +6 -0
  174. package/build-module/post-time-to-read/index.js.map +1 -1
  175. package/build-module/post-title/edit.js +4 -2
  176. package/build-module/post-title/edit.js.map +1 -1
  177. package/build-module/post-title/index.js +15 -0
  178. package/build-module/post-title/index.js.map +1 -1
  179. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -0
  180. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  181. package/build-module/query/edit/inspector-controls/index.js +71 -11
  182. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  183. package/build-module/query/edit/inspector-controls/offset-controls.js +29 -0
  184. package/build-module/query/edit/inspector-controls/offset-controls.js.map +1 -0
  185. package/build-module/query/edit/inspector-controls/pages-control.js +28 -0
  186. package/build-module/query/edit/inspector-controls/pages-control.js.map +1 -0
  187. package/build-module/query/edit/inspector-controls/per-page-control.js +33 -0
  188. package/build-module/query/edit/inspector-controls/per-page-control.js.map +1 -0
  189. package/build-module/query/edit/inspector-controls/sticky-control.js +1 -1
  190. package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
  191. package/build-module/query/edit/query-toolbar.js +4 -78
  192. package/build-module/query/edit/query-toolbar.js.map +1 -1
  193. package/build-module/query/utils.js +10 -5
  194. package/build-module/query/utils.js.map +1 -1
  195. package/build-module/query-title/edit.js +2 -0
  196. package/build-module/query-title/edit.js.map +1 -1
  197. package/build-module/query-title/index.js +3 -0
  198. package/build-module/query-title/index.js.map +1 -1
  199. package/build-module/site-logo/edit.js +15 -8
  200. package/build-module/site-logo/edit.js.map +1 -1
  201. package/build-module/site-tagline/edit.js +3 -3
  202. package/build-module/site-tagline/edit.js.map +1 -1
  203. package/build-module/site-tagline/index.js +12 -1
  204. package/build-module/site-tagline/index.js.map +1 -1
  205. package/build-module/site-title/edit.js +2 -2
  206. package/build-module/site-title/edit.js.map +1 -1
  207. package/build-module/site-title/index.js +10 -0
  208. package/build-module/site-title/index.js.map +1 -1
  209. package/build-module/social-link/edit.js +0 -1
  210. package/build-module/social-link/edit.js.map +1 -1
  211. package/build-module/spacer/controls.js +9 -14
  212. package/build-module/spacer/controls.js.map +1 -1
  213. package/build-module/table-of-contents/index.js +14 -1
  214. package/build-module/table-of-contents/index.js.map +1 -1
  215. package/build-module/tag-cloud/edit.js +39 -33
  216. package/build-module/tag-cloud/edit.js.map +1 -1
  217. package/build-module/tag-cloud/index.js +1 -1
  218. package/build-module/template-part/edit/index.js +7 -6
  219. package/build-module/template-part/edit/index.js.map +1 -1
  220. package/build-module/template-part/edit/inner-blocks.js +6 -4
  221. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  222. package/build-style/archives/editor-rtl.css +3 -0
  223. package/build-style/archives/editor.css +3 -0
  224. package/build-style/archives/style-rtl.css +3 -0
  225. package/build-style/archives/style.css +3 -0
  226. package/build-style/audio/editor-rtl.css +3 -0
  227. package/build-style/audio/editor.css +3 -0
  228. package/build-style/audio/style-rtl.css +3 -0
  229. package/build-style/audio/style.css +3 -0
  230. package/build-style/audio/theme-rtl.css +3 -0
  231. package/build-style/audio/theme.css +3 -0
  232. package/build-style/avatar/editor-rtl.css +3 -0
  233. package/build-style/avatar/editor.css +3 -0
  234. package/build-style/avatar/style-rtl.css +3 -0
  235. package/build-style/avatar/style.css +3 -0
  236. package/build-style/button/editor-rtl.css +3 -0
  237. package/build-style/button/editor.css +3 -0
  238. package/build-style/button/style-rtl.css +3 -0
  239. package/build-style/button/style.css +3 -0
  240. package/build-style/buttons/editor-rtl.css +3 -0
  241. package/build-style/buttons/editor.css +3 -0
  242. package/build-style/buttons/style-rtl.css +3 -0
  243. package/build-style/buttons/style.css +3 -0
  244. package/build-style/calendar/style-rtl.css +3 -0
  245. package/build-style/calendar/style.css +3 -0
  246. package/build-style/categories/editor-rtl.css +3 -0
  247. package/build-style/categories/editor.css +3 -0
  248. package/build-style/categories/style-rtl.css +3 -0
  249. package/build-style/categories/style.css +3 -0
  250. package/build-style/classic-rtl.css +3 -0
  251. package/build-style/classic.css +3 -0
  252. package/build-style/code/editor-rtl.css +3 -0
  253. package/build-style/code/editor.css +3 -0
  254. package/build-style/code/style-rtl.css +3 -0
  255. package/build-style/code/style.css +3 -0
  256. package/build-style/code/theme-rtl.css +3 -0
  257. package/build-style/code/theme.css +3 -0
  258. package/build-style/columns/editor-rtl.css +3 -0
  259. package/build-style/columns/editor.css +3 -0
  260. package/build-style/columns/style-rtl.css +3 -0
  261. package/build-style/columns/style.css +3 -0
  262. package/build-style/comment-author-avatar/editor-rtl.css +3 -0
  263. package/build-style/comment-author-avatar/editor.css +3 -0
  264. package/build-style/comment-content/style-rtl.css +3 -0
  265. package/build-style/comment-content/style.css +3 -0
  266. package/build-style/comment-template/style-rtl.css +3 -0
  267. package/build-style/comment-template/style.css +3 -0
  268. package/build-style/comments/editor-rtl.css +3 -0
  269. package/build-style/comments/editor.css +3 -0
  270. package/build-style/comments/style-rtl.css +3 -0
  271. package/build-style/comments/style.css +3 -0
  272. package/build-style/comments-pagination/editor-rtl.css +3 -0
  273. package/build-style/comments-pagination/editor.css +3 -0
  274. package/build-style/comments-pagination/style-rtl.css +3 -0
  275. package/build-style/comments-pagination/style.css +3 -0
  276. package/build-style/comments-pagination-numbers/editor-rtl.css +3 -0
  277. package/build-style/comments-pagination-numbers/editor.css +3 -0
  278. package/build-style/comments-title/editor-rtl.css +3 -0
  279. package/build-style/comments-title/editor.css +3 -0
  280. package/build-style/common-rtl.css +3 -0
  281. package/build-style/common.css +3 -0
  282. package/build-style/cover/editor-rtl.css +3 -0
  283. package/build-style/cover/editor.css +3 -0
  284. package/build-style/cover/style-rtl.css +3 -0
  285. package/build-style/cover/style.css +3 -0
  286. package/build-style/details/editor-rtl.css +3 -0
  287. package/build-style/details/editor.css +3 -0
  288. package/build-style/details/style-rtl.css +3 -0
  289. package/build-style/details/style.css +3 -0
  290. package/build-style/editor-elements-rtl.css +3 -0
  291. package/build-style/editor-elements.css +3 -0
  292. package/build-style/editor-rtl.css +16 -30
  293. package/build-style/editor.css +16 -30
  294. package/build-style/elements-rtl.css +3 -0
  295. package/build-style/elements.css +3 -0
  296. package/build-style/embed/editor-rtl.css +3 -0
  297. package/build-style/embed/editor.css +3 -0
  298. package/build-style/embed/style-rtl.css +3 -0
  299. package/build-style/embed/style.css +3 -0
  300. package/build-style/embed/theme-rtl.css +3 -0
  301. package/build-style/embed/theme.css +3 -0
  302. package/build-style/file/editor-rtl.css +3 -0
  303. package/build-style/file/editor.css +3 -0
  304. package/build-style/file/style-rtl.css +3 -0
  305. package/build-style/file/style.css +3 -0
  306. package/build-style/footnotes/style-rtl.css +3 -0
  307. package/build-style/footnotes/style.css +3 -0
  308. package/build-style/form-input/editor-rtl.css +3 -0
  309. package/build-style/form-input/editor.css +3 -0
  310. package/build-style/form-input/style-rtl.css +4 -0
  311. package/build-style/form-input/style.css +4 -0
  312. package/build-style/form-submission-notification/editor-rtl.css +3 -0
  313. package/build-style/form-submission-notification/editor.css +3 -0
  314. package/build-style/form-submit-button/style-rtl.css +3 -0
  315. package/build-style/form-submit-button/style.css +3 -0
  316. package/build-style/freeform/editor-rtl.css +3 -0
  317. package/build-style/freeform/editor.css +3 -0
  318. package/build-style/gallery/editor-rtl.css +3 -1
  319. package/build-style/gallery/editor.css +3 -1
  320. package/build-style/gallery/style-rtl.css +3 -0
  321. package/build-style/gallery/style.css +3 -0
  322. package/build-style/gallery/theme-rtl.css +3 -0
  323. package/build-style/gallery/theme.css +3 -0
  324. package/build-style/group/editor-rtl.css +3 -11
  325. package/build-style/group/editor.css +3 -11
  326. package/build-style/group/style-rtl.css +3 -0
  327. package/build-style/group/style.css +3 -0
  328. package/build-style/group/theme-rtl.css +3 -0
  329. package/build-style/group/theme.css +3 -0
  330. package/build-style/heading/style-rtl.css +3 -0
  331. package/build-style/heading/style.css +3 -0
  332. package/build-style/html/editor-rtl.css +3 -0
  333. package/build-style/html/editor.css +3 -0
  334. package/build-style/image/editor-rtl.css +11 -0
  335. package/build-style/image/editor.css +11 -0
  336. package/build-style/image/style-rtl.css +3 -0
  337. package/build-style/image/style.css +3 -0
  338. package/build-style/image/theme-rtl.css +3 -0
  339. package/build-style/image/theme.css +3 -0
  340. package/build-style/latest-comments/style-rtl.css +3 -0
  341. package/build-style/latest-comments/style.css +3 -0
  342. package/build-style/latest-posts/editor-rtl.css +3 -3
  343. package/build-style/latest-posts/editor.css +3 -3
  344. package/build-style/latest-posts/style-rtl.css +3 -0
  345. package/build-style/latest-posts/style.css +3 -0
  346. package/build-style/list/style-rtl.css +3 -0
  347. package/build-style/list/style.css +3 -0
  348. package/build-style/loginout/style-rtl.css +94 -0
  349. package/build-style/loginout/style.css +94 -0
  350. package/build-style/media-text/editor-rtl.css +3 -0
  351. package/build-style/media-text/editor.css +3 -0
  352. package/build-style/media-text/style-rtl.css +3 -0
  353. package/build-style/media-text/style.css +3 -0
  354. package/build-style/more/editor-rtl.css +3 -0
  355. package/build-style/more/editor.css +3 -0
  356. package/build-style/navigation/editor-rtl.css +3 -12
  357. package/build-style/navigation/editor.css +3 -12
  358. package/build-style/navigation/style-rtl.css +3 -0
  359. package/build-style/navigation/style.css +3 -0
  360. package/build-style/navigation-link/editor-rtl.css +3 -0
  361. package/build-style/navigation-link/editor.css +3 -0
  362. package/build-style/navigation-link/style-rtl.css +3 -0
  363. package/build-style/navigation-link/style.css +3 -0
  364. package/build-style/navigation-submenu/editor-rtl.css +3 -0
  365. package/build-style/navigation-submenu/editor.css +3 -0
  366. package/build-style/nextpage/editor-rtl.css +3 -0
  367. package/build-style/nextpage/editor.css +3 -0
  368. package/build-style/page-list/editor-rtl.css +3 -0
  369. package/build-style/page-list/editor.css +3 -0
  370. package/build-style/page-list/style-rtl.css +3 -0
  371. package/build-style/page-list/style.css +3 -0
  372. package/build-style/paragraph/editor-rtl.css +3 -0
  373. package/build-style/paragraph/editor.css +3 -0
  374. package/build-style/paragraph/style-rtl.css +3 -0
  375. package/build-style/paragraph/style.css +3 -0
  376. package/build-style/post-author/style-rtl.css +3 -0
  377. package/build-style/post-author/style.css +3 -0
  378. package/build-style/post-comments-form/editor-rtl.css +3 -0
  379. package/build-style/post-comments-form/editor.css +3 -0
  380. package/build-style/post-comments-form/style-rtl.css +3 -0
  381. package/build-style/post-comments-form/style.css +3 -0
  382. package/build-style/post-content/editor-rtl.css +3 -0
  383. package/build-style/post-content/editor.css +3 -0
  384. package/build-style/post-content/style-rtl.css +96 -0
  385. package/build-style/post-content/style.css +96 -0
  386. package/build-style/post-date/style-rtl.css +3 -0
  387. package/build-style/post-date/style.css +3 -0
  388. package/build-style/post-excerpt/editor-rtl.css +3 -0
  389. package/build-style/post-excerpt/editor.css +3 -0
  390. package/build-style/post-excerpt/style-rtl.css +4 -0
  391. package/build-style/post-excerpt/style.css +4 -0
  392. package/build-style/post-featured-image/editor-rtl.css +3 -0
  393. package/build-style/post-featured-image/editor.css +3 -0
  394. package/build-style/post-featured-image/style-rtl.css +3 -0
  395. package/build-style/post-featured-image/style.css +3 -0
  396. package/build-style/post-navigation-link/style-rtl.css +3 -0
  397. package/build-style/post-navigation-link/style.css +3 -0
  398. package/build-style/post-template/editor-rtl.css +3 -0
  399. package/build-style/post-template/editor.css +3 -0
  400. package/build-style/post-template/style-rtl.css +3 -0
  401. package/build-style/post-template/style.css +3 -0
  402. package/build-style/post-terms/style-rtl.css +3 -0
  403. package/build-style/post-terms/style.css +3 -0
  404. package/build-style/post-time-to-read/style-rtl.css +3 -0
  405. package/build-style/post-time-to-read/style.css +3 -0
  406. package/build-style/post-title/style-rtl.css +3 -0
  407. package/build-style/post-title/style.css +3 -0
  408. package/build-style/preformatted/style-rtl.css +3 -0
  409. package/build-style/preformatted/style.css +3 -0
  410. package/build-style/pullquote/editor-rtl.css +3 -0
  411. package/build-style/pullquote/editor.css +3 -0
  412. package/build-style/pullquote/style-rtl.css +3 -0
  413. package/build-style/pullquote/style.css +3 -0
  414. package/build-style/pullquote/theme-rtl.css +3 -0
  415. package/build-style/pullquote/theme.css +3 -0
  416. package/build-style/query/editor-rtl.css +3 -0
  417. package/build-style/query/editor.css +3 -0
  418. package/build-style/query-pagination/editor-rtl.css +3 -0
  419. package/build-style/query-pagination/editor.css +3 -0
  420. package/build-style/query-pagination/style-rtl.css +3 -0
  421. package/build-style/query-pagination/style.css +3 -0
  422. package/build-style/query-pagination-numbers/editor-rtl.css +3 -0
  423. package/build-style/query-pagination-numbers/editor.css +3 -0
  424. package/build-style/query-title/style-rtl.css +3 -0
  425. package/build-style/query-title/style.css +3 -0
  426. package/build-style/quote/style-rtl.css +3 -0
  427. package/build-style/quote/style.css +3 -0
  428. package/build-style/quote/theme-rtl.css +6 -3
  429. package/build-style/quote/theme.css +6 -3
  430. package/build-style/read-more/style-rtl.css +3 -0
  431. package/build-style/read-more/style.css +3 -0
  432. package/build-style/reset-rtl.css +3 -0
  433. package/build-style/reset.css +3 -0
  434. package/build-style/rss/editor-rtl.css +3 -0
  435. package/build-style/rss/editor.css +3 -0
  436. package/build-style/rss/style-rtl.css +3 -0
  437. package/build-style/rss/style.css +3 -0
  438. package/build-style/search/editor-rtl.css +3 -0
  439. package/build-style/search/editor.css +3 -0
  440. package/build-style/search/style-rtl.css +3 -0
  441. package/build-style/search/style.css +3 -0
  442. package/build-style/search/theme-rtl.css +3 -0
  443. package/build-style/search/theme.css +3 -0
  444. package/build-style/separator/editor-rtl.css +3 -0
  445. package/build-style/separator/editor.css +3 -0
  446. package/build-style/separator/style-rtl.css +3 -0
  447. package/build-style/separator/style.css +3 -0
  448. package/build-style/separator/theme-rtl.css +3 -0
  449. package/build-style/separator/theme.css +3 -0
  450. package/build-style/shortcode/editor-rtl.css +3 -0
  451. package/build-style/shortcode/editor.css +3 -0
  452. package/build-style/site-logo/editor-rtl.css +3 -0
  453. package/build-style/site-logo/editor.css +3 -0
  454. package/build-style/site-logo/style-rtl.css +3 -0
  455. package/build-style/site-logo/style.css +3 -0
  456. package/build-style/site-tagline/editor-rtl.css +3 -0
  457. package/build-style/site-tagline/editor.css +3 -0
  458. package/build-style/site-tagline/style-rtl.css +94 -0
  459. package/build-style/site-tagline/style.css +94 -0
  460. package/build-style/site-title/editor-rtl.css +3 -0
  461. package/build-style/site-title/editor.css +3 -0
  462. package/build-style/site-title/style-rtl.css +7 -1
  463. package/build-style/site-title/style.css +7 -1
  464. package/build-style/social-link/editor-rtl.css +3 -0
  465. package/build-style/social-link/editor.css +3 -0
  466. package/build-style/social-links/editor-rtl.css +3 -0
  467. package/build-style/social-links/editor.css +3 -0
  468. package/build-style/social-links/style-rtl.css +3 -0
  469. package/build-style/social-links/style.css +3 -0
  470. package/build-style/spacer/editor-rtl.css +3 -0
  471. package/build-style/spacer/editor.css +3 -0
  472. package/build-style/spacer/style-rtl.css +3 -0
  473. package/build-style/spacer/style.css +3 -0
  474. package/build-style/style-rtl.css +27 -1
  475. package/build-style/style.css +27 -1
  476. package/build-style/table/editor-rtl.css +3 -0
  477. package/build-style/table/editor.css +3 -0
  478. package/build-style/table/style-rtl.css +3 -0
  479. package/build-style/table/style.css +3 -0
  480. package/build-style/table/theme-rtl.css +3 -0
  481. package/build-style/table/theme.css +3 -0
  482. package/build-style/table-of-contents/style-rtl.css +94 -0
  483. package/build-style/table-of-contents/style.css +94 -0
  484. package/build-style/tag-cloud/editor-rtl.css +95 -0
  485. package/build-style/tag-cloud/editor.css +95 -0
  486. package/build-style/tag-cloud/style-rtl.css +3 -0
  487. package/build-style/tag-cloud/style.css +3 -0
  488. package/build-style/template-part/editor-rtl.css +3 -0
  489. package/build-style/template-part/editor.css +3 -0
  490. package/build-style/template-part/theme-rtl.css +3 -0
  491. package/build-style/template-part/theme.css +3 -0
  492. package/build-style/term-description/style-rtl.css +3 -0
  493. package/build-style/term-description/style.css +3 -0
  494. package/build-style/text-columns/editor-rtl.css +3 -0
  495. package/build-style/text-columns/editor.css +3 -0
  496. package/build-style/text-columns/style-rtl.css +3 -0
  497. package/build-style/text-columns/style.css +3 -0
  498. package/build-style/theme-rtl.css +6 -3
  499. package/build-style/theme.css +6 -3
  500. package/build-style/verse/style-rtl.css +3 -0
  501. package/build-style/verse/style.css +3 -0
  502. package/build-style/video/editor-rtl.css +3 -3
  503. package/build-style/video/editor.css +3 -3
  504. package/build-style/video/style-rtl.css +3 -0
  505. package/build-style/video/style.css +3 -0
  506. package/build-style/video/theme-rtl.css +3 -0
  507. package/build-style/video/theme.css +3 -0
  508. package/package.json +35 -35
  509. package/src/avatar/edit.js +1 -0
  510. package/src/button/index.php +1 -14
  511. package/src/categories/block.json +12 -0
  512. package/src/column/block.json +2 -0
  513. package/src/column/edit.js +2 -2
  514. package/src/comment-template/block.json +12 -0
  515. package/src/comments-title/block.json +3 -0
  516. package/src/comments-title/edit.js +8 -1
  517. package/src/details/edit.js +1 -0
  518. package/src/editor.scss +1 -0
  519. package/src/form/edit.js +3 -2
  520. package/src/form-input/edit.js +1 -0
  521. package/src/form-input/style.scss +1 -0
  522. package/src/gallery/edit.js +75 -13
  523. package/src/gallery/editor.scss +0 -1
  524. package/src/gallery/gap-styles.js +1 -8
  525. package/src/gallery/test/__snapshots__/index.native.js.snap +1 -1
  526. package/src/gallery/test/index.native.js +5 -5
  527. package/src/gallery/use-image-sizes.js +2 -2
  528. package/src/group/editor.scss +1 -1
  529. package/src/group/index.js +26 -29
  530. package/src/group/variations.js +56 -0
  531. package/src/heading/block.json +3 -0
  532. package/src/heading/edit.js +3 -1
  533. package/src/image/editor.scss +12 -0
  534. package/src/image/view.js +1 -1
  535. package/src/latest-posts/edit.js +1 -0
  536. package/src/latest-posts/editor.scss +0 -4
  537. package/src/list/block.json +1 -1
  538. package/src/list/ordered-list-settings.js +20 -18
  539. package/src/list/test/edit.native.js +1 -3
  540. package/src/list-item/block.json +3 -2
  541. package/src/loginout/block.json +14 -1
  542. package/src/loginout/style.scss +4 -0
  543. package/src/media-text/style.native.scss +2 -0
  544. package/src/navigation/edit/index.js +5 -5
  545. package/src/navigation/editor.scss +0 -1
  546. package/src/post-comments-form/block.json +12 -0
  547. package/src/post-content/block.json +1 -0
  548. package/src/post-content/style.scss +5 -0
  549. package/src/post-date/block.json +12 -0
  550. package/src/post-excerpt/block.json +12 -0
  551. package/src/post-excerpt/style.scss +3 -0
  552. package/src/post-navigation-link/edit.js +2 -0
  553. package/src/post-terms/block.json +12 -0
  554. package/src/post-time-to-read/block.json +6 -0
  555. package/src/post-title/block.json +15 -0
  556. package/src/post-title/edit.js +4 -3
  557. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +1 -0
  558. package/src/query/edit/inspector-controls/index.js +85 -12
  559. package/src/query/edit/inspector-controls/offset-controls.js +31 -0
  560. package/src/query/edit/inspector-controls/pages-control.js +27 -0
  561. package/src/query/edit/inspector-controls/per-page-control.js +33 -0
  562. package/src/query/edit/inspector-controls/sticky-control.js +1 -1
  563. package/src/query/edit/query-toolbar.js +1 -90
  564. package/src/query/utils.js +9 -5
  565. package/src/query-title/block.json +3 -0
  566. package/src/query-title/edit.js +9 -1
  567. package/src/quote/theme.scss +5 -3
  568. package/src/site-logo/edit.js +23 -9
  569. package/src/site-tagline/block.json +12 -1
  570. package/src/site-tagline/edit.js +2 -4
  571. package/src/site-tagline/style.scss +4 -0
  572. package/src/site-title/block.json +10 -0
  573. package/src/site-title/edit.js +2 -4
  574. package/src/site-title/style.scss +7 -2
  575. package/src/social-link/edit.js +0 -1
  576. package/src/spacer/controls.js +10 -13
  577. package/src/style.scss +4 -0
  578. package/src/table-of-contents/block.json +14 -1
  579. package/src/table-of-contents/style.scss +4 -0
  580. package/src/tag-cloud/block.json +1 -1
  581. package/src/tag-cloud/edit.js +46 -34
  582. package/src/tag-cloud/editor.scss +9 -0
  583. package/src/template-part/edit/index.js +10 -7
  584. package/src/template-part/edit/inner-blocks.js +6 -4
  585. package/src/video/editor.scss +0 -4
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.PagesControl = void 0;
7
+ var _components = require("@wordpress/components");
8
+ var _i18n = require("@wordpress/i18n");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+
14
+ const PagesControl = ({
15
+ pages,
16
+ onChange
17
+ }) => {
18
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
19
+ __next40pxDefaultSize: true,
20
+ label: (0, _i18n.__)('Max pages'),
21
+ value: pages,
22
+ min: 0,
23
+ onChange: newPages => {
24
+ if (isNaN(newPages) || newPages < 0) {
25
+ return;
26
+ }
27
+ onChange({
28
+ pages: newPages
29
+ });
30
+ },
31
+ help: (0, _i18n.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
32
+ });
33
+ };
34
+ exports.PagesControl = PagesControl;
35
+ var _default = exports.default = PagesControl;
36
+ //# sourceMappingURL=pages-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_components","require","_i18n","_jsxRuntime","PagesControl","pages","onChange","jsx","__experimentalNumberControl","__next40pxDefaultSize","label","__","value","min","newPages","isNaN","help","exports","_default","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/pages-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalNumberControl as NumberControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport const PagesControl = ( { pages, onChange } ) => {\n\treturn (\n\t\t<NumberControl\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Max pages' ) }\n\t\t\tvalue={ pages }\n\t\t\tmin={ 0 }\n\t\t\tonChange={ ( newPages ) => {\n\t\t\t\tif ( isNaN( newPages ) || newPages < 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonChange( { pages: newPages } );\n\t\t\t} }\n\t\t\thelp={ __(\n\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) }\n\t\t/>\n\t);\n};\n\nexport default PagesControl;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIO,MAAMG,YAAY,GAAGA,CAAE;EAAEC,KAAK;EAAEC;AAAS,CAAC,KAAM;EACtD,oBACC,IAAAH,WAAA,CAAAI,GAAA,EAACP,WAAA,CAAAQ,2BAAa;IACbC,qBAAqB;IACrBC,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BC,KAAK,EAAGP,KAAO;IACfQ,GAAG,EAAG,CAAG;IACTP,QAAQ,EAAKQ,QAAQ,IAAM;MAC1B,IAAKC,KAAK,CAAED,QAAS,CAAC,IAAIA,QAAQ,GAAG,CAAC,EAAG;QACxC;MACD;MACAR,QAAQ,CAAE;QAAED,KAAK,EAAES;MAAS,CAAE,CAAC;IAChC,CAAG;IACHE,IAAI,EAAG,IAAAL,QAAE,EACR,uGACD;EAAG,CACH,CAAC;AAEJ,CAAC;AAACM,OAAA,CAAAb,YAAA,GAAAA,YAAA;AAAA,IAAAc,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEaf,YAAY","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _components = require("@wordpress/components");
8
+ var _i18n = require("@wordpress/i18n");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+
14
+ const MIN_POSTS_PER_PAGE = 1;
15
+ const MAX_POSTS_PER_PAGE = 100;
16
+ const PerPageControl = ({
17
+ perPage,
18
+ offset = 0,
19
+ onChange
20
+ }) => {
21
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
22
+ __next40pxDefaultSize: true,
23
+ __nextHasNoMarginBottom: true,
24
+ label: (0, _i18n.__)('Posts per page'),
25
+ min: MIN_POSTS_PER_PAGE,
26
+ max: MAX_POSTS_PER_PAGE,
27
+ onChange: newPerPage => {
28
+ if (isNaN(newPerPage) || newPerPage < MIN_POSTS_PER_PAGE || newPerPage > MAX_POSTS_PER_PAGE) {
29
+ return;
30
+ }
31
+ onChange({
32
+ perPage: newPerPage,
33
+ offset
34
+ });
35
+ },
36
+ value: parseInt(perPage, 10)
37
+ });
38
+ };
39
+ var _default = exports.default = PerPageControl;
40
+ //# sourceMappingURL=per-page-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_components","require","_i18n","_jsxRuntime","MIN_POSTS_PER_PAGE","MAX_POSTS_PER_PAGE","PerPageControl","perPage","offset","onChange","jsx","RangeControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","__","min","max","newPerPage","isNaN","value","parseInt","_default","exports","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/per-page-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RangeControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst MIN_POSTS_PER_PAGE = 1;\nconst MAX_POSTS_PER_PAGE = 100;\n\nconst PerPageControl = ( { perPage, offset = 0, onChange } ) => {\n\treturn (\n\t\t<RangeControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Posts per page' ) }\n\t\t\tmin={ MIN_POSTS_PER_PAGE }\n\t\t\tmax={ MAX_POSTS_PER_PAGE }\n\t\t\tonChange={ ( newPerPage ) => {\n\t\t\t\tif (\n\t\t\t\t\tisNaN( newPerPage ) ||\n\t\t\t\t\tnewPerPage < MIN_POSTS_PER_PAGE ||\n\t\t\t\t\tnewPerPage > MAX_POSTS_PER_PAGE\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonChange( { perPage: newPerPage, offset } );\n\t\t\t} }\n\t\t\tvalue={ parseInt( perPage, 10 ) }\n\t\t/>\n\t);\n};\n\nexport default PerPageControl;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,kBAAkB,GAAG,CAAC;AAC5B,MAAMC,kBAAkB,GAAG,GAAG;AAE9B,MAAMC,cAAc,GAAGA,CAAE;EAAEC,OAAO;EAAEC,MAAM,GAAG,CAAC;EAAEC;AAAS,CAAC,KAAM;EAC/D,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACV,WAAA,CAAAW,YAAY;IACZC,qBAAqB;IACrBC,uBAAuB;IACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,gBAAiB,CAAG;IAChCC,GAAG,EAAGZ,kBAAoB;IAC1Ba,GAAG,EAAGZ,kBAAoB;IAC1BI,QAAQ,EAAKS,UAAU,IAAM;MAC5B,IACCC,KAAK,CAAED,UAAW,CAAC,IACnBA,UAAU,GAAGd,kBAAkB,IAC/Bc,UAAU,GAAGb,kBAAkB,EAC9B;QACD;MACD;MACAI,QAAQ,CAAE;QAAEF,OAAO,EAAEW,UAAU;QAAEV;MAAO,CAAE,CAAC;IAC5C,CAAG;IACHY,KAAK,EAAGC,QAAQ,CAAEd,OAAO,EAAE,EAAG;EAAG,CACjC,CAAC;AAEJ,CAAC;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEalB,cAAc","ignoreList":[]}
@@ -32,7 +32,7 @@ function StickyControl({
32
32
  options: stickyOptions,
33
33
  value: value,
34
34
  onChange: onChange,
35
- help: (0, _i18n.__)('Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
35
+ help: (0, _i18n.__)('Sticky posts always appear first, regardless of their publish date.')
36
36
  });
37
37
  }
38
38
  //# sourceMappingURL=sticky-control.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_jsxRuntime","stickyOptions","label","__","value","StickyControl","onChange","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","options","help"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/sticky-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst stickyOptions = [\n\t{ label: __( 'Include' ), value: '' },\n\t{ label: __( 'Exclude' ), value: 'exclude' },\n\t{ label: __( 'Only' ), value: 'only' },\n];\n\nexport default function StickyControl( { value, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Sticky posts' ) }\n\t\t\toptions={ stickyOptions }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.'\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,aAAa,GAAG,CACrB;EAAEC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAG,CAAC,EACrC;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAU,CAAC,EAC5C;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EAAEC,KAAK,EAAE;AAAO,CAAC,CACtC;AAEc,SAASC,aAAaA,CAAE;EAAED,KAAK;EAAEE;AAAS,CAAC,EAAG;EAC5D,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACV,WAAA,CAAAW,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBR,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BQ,OAAO,EAAGV,aAAe;IACzBG,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBM,IAAI,EAAG,IAAAT,QAAE,EACR,wJACD;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_jsxRuntime","stickyOptions","label","__","value","StickyControl","onChange","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","options","help"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/sticky-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst stickyOptions = [\n\t{ label: __( 'Include' ), value: '' },\n\t{ label: __( 'Exclude' ), value: 'exclude' },\n\t{ label: __( 'Only' ), value: 'only' },\n];\n\nexport default function StickyControl( { value, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Sticky posts' ) }\n\t\t\toptions={ stickyOptions }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'Sticky posts always appear first, regardless of their publish date.'\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,aAAa,GAAG,CACrB;EAAEC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAG,CAAC,EACrC;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAU,CAAC,EAC5C;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EAAEC,KAAK,EAAE;AAAO,CAAC,CACtC;AAEc,SAASC,aAAaA,CAAE;EAAED,KAAK;EAAEE;AAAS,CAAC,EAAG;EAC5D,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACV,WAAA,CAAAW,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBR,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BQ,OAAO,EAAGV,aAAe;IACzBG,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBM,IAAI,EAAG,IAAAT,QAAE,EACR,qEACD;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = QueryToolbar;
7
7
  var _components = require("@wordpress/components");
8
8
  var _i18n = require("@wordpress/i18n");
9
- var _icons = require("@wordpress/icons");
10
9
  var _utils = require("../utils");
11
10
  var _jsxRuntime = require("react/jsx-runtime");
12
11
  /**
@@ -18,91 +17,19 @@ var _jsxRuntime = require("react/jsx-runtime");
18
17
  */
19
18
 
20
19
  function QueryToolbar({
21
- attributes: {
22
- query
23
- },
24
- setQuery,
25
20
  openPatternSelectionModal,
26
21
  name,
27
22
  clientId
28
23
  }) {
29
24
  const hasPatterns = !!(0, _utils.usePatterns)(clientId, name).length;
30
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
31
- children: [!query.inherit && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
32
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
33
- contentClassName: "block-library-query-toolbar__popover",
34
- renderToggle: ({
35
- onToggle
36
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
37
- icon: _icons.settings,
38
- label: (0, _i18n.__)('Display settings'),
39
- onClick: onToggle
40
- }),
41
- renderContent: () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
42
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
43
- __unstableInputWidth: "60px",
44
- className: "block-library-query-toolbar__popover-number-control",
45
- label: (0, _i18n.__)('Items per Page'),
46
- labelPosition: "edge",
47
- min: 1,
48
- max: 100,
49
- onChange: value => {
50
- if (isNaN(value) || value < 1 || value > 100) {
51
- return;
52
- }
53
- setQuery({
54
- perPage: value
55
- });
56
- },
57
- step: "1",
58
- value: query.perPage,
59
- isDragEnabled: false
60
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
61
- __unstableInputWidth: "60px",
62
- className: "block-library-query-toolbar__popover-number-control",
63
- label: (0, _i18n.__)('Offset'),
64
- labelPosition: "edge",
65
- min: 0,
66
- max: 100,
67
- onChange: value => {
68
- if (isNaN(value) || value < 0 || value > 100) {
69
- return;
70
- }
71
- setQuery({
72
- offset: value
73
- });
74
- },
75
- step: "1",
76
- value: query.offset,
77
- isDragEnabled: false
78
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
79
- __unstableInputWidth: "60px",
80
- className: "block-library-query-toolbar__popover-number-control",
81
- label: (0, _i18n.__)('Max pages to show'),
82
- labelPosition: "edge",
83
- min: 0,
84
- onChange: value => {
85
- if (isNaN(value) || value < 0) {
86
- return;
87
- }
88
- setQuery({
89
- pages: value
90
- });
91
- },
92
- step: "1",
93
- value: query.pages,
94
- isDragEnabled: false,
95
- help: (0, _i18n.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
96
- })]
97
- })
98
- })
99
- }), hasPatterns && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
26
+ children: hasPatterns && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
100
27
  className: "wp-block-template-part__block-control-group",
101
28
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
102
29
  onClick: openPatternSelectionModal,
103
30
  children: (0, _i18n.__)('Replace')
104
31
  })
105
- })]
32
+ })
106
33
  });
107
34
  }
108
35
  //# sourceMappingURL=query-toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","_utils","_jsxRuntime","QueryToolbar","attributes","query","setQuery","openPatternSelectionModal","name","clientId","hasPatterns","usePatterns","length","jsxs","Fragment","children","inherit","jsx","ToolbarGroup","Dropdown","contentClassName","renderToggle","onToggle","ToolbarButton","icon","settings","label","__","onClick","renderContent","__experimentalNumberControl","__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={ open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pBC,GAAG,EAAG,CAAG;YACTE,QAAQ,EAAKC,KAAK,IAAM;cACvB,IAAKC,KAAK,CAAED,KAAM,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAG;gBAClC;cACD;cACA/B,QAAQ,CAAE;gBAAEqC,KAAK,EAAEN;cAAM,CAAE,CAAC;YAC7B,CAAG;YACHG,IAAI,EAAC,GAAG;YACRH,KAAK,EAAGhC,KAAK,CAACsC,KAAO;YACrBF,aAAa,EAAG,KAAO;YACvBG,IAAI,EAAG,IAAAjB,QAAE,EACR,uGACD;UAAG,CACH,CAAC;QAAA,CACD;MACA,CACH;IAAC,CACW,CACd,EACCjB,WAAW,iBACZ,IAAAR,WAAA,CAAAe,GAAA,EAACpB,WAAA,CAAAqB,YAAY;MAACc,SAAS,EAAC,6CAA6C;MAAAjB,QAAA,eACpE,IAAAb,WAAA,CAAAe,GAAA,EAACpB,WAAA,CAAA0B,aAAa;QAACK,OAAO,EAAGrB,yBAA2B;QAAAQ,QAAA,EACjD,IAAAY,QAAE,EAAE,SAAU;MAAC,CACH;IAAC,CACH,CACd;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_utils","_jsxRuntime","QueryToolbar","openPatternSelectionModal","name","clientId","hasPatterns","usePatterns","length","jsx","Fragment","children","ToolbarGroup","className","ToolbarButton","onClick","__"],"sources":["@wordpress/block-library/src/query/edit/query-toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { usePatterns } from '../utils';\n\nexport default function QueryToolbar( {\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst hasPatterns = !! usePatterns( clientId, name ).length;\n\n\treturn (\n\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":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AAAuC,IAAAG,WAAA,GAAAH,OAAA;AATvC;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASI,YAAYA,CAAE;EACrCC,yBAAyB;EACzBC,IAAI;EACJC;AACD,CAAC,EAAG;EACH,MAAMC,WAAW,GAAG,CAAC,CAAE,IAAAC,kBAAW,EAAEF,QAAQ,EAAED,IAAK,CAAC,CAACI,MAAM;EAE3D,oBACC,IAAAP,WAAA,CAAAQ,GAAA,EAAAR,WAAA,CAAAS,QAAA;IAAAC,QAAA,EACGL,WAAW,iBACZ,IAAAL,WAAA,CAAAQ,GAAA,EAACZ,WAAA,CAAAe,YAAY;MAACC,SAAS,EAAC,6CAA6C;MAAAF,QAAA,eACpE,IAAAV,WAAA,CAAAQ,GAAA,EAACZ,WAAA,CAAAiB,aAAa;QAACC,OAAO,EAAGZ,yBAA2B;QAAAQ,QAAA,EACjD,IAAAK,QAAE,EAAE,SAAU;MAAC,CACH;IAAC,CACH;EACd,CACA,CAAC;AAEL","ignoreList":[]}
@@ -161,12 +161,17 @@ exports.usePostTypes = usePostTypes;
161
161
  const useTaxonomies = postType => {
162
162
  const taxonomies = (0, _data.useSelect)(select => {
163
163
  const {
164
- getTaxonomies
164
+ getTaxonomies,
165
+ getPostType
165
166
  } = select(_coreData.store);
166
- return getTaxonomies({
167
- type: postType,
168
- per_page: -1
169
- });
167
+ // Does the post type have taxonomies?
168
+ if (getPostType(postType)?.taxonomies?.length > 0) {
169
+ return getTaxonomies({
170
+ type: postType,
171
+ per_page: -1
172
+ });
173
+ }
174
+ return [];
170
175
  }, [postType]);
171
176
  return (0, _element.useMemo)(() => {
172
177
  return taxonomies?.filter(({
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_coreData","_blockEditor","_htmlEntities","_blocks","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","exports","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","decodeEntities","usePostTypes","postTypes","useSelect","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","useMemo","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","visibility","publicly_queryable","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","blocksStore","getActiveBlockVariation","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","namespace","clonedBlocks","block","cloneBlock","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","hasActiveVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","blockSupportsInteractivity","Object","is","getBlockSupport","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":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,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,GAAG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,CAAEtB,QAAS,CAAC,CAACtD,OAAO,CAC1C8E,kBAAkB,IAAM;MACzB,MAAMlB,SAAS,GAAGiB,YAAY,CAAEC,kBAAmB,CAAC;MACpD;AACL;AACA;AACA;AACA;MACK,MAAMC,0BAA0B,GAAGC,MAAM,CAACC,EAAE,CAC3C,IAAAC,uBAAe,EAAEtB,SAAS,EAAE,eAAgB,CAAC,EAC7C,IACD,CAAC;MACD,MAAMuB,0CAA0C,GAC/C,IAAAD,uBAAe,EACdtB,SAAS,EACT,gCACD,CAAC;MACF,MAAMwB,kBAAkB,GACvBL,0BAA0B,IAC1BI,0CAA0C;MAC3C,IAAK,CAAEC,kBAAkB,EAAG;QAC3BzC,MAAM,CAAC0C,oBAAoB,GAAG,IAAI;MACnC,CAAC,MAAM,IAAKzB,SAAS,KAAK,mBAAmB,EAAG;QAC/CjB,MAAM,CAAC2C,mBAAmB,GAAG,IAAI;MAClC;IACD,CACD,CAAC;IACD3C,MAAM,CAAC4C,oBAAoB,GAC1B5C,MAAM,CAAC0C,oBAAoB,IAAI1C,MAAM,CAAC2C,mBAAmB;IAC1D,OAAO3C,MAAM;EACd,CAAC,EACD,CAAEW,QAAQ,CACX,CAAC;AACF,CAAC;AAAC7D,OAAA,CAAAkF,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_coreData","_blockEditor","_htmlEntities","_blocks","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","exports","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","decodeEntities","usePostTypes","postTypes","useSelect","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","useMemo","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","getPostType","visibility","publicly_queryable","useIsPostTypeHierarchical","hierarchical","useAllowedControls","attributes","blocksStore","getActiveBlockVariation","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","namespace","clonedBlocks","block","cloneBlock","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","hasActiveVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","blockSupportsInteractivity","Object","is","getBlockSupport","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, getPostType } = select( coreStore );\n\t\t\t// Does the post type have taxonomies?\n\t\t\tif ( getPostType( postType )?.taxonomies?.length > 0 ) {\n\t\t\t\treturn getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn [];\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":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,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;AARAU,OAAA,CAAAZ,eAAA,GAAAA,eAAA;AASO,MAAMa,sBAAsB,GA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AC7C,IACD,CAAC;MACD,MAAMuB,0CAA0C,GAC/C,IAAAD,uBAAe,EACdtB,SAAS,EACT,gCACD,CAAC;MACF,MAAMwB,kBAAkB,GACvBL,0BAA0B,IAC1BI,0CAA0C;MAC3C,IAAK,CAAEC,kBAAkB,EAAG;QAC3BzC,MAAM,CAAC0C,oBAAoB,GAAG,IAAI;MACnC,CAAC,MAAM,IAAKzB,SAAS,KAAK,mBAAmB,EAAG;QAC/CjB,MAAM,CAAC2C,mBAAmB,GAAG,IAAI;MAClC;IACD,CACD,CAAC;IACD3C,MAAM,CAAC4C,oBAAoB,GAC1B5C,MAAM,CAAC0C,oBAAoB,IAAI1C,MAAM,CAAC2C,mBAAmB;IAC1D,OAAO3C,MAAM;EACd,CAAC,EACD,CAAEW,QAAQ,CACX,CAAC;AACF,CAAC;AAAC7D,OAAA,CAAAkF,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -28,6 +28,7 @@ function QueryTitleEdit({
28
28
  attributes: {
29
29
  type,
30
30
  level,
31
+ levelOptions,
31
32
  textAlign,
32
33
  showPrefix,
33
34
  showSearchTerm
@@ -117,6 +118,7 @@ function QueryTitleEdit({
117
118
  group: "block",
118
119
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.HeadingLevelDropdown, {
119
120
  value: level,
121
+ options: levelOptions,
120
122
  onChange: newLevel => setAttributes({
121
123
  level: newLevel
122
124
  })
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_useArchiveLabel","_jsxRuntime","SUPPORTED_TYPES","QueryTitleEdit","attributes","type","level","textAlign","showPrefix","showSearchTerm","setAttributes","archiveTypeLabel","archiveNameLabel","useArchiveLabel","TagName","blockProps","useBlockProps","className","clsx","includes","jsx","children","Warning","__","titleElement","title","sprintf","jsxs","Fragment","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","label","onChange","checked","BlockControls","group","HeadingLevelDropdown","value","newLevel","AlignmentControl","nextAlign"],"sources":["@wordpress/block-library/src/query-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { ToggleControl, PanelBody } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useArchiveLabel } from './use-archive-label';\n\nconst SUPPORTED_TYPES = [ 'archive', 'search' ];\n\nexport default function QueryTitleEdit( {\n\tattributes: { type, level, textAlign, showPrefix, showSearchTerm },\n\tsetAttributes,\n} ) {\n\tconst { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();\n\n\tconst TagName = `h${ level }`;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-query-title__placeholder', {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tif ( ! SUPPORTED_TYPES.includes( type ) ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ __( 'Provided type is not supported.' ) }</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet titleElement;\n\tif ( type === 'archive' ) {\n\t\tlet title;\n\t\tif ( archiveTypeLabel ) {\n\t\t\tif ( showPrefix ) {\n\t\t\t\tif ( archiveNameLabel ) {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: 1: Archive type title e.g: \"Category\", 2: Label of the archive e.g: \"Shoes\" */\n\t\t\t\t\t\t__( '%1$s: %2$s' ),\n\t\t\t\t\t\tarchiveTypeLabel,\n\t\t\t\t\t\tarchiveNameLabel\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t\t__( '%s: Name' ),\n\t\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( archiveNameLabel ) {\n\t\t\t\ttitle = archiveNameLabel;\n\t\t\t} else {\n\t\t\t\ttitle = sprintf(\n\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t__( '%s name' ),\n\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\ttitle = showPrefix\n\t\t\t\t? __( 'Archive type: Name' )\n\t\t\t\t: __( 'Archive title' );\n\t\t}\n\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show archive type in title' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showPrefix: ! showPrefix } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showPrefix }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<TagName { ...blockProps }>{ title }</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( type === 'search' ) {\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show search term in title' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowSearchTerm: ! showSearchTerm,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showSearchTerm }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t{ showSearchTerm\n\t\t\t\t\t\t? __( 'Search results for: “search term”' )\n\t\t\t\t\t\t: __( 'Search results' ) }\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\tvalue={ level }\n\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t{ titleElement }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AAAsD,IAAAK,WAAA,GAAAL,OAAA;AAtBtD;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAMM,eAAe,GAAG,CAAE,SAAS,EAAE,QAAQ,CAAE;AAEhC,SAASC,cAAcA,CAAE;EACvCC,UAAU,EAAE;IAAEC,IAAI;IAAEC,KAAK;IAAEC,SAAS;IAAEC,UAAU;IAAEC;EAAe,CAAC;EAClEC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAG,IAAAC,gCAAe,EAAC,CAAC;EAEhE,MAAMC,OAAO,GAAI,IA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MAAC,CACM,CAAC,eAEpB,IAAAR,WAAA,CAAAmB,GAAA,EAACN,OAAO;QAAA,GAAMC,UAAU;QAAAM,QAAA,EACrBZ,cAAc,GACb,IAAAc,QAAE,EAAE,mCAAoC,CAAC,GACzC,IAAAA,QAAE,EAAE,gBAAiB;MAAC,CACjB,CAAC;IAAA,CACT,CACF;EACF;EAEA,oBACC,IAAAtB,WAAA,CAAA0B,IAAA,EAAA1B,WAAA,CAAA2B,QAAA;IAAAP,QAAA,gBACC,IAAApB,WAAA,CAAA0B,IAAA,EAAC9B,YAAA,CAAAuC,aAAa;MAACC,KAAK,EAAC,OAAO;MAAAhB,QAAA,gBAC3B,IAAApB,WAAA,CAAAmB,GAAA,EAACvB,YAAA,CAAAyC,oBAAoB;QACpBC,KAAK,EAAGjC,KAAO;QACf4B,QAAQ,EAAKM,QAAQ,IACpB9B,aAAa,CAAE;UAAEJ,KAAK,EAAEkC;QAAS,CAAE;MACnC,CACD,CAAC,eACF,IAAAvC,WAAA,CAAAmB,GAAA,EAACvB,YAAA,CAAA4C,gBAAgB;QAChBF,KAAK,EAAGhC,SAAW;QACnB2B,QAAQ,EAAKQ,SAAS,IAAM;UAC3BhC,aAAa,CAAE;YAAEH,SAAS,EAAEmC;UAAU,CAAE,CAAC;QAC1C;MAAG,CACH,CAAC;IAAA,CACY,CAAC,EACdlB,YAAY;EAAA,CACb,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_useArchiveLabel","_jsxRuntime","SUPPORTED_TYPES","QueryTitleEdit","attributes","type","level","levelOptions","textAlign","showPrefix","showSearchTerm","setAttributes","archiveTypeLabel","archiveNameLabel","useArchiveLabel","TagName","blockProps","useBlockProps","className","clsx","includes","jsx","children","Warning","__","titleElement","title","sprintf","jsxs","Fragment","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","label","onChange","checked","BlockControls","group","HeadingLevelDropdown","value","options","newLevel","AlignmentControl","nextAlign"],"sources":["@wordpress/block-library/src/query-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { ToggleControl, PanelBody } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useArchiveLabel } from './use-archive-label';\n\nconst SUPPORTED_TYPES = [ 'archive', 'search' ];\n\nexport default function QueryTitleEdit( {\n\tattributes: {\n\t\ttype,\n\t\tlevel,\n\t\tlevelOptions,\n\t\ttextAlign,\n\t\tshowPrefix,\n\t\tshowSearchTerm,\n\t},\n\tsetAttributes,\n} ) {\n\tconst { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();\n\n\tconst TagName = `h${ level }`;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-query-title__placeholder', {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tif ( ! SUPPORTED_TYPES.includes( type ) ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ __( 'Provided type is not supported.' ) }</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet titleElement;\n\tif ( type === 'archive' ) {\n\t\tlet title;\n\t\tif ( archiveTypeLabel ) {\n\t\t\tif ( showPrefix ) {\n\t\t\t\tif ( archiveNameLabel ) {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: 1: Archive type title e.g: \"Category\", 2: Label of the archive e.g: \"Shoes\" */\n\t\t\t\t\t\t__( '%1$s: %2$s' ),\n\t\t\t\t\t\tarchiveTypeLabel,\n\t\t\t\t\t\tarchiveNameLabel\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t\t__( '%s: Name' ),\n\t\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( archiveNameLabel ) {\n\t\t\t\ttitle = archiveNameLabel;\n\t\t\t} else {\n\t\t\t\ttitle = sprintf(\n\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t__( '%s name' ),\n\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\ttitle = showPrefix\n\t\t\t\t? __( 'Archive type: Name' )\n\t\t\t\t: __( 'Archive title' );\n\t\t}\n\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show archive type in title' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showPrefix: ! showPrefix } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showPrefix }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<TagName { ...blockProps }>{ title }</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( type === 'search' ) {\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show search term in title' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowSearchTerm: ! showSearchTerm,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showSearchTerm }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t{ showSearchTerm\n\t\t\t\t\t\t? __( 'Search results for: “search term”' )\n\t\t\t\t\t\t: __( 'Search results' ) }\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\tvalue={ level }\n\t\t\t\t\toptions={ levelOptions }\n\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t{ titleElement }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AAAsD,IAAAK,WAAA,GAAAL,OAAA;AAtBtD;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAMM,eAAe,GAAG,CAAE,SAAS,EAAE,QAAQ,CAAE;AAEhC,SAASC,cAAcA,CAAE;EACvCC,UAAU,EAAE;IACXC,IAAI;IACJC,KAAK;IACLC,YAAY;IACZC,SAAS;IACTC,UAAU;IACVC;EACD,CAAC;EACDC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,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cACdD,cAAc,EAAE,CAAEA;YACnB,CAAE,CACF;YACD0B,OAAO,EAAG1B;UAAgB,CAC1B;QAAC,CACQ;MAAC,CACM,CAAC,eAEpB,IAAAT,WAAA,CAAAoB,GAAA,EAACN,OAAO;QAAA,GAAMC,UAAU;QAAAM,QAAA,EACrBZ,cAAc,GACb,IAAAc,QAAE,EAAE,mCAAoC,CAAC,GACzC,IAAAA,QAAE,EAAE,gBAAiB;MAAC,CACjB,CAAC;IAAA,CACT,CACF;EACF;EAEA,oBACC,IAAAvB,WAAA,CAAA2B,IAAA,EAAA3B,WAAA,CAAA4B,QAAA;IAAAP,QAAA,gBACC,IAAArB,WAAA,CAAA2B,IAAA,EAAC/B,YAAA,CAAAwC,aAAa;MAACC,KAAK,EAAC,OAAO;MAAAhB,QAAA,gBAC3B,IAAArB,WAAA,CAAAoB,GAAA,EAACxB,YAAA,CAAA0C,oBAAoB;QACpBC,KAAK,EAAGlC,KAAO;QACfmC,OAAO,EAAGlC,YAAc;QACxB4B,QAAQ,EAAKO,QAAQ,IACpB/B,aAAa,CAAE;UAAEL,KAAK,EAAEoC;QAAS,CAAE;MACnC,CACD,CAAC,eACF,IAAAzC,WAAA,CAAAoB,GAAA,EAACxB,YAAA,CAAA8C,gBAAgB;QAChBH,KAAK,EAAGhC,SAAW;QACnB2B,QAAQ,EAAKS,SAAS,IAAM;UAC3BjC,aAAa,CAAE;YAAEH,SAAS,EAAEoC;UAAU,CAAE,CAAC;QAC1C;MAAG,CACH,CAAC;IAAA,CACY,CAAC,EACdnB,YAAY;EAAA,CACb,CAAC;AAEL","ignoreList":[]}
@@ -35,6 +35,9 @@ const metadata = exports.metadata = {
35
35
  type: "number",
36
36
  "default": 1
37
37
  },
38
+ levelOptions: {
39
+ type: "array"
40
+ },
38
41
  showPrefix: {
39
42
  type: "boolean",
40
43
  "default": true
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_variations","_deprecated","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","type","textAlign","level","showPrefix","showSearchTerm","supports","align","html","color","gradients","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalTextDecoration","interactivity","clientNavigation","style","settings","icon","edit","variations","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/query-title/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { title as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAZA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAM,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,IAAA;MAAAA,IAAA;IAAA;IAAAC,SAAA;MAAAD,IAAA;IAAA;IAAAE,KAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,UAAA;MAAAH,IAAA;MAAA;IAAA;IAAAI,cAAA;MAAAJ,IAAA;MAAA;IAAA;EAAA;EAAAK,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,wBAAA;MAAAC,2BAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAC,KAAA;AAAA;AASA,MAAM;EAAEjC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMkC,QAAQ,GAAArC,OAAA,CAAAqC,QAAA,GAAG;EACvBC,IAAI,EAAJA,YAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAExC,IAAI;EAAEJ,QAAQ;EAAEsC;AAAS,CAAE,CAAC;AAACrC,OAAA,CAAA0C,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_variations","_deprecated","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","type","textAlign","level","levelOptions","showPrefix","showSearchTerm","supports","align","html","color","gradients","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalTextDecoration","interactivity","clientNavigation","style","settings","icon","edit","variations","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/query-title/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { title as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAZA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAM,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,IAAA;MAAAA,IAAA;IAAA;IAAAC,SAAA;MAAAD,IAAA;IAAA;IAAAE,KAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,YAAA;MAAAH,IAAA;IAAA;IAAAI,UAAA;MAAAJ,IAAA;MAAA;IAAA;IAAAK,cAAA;MAAAL,IAAA;MAAA;IAAA;EAAA;EAAAM,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,wBAAA;MAAAC,2BAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAC,KAAA;AAAA;AASA,MAAM;EAAElC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMmC,QAAQ,GAAAtC,OAAA,CAAAsC,QAAA,GAAG;EACvBC,IAAI,EAAJA,YAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEzC,IAAI;EAAEJ,QAAQ;EAAEuC;AAAS,CAAE,CAAC;AAACtC,OAAA,CAAA2C,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -303,6 +303,7 @@ const SiteLogo = ({
303
303
  // This is a light wrapper around MediaReplaceFlow because the block has two
304
304
  // different MediaReplaceFlows, one for the inspector and one for the toolbar.
305
305
  function SiteLogoReplaceFlow({
306
+ mediaURL,
306
307
  onRemoveLogo,
307
308
  ...mediaReplaceProps
308
309
  }) {
@@ -310,8 +311,13 @@ function SiteLogoReplaceFlow({
310
311
  ...mediaReplaceProps,
311
312
  allowedTypes: ALLOWED_MEDIA_TYPES,
312
313
  accept: ACCEPT_MEDIA_STRING,
313
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
314
- onClick: onRemoveLogo,
314
+ children: ({
315
+ onClose
316
+ }) => mediaURL && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
317
+ onClick: () => {
318
+ onRemoveLogo();
319
+ onClose();
320
+ },
315
321
  children: (0, _i18n.__)('Reset')
316
322
  })
317
323
  });
@@ -473,16 +479,18 @@ function LogoEdit({
473
479
  }
474
480
  onInitialSelectLogo(image);
475
481
  },
476
- onError: onUploadError
482
+ onError: onUploadError,
483
+ onRemoveLogo
477
484
  });
478
485
  };
479
486
  const mediaReplaceFlowProps = {
480
487
  mediaURL: logoUrl,
488
+ name: !logoUrl ? (0, _i18n.__)('Choose logo') : (0, _i18n.__)('Replace'),
481
489
  onSelect: onSelectLogo,
482
490
  onError: onUploadError,
483
491
  onRemoveLogo
484
492
  };
485
- const controls = canUserEdit && logoUrl && !temporaryURL && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
493
+ const controls = canUserEdit && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
486
494
  group: "other",
487
495
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SiteLogoReplaceFlow, {
488
496
  ...mediaReplaceFlowProps
@@ -537,7 +545,6 @@ function LogoEdit({
537
545
  const blockProps = (0, _blockEditor.useBlockProps)({
538
546
  className: classes
539
547
  });
540
- const label = (0, _i18n.__)('Add a site logo');
541
548
  const mediaInspectorPanel = (canUserEdit || logoUrl) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
542
549
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
543
550
  title: (0, _i18n.__)('Media'),
@@ -566,7 +573,7 @@ function LogoEdit({
566
573
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
567
574
  onClick: open,
568
575
  variant: "secondary",
569
- children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}) : (0, _i18n.__)('Add media')
576
+ children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}) : (0, _i18n.__)('Choose logo')
570
577
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropZone, {
571
578
  onFilesDrop: onFilesDrop
572
579
  })]
@@ -596,9 +603,9 @@ function LogoEdit({
596
603
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
597
604
  icon: _icons.upload,
598
605
  variant: "primary",
599
- label: label,
606
+ label: (0, _i18n.__)('Choose logo'),
600
607
  showTooltip: true,
601
- tooltipPosition: "top center",
608
+ tooltipPosition: "middle right",
602
609
  onClick: () => {
603
610
  open();
604
611
  }