@wordpress/block-library 9.10.0 → 9.12.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 (307) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +10 -5
  3. package/build/archives/index.js +6 -0
  4. package/build/archives/index.js.map +1 -1
  5. package/build/avatar/hooks.js +2 -3
  6. package/build/avatar/hooks.js.map +1 -1
  7. package/build/button/get-updated-link-attributes.js +1 -1
  8. package/build/button/get-updated-link-attributes.js.map +1 -1
  9. package/build/button/index.js +1 -1
  10. package/build/button/index.js.map +1 -1
  11. package/build/comments/index.js +12 -0
  12. package/build/comments/index.js.map +1 -1
  13. package/build/cover/constants.js +8 -0
  14. package/build/cover/constants.js.map +1 -0
  15. package/build/cover/deprecated.js +140 -4
  16. package/build/cover/deprecated.js.map +1 -1
  17. package/build/cover/edit/block-controls.js +1 -1
  18. package/build/cover/edit/block-controls.js.map +1 -1
  19. package/build/cover/edit/cover-placeholder.js +1 -2
  20. package/build/cover/edit/cover-placeholder.js.map +1 -1
  21. package/build/cover/edit/index.js +42 -21
  22. package/build/cover/edit/index.js.map +1 -1
  23. package/build/cover/edit/inspector-controls.js +40 -2
  24. package/build/cover/edit/inspector-controls.js.map +1 -1
  25. package/build/cover/index.js +3 -0
  26. package/build/cover/index.js.map +1 -1
  27. package/build/cover/save.js +16 -14
  28. package/build/cover/save.js.map +1 -1
  29. package/build/details/index.js +1 -0
  30. package/build/details/index.js.map +1 -1
  31. package/build/file/edit.js +2 -3
  32. package/build/file/edit.js.map +1 -1
  33. package/build/gallery/constants.js +2 -1
  34. package/build/gallery/constants.js.map +1 -1
  35. package/build/gallery/edit.js +12 -3
  36. package/build/gallery/edit.js.map +1 -1
  37. package/build/gallery/utils.js +26 -5
  38. package/build/gallery/utils.js.map +1 -1
  39. package/build/html/edit.js +5 -1
  40. package/build/html/edit.js.map +1 -1
  41. package/build/html/preview.js +2 -2
  42. package/build/html/preview.js.map +1 -1
  43. package/build/image/edit.js +1 -1
  44. package/build/image/edit.js.map +1 -1
  45. package/build/image/image.js +144 -78
  46. package/build/image/image.js.map +1 -1
  47. package/build/image/index.js +1 -1
  48. package/build/latest-posts/edit.js +3 -9
  49. package/build/latest-posts/edit.js.map +1 -1
  50. package/build/lock-unlock.js.map +1 -1
  51. package/build/navigation/edit/menu-inspector-controls.js +1 -1
  52. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  53. package/build/navigation/edit/navigation-menu-selector.js +2 -2
  54. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  55. package/build/paragraph/edit.js +2 -2
  56. package/build/paragraph/edit.js.map +1 -1
  57. package/build/post-content/index.js +13 -0
  58. package/build/post-content/index.js.map +1 -1
  59. package/build/post-featured-image/edit.js +1 -1
  60. package/build/post-featured-image/edit.js.map +1 -1
  61. package/build/post-template/edit.js +11 -0
  62. package/build/post-template/edit.js.map +1 -1
  63. package/build/post-template/index.js +1 -1
  64. package/build/post-time-to-read/edit.js +2 -2
  65. package/build/post-time-to-read/edit.js.map +1 -1
  66. package/build/query/edit/inspector-controls/index.js +2 -2
  67. package/build/query/edit/inspector-controls/index.js.map +1 -1
  68. package/build/query/edit/inspector-controls/order-control.js +2 -2
  69. package/build/query/edit/inspector-controls/order-control.js.map +1 -1
  70. package/build/query/edit/pattern-selection-modal.js +0 -3
  71. package/build/query/edit/pattern-selection-modal.js.map +1 -1
  72. package/build/query/edit/query-content.js +10 -12
  73. package/build/query/edit/query-content.js.map +1 -1
  74. package/build/query/index.js +1 -1
  75. package/build/query/utils.js +32 -1
  76. package/build/query/utils.js.map +1 -1
  77. package/build/query-title/edit.js +1 -1
  78. package/build/query-title/edit.js.map +1 -1
  79. package/build/search/edit.js +19 -14
  80. package/build/search/edit.js.map +1 -1
  81. package/build/separator/transforms.js +12 -0
  82. package/build/separator/transforms.js.map +1 -1
  83. package/build/social-links/edit.js +0 -1
  84. package/build/social-links/edit.js.map +1 -1
  85. package/build/spacer/index.js +2 -0
  86. package/build/spacer/index.js.map +1 -1
  87. package/build/spacer/transforms.js +27 -0
  88. package/build/spacer/transforms.js.map +1 -0
  89. package/build/table/edit.js +0 -1
  90. package/build/table/edit.js.map +1 -1
  91. package/build/table-of-contents/edit.js +2 -7
  92. package/build/table-of-contents/edit.js.map +1 -1
  93. package/build/template-part/edit/index.js +2 -5
  94. package/build/template-part/edit/index.js.map +1 -1
  95. package/build/template-part/edit/selection-modal.js +0 -3
  96. package/build/template-part/edit/selection-modal.js.map +1 -1
  97. package/build/video/edit.js +1 -1
  98. package/build/video/edit.js.map +1 -1
  99. package/build/video/tracks-editor.js +1 -3
  100. package/build/video/tracks-editor.js.map +1 -1
  101. package/build-module/archives/index.js +6 -0
  102. package/build-module/archives/index.js.map +1 -1
  103. package/build-module/avatar/hooks.js +2 -3
  104. package/build-module/avatar/hooks.js.map +1 -1
  105. package/build-module/button/get-updated-link-attributes.js +1 -1
  106. package/build-module/button/get-updated-link-attributes.js.map +1 -1
  107. package/build-module/button/index.js +1 -1
  108. package/build-module/button/index.js.map +1 -1
  109. package/build-module/comments/index.js +12 -0
  110. package/build-module/comments/index.js.map +1 -1
  111. package/build-module/cover/constants.js +2 -0
  112. package/build-module/cover/constants.js.map +1 -0
  113. package/build-module/cover/deprecated.js +140 -4
  114. package/build-module/cover/deprecated.js.map +1 -1
  115. package/build-module/cover/edit/block-controls.js +1 -1
  116. package/build-module/cover/edit/block-controls.js.map +1 -1
  117. package/build-module/cover/edit/cover-placeholder.js +1 -2
  118. package/build-module/cover/edit/cover-placeholder.js.map +1 -1
  119. package/build-module/cover/edit/index.js +42 -21
  120. package/build-module/cover/edit/index.js.map +1 -1
  121. package/build-module/cover/edit/inspector-controls.js +41 -3
  122. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  123. package/build-module/cover/index.js +3 -0
  124. package/build-module/cover/index.js.map +1 -1
  125. package/build-module/cover/save.js +16 -14
  126. package/build-module/cover/save.js.map +1 -1
  127. package/build-module/details/index.js +1 -0
  128. package/build-module/details/index.js.map +1 -1
  129. package/build-module/file/edit.js +2 -3
  130. package/build-module/file/edit.js.map +1 -1
  131. package/build-module/gallery/constants.js +1 -0
  132. package/build-module/gallery/constants.js.map +1 -1
  133. package/build-module/gallery/edit.js +15 -6
  134. package/build-module/gallery/edit.js.map +1 -1
  135. package/build-module/gallery/utils.js +27 -6
  136. package/build-module/gallery/utils.js.map +1 -1
  137. package/build-module/html/edit.js +6 -2
  138. package/build-module/html/edit.js.map +1 -1
  139. package/build-module/html/preview.js +2 -2
  140. package/build-module/html/preview.js.map +1 -1
  141. package/build-module/image/edit.js +1 -1
  142. package/build-module/image/edit.js.map +1 -1
  143. package/build-module/image/image.js +149 -83
  144. package/build-module/image/image.js.map +1 -1
  145. package/build-module/image/index.js +1 -1
  146. package/build-module/latest-posts/edit.js +3 -9
  147. package/build-module/latest-posts/edit.js.map +1 -1
  148. package/build-module/lock-unlock.js.map +1 -1
  149. package/build-module/navigation/edit/menu-inspector-controls.js +1 -3
  150. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  151. package/build-module/navigation/edit/navigation-menu-selector.js +2 -2
  152. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  153. package/build-module/paragraph/edit.js +2 -2
  154. package/build-module/paragraph/edit.js.map +1 -1
  155. package/build-module/post-content/index.js +13 -0
  156. package/build-module/post-content/index.js.map +1 -1
  157. package/build-module/post-featured-image/edit.js +1 -1
  158. package/build-module/post-featured-image/edit.js.map +1 -1
  159. package/build-module/post-template/edit.js +11 -0
  160. package/build-module/post-template/edit.js.map +1 -1
  161. package/build-module/post-template/index.js +1 -1
  162. package/build-module/post-time-to-read/edit.js +2 -2
  163. package/build-module/post-time-to-read/edit.js.map +1 -1
  164. package/build-module/query/edit/inspector-controls/index.js +2 -2
  165. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  166. package/build-module/query/edit/inspector-controls/order-control.js +2 -2
  167. package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
  168. package/build-module/query/edit/pattern-selection-modal.js +0 -3
  169. package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
  170. package/build-module/query/edit/query-content.js +10 -12
  171. package/build-module/query/edit/query-content.js.map +1 -1
  172. package/build-module/query/index.js +1 -1
  173. package/build-module/query/utils.js +29 -0
  174. package/build-module/query/utils.js.map +1 -1
  175. package/build-module/query-title/edit.js +2 -2
  176. package/build-module/query-title/edit.js.map +1 -1
  177. package/build-module/search/edit.js +20 -15
  178. package/build-module/search/edit.js.map +1 -1
  179. package/build-module/separator/transforms.js +12 -0
  180. package/build-module/separator/transforms.js.map +1 -1
  181. package/build-module/social-links/edit.js +0 -1
  182. package/build-module/social-links/edit.js.map +1 -1
  183. package/build-module/spacer/index.js +2 -0
  184. package/build-module/spacer/index.js.map +1 -1
  185. package/build-module/spacer/transforms.js +20 -0
  186. package/build-module/spacer/transforms.js.map +1 -0
  187. package/build-module/table/edit.js +0 -1
  188. package/build-module/table/edit.js.map +1 -1
  189. package/build-module/table-of-contents/edit.js +2 -7
  190. package/build-module/table-of-contents/edit.js.map +1 -1
  191. package/build-module/template-part/edit/index.js +2 -5
  192. package/build-module/template-part/edit/index.js.map +1 -1
  193. package/build-module/template-part/edit/selection-modal.js +0 -3
  194. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  195. package/build-module/video/edit.js +1 -1
  196. package/build-module/video/edit.js.map +1 -1
  197. package/build-module/video/tracks-editor.js +2 -4
  198. package/build-module/video/tracks-editor.js.map +1 -1
  199. package/build-style/archives/editor-rtl.css +5 -0
  200. package/build-style/archives/editor.css +5 -0
  201. package/build-style/button/style-rtl.css +3 -0
  202. package/build-style/button/style.css +3 -0
  203. package/build-style/comments/editor-rtl.css +4 -0
  204. package/build-style/comments/editor.css +4 -0
  205. package/build-style/comments/style-rtl.css +4 -0
  206. package/build-style/comments/style.css +4 -0
  207. package/build-style/cover/editor-rtl.css +3 -5
  208. package/build-style/cover/editor.css +3 -5
  209. package/build-style/cover/style-rtl.css +19 -10
  210. package/build-style/cover/style.css +19 -10
  211. package/build-style/editor-rtl.css +17 -12
  212. package/build-style/editor.css +17 -12
  213. package/build-style/image/editor-rtl.css +4 -0
  214. package/build-style/image/editor.css +4 -0
  215. package/build-style/latest-posts/editor-rtl.css +0 -7
  216. package/build-style/latest-posts/editor.css +0 -7
  217. package/build-style/media-text/style-rtl.css +1 -1
  218. package/build-style/media-text/style.css +1 -1
  219. package/build-style/navigation/editor-rtl.css +1 -0
  220. package/build-style/navigation/editor.css +1 -0
  221. package/build-style/style-rtl.css +27 -11
  222. package/build-style/style.css +27 -11
  223. package/build-types/lock-unlock.d.ts +2 -0
  224. package/build-types/lock-unlock.d.ts.map +1 -0
  225. package/package.json +41 -40
  226. package/src/archives/block.json +6 -0
  227. package/src/archives/editor.scss +8 -0
  228. package/src/avatar/hooks.js +2 -3
  229. package/src/avatar/index.php +4 -5
  230. package/src/button/get-updated-link-attributes.js +1 -1
  231. package/src/button/index.js +1 -1
  232. package/src/button/style.scss +3 -0
  233. package/src/button/test/get-updated-link-attributes.js +15 -0
  234. package/src/comment-author-avatar/index.php +1 -1
  235. package/src/comments/block.json +12 -0
  236. package/src/comments/style.scss +4 -1
  237. package/src/cover/block.json +3 -0
  238. package/src/cover/constants.js +1 -0
  239. package/src/cover/deprecated.js +182 -4
  240. package/src/cover/edit/block-controls.js +1 -1
  241. package/src/cover/edit/cover-placeholder.js +0 -3
  242. package/src/cover/edit/index.js +57 -24
  243. package/src/cover/edit/inspector-controls.js +46 -1
  244. package/src/cover/editor.scss +4 -5
  245. package/src/cover/save.js +29 -20
  246. package/src/cover/style.scss +40 -10
  247. package/src/cover/test/__snapshots__/edit.native.js.snap +9 -9
  248. package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
  249. package/src/cover/test/edit.js +1 -3
  250. package/src/cover/test/edit.native.js +4 -4
  251. package/src/cover/test/transforms.native.js +4 -4
  252. package/src/details/block.json +1 -0
  253. package/src/file/edit.js +2 -3
  254. package/src/gallery/constants.js +1 -0
  255. package/src/gallery/edit.js +26 -3
  256. package/src/gallery/utils.js +23 -2
  257. package/src/html/edit.js +7 -1
  258. package/src/html/preview.js +3 -2
  259. package/src/image/block.json +1 -1
  260. package/src/image/edit.js +1 -1
  261. package/src/image/editor.scss +4 -0
  262. package/src/image/image.js +200 -109
  263. package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
  264. package/src/latest-posts/edit.js +3 -8
  265. package/src/latest-posts/editor.scss +0 -11
  266. package/src/latest-posts/index.php +1 -1
  267. package/src/media-text/style.scss +1 -1
  268. package/src/media-text/test/__snapshots__/transforms.native.js.snap +2 -2
  269. package/src/navigation/edit/menu-inspector-controls.js +2 -2
  270. package/src/navigation/edit/navigation-menu-selector.js +2 -2
  271. package/src/navigation/editor.scss +1 -0
  272. package/src/navigation/index.php +1 -1
  273. package/src/paragraph/edit.js +2 -2
  274. package/src/post-content/block.json +14 -1
  275. package/src/post-featured-image/edit.js +1 -1
  276. package/src/post-template/block.json +2 -1
  277. package/src/post-template/edit.js +19 -0
  278. package/src/post-time-to-read/edit.js +2 -2
  279. package/src/post-time-to-read/index.php +1 -1
  280. package/src/query/block.json +1 -1
  281. package/src/query/edit/inspector-controls/index.js +2 -2
  282. package/src/query/edit/inspector-controls/order-control.js +2 -2
  283. package/src/query/edit/pattern-selection-modal.js +0 -3
  284. package/src/query/edit/query-content.js +9 -17
  285. package/src/query/test/utils.js +59 -1
  286. package/src/query/utils.js +29 -0
  287. package/src/query-title/edit.js +2 -2
  288. package/src/rss/index.php +1 -1
  289. package/src/search/edit.js +28 -25
  290. package/src/search/index.php +2 -2
  291. package/src/separator/test/__snapshots__/transforms.native.js.snap +6 -0
  292. package/src/separator/test/transforms.native.js +1 -1
  293. package/src/separator/transforms.js +11 -0
  294. package/src/social-links/edit.js +0 -1
  295. package/src/spacer/index.js +2 -0
  296. package/src/spacer/test/__snapshots__/transforms.native.js.snap +6 -0
  297. package/src/spacer/test/transforms.native.js +1 -1
  298. package/src/spacer/transforms.js +20 -0
  299. package/src/table/edit.js +0 -1
  300. package/src/table-of-contents/edit.js +2 -6
  301. package/src/template-part/edit/index.js +2 -5
  302. package/src/template-part/edit/selection-modal.js +0 -3
  303. package/src/video/edit.js +1 -1
  304. package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
  305. package/src/video/tracks-editor.js +2 -4
  306. package/tsconfig.tsbuildinfo +1 -1
  307. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_coreData","_i18n","_blockEditor","_compose","_element","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_formatControls","_stickyControl","_createNewPostLink","_perPageControl","_offsetControls","_pagesControl","_lockUnlock","_utils","_hooks","_jsxRuntime","BlockInfo","unlock","blockEditorPrivateApis","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","isTemplate","query","displayLayout","order","orderBy","author","authorIds","pages","postType","perPage","offset","sticky","inherit","taxQuery","parents","format","allowedControls","useAllowedControls","showSticky","postTypesTaxonomiesMap","postTypesSelectOptions","postTypeFormatSupportMap","usePostTypes","taxonomies","useTaxonomies","isPostTypeHierarchical","useIsPostTypeHierarchical","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","hasFormatSupport","querySearch","setQuerySearch","useState","search","onChangeDebounced","useCallback","debounce","useEffect","cancel","showInheritControl","isControlAllowed","showPostTypeControl","postTypeControlLabel","__","postTypeControlHelp","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","postTypeHasFormatSupport","showFormatControl","useSelect","select","themeSupports","coreStore","getThemeSupports","formats","some","type","showFiltersPanel","dropdownMenuProps","useToolsPanelDropdownMenuProps","showPostCountControl","showOffSetControl","showPagesControl","showDisplayPanel","jsxs","Fragment","children","jsx","default","PanelBody","title","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","isBlock","onChange","value","help","__experimentalToggleGroupControlOption","SelectControl","options","map","option","RangeControl","columns","min","max","Math","Notice","status","isDismissible","__experimentalToolsPanel","className","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","values","TaxonomyControls","TextControl"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useEffect, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls } from './taxonomy-controls';\nimport FormatControls from './format-controls';\nimport StickyControl from './sticky-control';\nimport CreateNewPostLink from './create-new-post-link';\nimport PerPageControl from './per-page-control';\nimport OffsetControl from './offset-controls';\nimport PagesControl from './pages-control';\nimport { unlock } from '../../../lock-unlock';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n} from '../../utils';\nimport { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout, isTemplate } = props;\n\tconst { query, displayLayout } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpages,\n\t\tpostType,\n\t\tperPage,\n\t\toffset,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t\tformat,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst showSticky = postType === 'post';\n\tconst {\n\t\tpostTypesTaxonomiesMap,\n\t\tpostTypesSelectOptions,\n\t\tpostTypeFormatSupportMap,\n\t} = usePostTypes();\n\tconst taxonomies = useTaxonomies( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\t// Post types can register post format support with `add_post_type_support`.\n\t\t// But we need to reset the `format` property when switching to post types\n\t\t// that do not support post formats.\n\t\tconst hasFormatSupport = postTypeFormatSupportMap[ newValue ];\n\t\tif ( ! hasFormatSupport ) {\n\t\t\tupdateQuery.format = [];\n\t\t}\n\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\n\tconst showInheritControl =\n\t\tisTemplate && isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst postTypeControlLabel = __( 'Post type' );\n\tconst postTypeControlHelp = __(\n\t\t'Select the type of content to display: posts, pages, or custom post types.'\n\t);\n\tconst showColumnsControl = false;\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\tconst showTaxControl =\n\t\t!! taxonomies?.length &&\n\t\tisControlAllowed( allowedControls, 'taxQuery' );\n\tconst showAuthorControl = isControlAllowed( allowedControls, 'author' );\n\tconst showSearchControl = isControlAllowed( allowedControls, 'search' );\n\tconst showParentControl =\n\t\tisControlAllowed( allowedControls, 'parents' ) &&\n\t\tisPostTypeHierarchical;\n\n\tconst postTypeHasFormatSupport = postTypeFormatSupportMap[ postType ];\n\tconst showFormatControl = useSelect(\n\t\t( select ) => {\n\t\t\t// Check if the post type supports post formats and if the control is allowed.\n\t\t\tif (\n\t\t\t\t! postTypeHasFormatSupport ||\n\t\t\t\t! isControlAllowed( allowedControls, 'format' )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst themeSupports = select( coreStore ).getThemeSupports();\n\n\t\t\t// If there are no supported formats, getThemeSupports still includes the default 'standard' format,\n\t\t\t// and in this case the control should not be shown since the user has no other formats to choose from.\n\t\t\treturn (\n\t\t\t\tthemeSupports.formats &&\n\t\t\t\tthemeSupports.formats.length > 0 &&\n\t\t\t\tthemeSupports.formats.some( ( type ) => type !== 'standard' )\n\t\t\t);\n\t\t},\n\t\t[ allowedControls, postTypeHasFormatSupport ]\n\t);\n\n\tconst showFiltersPanel =\n\t\tshowTaxControl ||\n\t\tshowAuthorControl ||\n\t\tshowSearchControl ||\n\t\tshowParentControl ||\n\t\tshowFormatControl;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst showPostCountControl = isControlAllowed(\n\t\tallowedControls,\n\t\t'postCount'\n\t);\n\tconst showOffSetControl = isControlAllowed( allowedControls, 'offset' );\n\tconst showPagesControl = isControlAllowed( allowedControls, 'pages' );\n\n\tconst showDisplayPanel =\n\t\tshowPostCountControl || showOffSetControl || showPagesControl;\n\n\treturn (\n\t\t<>\n\t\t\t{ !! postType && (\n\t\t\t\t<BlockInfo>\n\t\t\t\t\t<CreateNewPostLink postType={ postType } />\n\t\t\t\t</BlockInfo>\n\t\t\t) }\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Query type' ) }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetQuery( { inherit: value === 'default' } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tinherit\n\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t'Display a list of posts or custom post types based on the current template.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Display a list of posts or custom post types based on specific criteria.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ !! inherit ? 'default' : 'custom' }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"default\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"custom\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showPostTypeControl &&\n\t\t\t\t\t\t( postTypesSelectOptions.length > 2 ? (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ postTypesSelectOptions.map( ( option ) => (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\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</ToggleGroupControl>\n\t\t\t\t\t\t) ) }\n\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\tcolumns: value,\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\tmin={ 2 }\n\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Notice>\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\t{ showOrderControl && (\n\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\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</PanelBody>\n\t\t\t) }\n\t\t\t{ ! inherit && showDisplayPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tclassName=\"block-library-query-toolspanel__display\"\n\t\t\t\t\tlabel={ __( 'Display' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\tpages: 0,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Items per page' ) }\n\t\t\t\t\t\thasValue={ () => perPage > 0 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PerPageControl\n\t\t\t\t\t\t\tperPage={ perPage }\n\t\t\t\t\t\t\toffset={ offset }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Offset' ) }\n\t\t\t\t\t\thasValue={ () => offset > 0 }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { offset: 0 } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<OffsetControl\n\t\t\t\t\t\t\toffset={ offset }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Max pages to show' ) }\n\t\t\t\t\t\thasValue={ () => pages > 0 }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { pages: 0 } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PagesControl pages={ pages } onChange={ setQuery } />\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\" // unused but kept for backward compatibility\n\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\tformat: [],\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { taxQuery: null } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showFormatControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! format?.length }\n\t\t\t\t\t\t\tlabel={ __( 'Formats' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { format: [] } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\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AAC1G,cAAA,CAAA2G,OAAa;UACbzE,OAAO,EAAGA,OAAS;UACnBN,QAAQ,EAAGA,QAAU;UACrBuF,QAAQ,EAAGjG;QAAU,CACrB;MAAC,CACa,CAChB,EACCqE,iBAAiB,iBAClB,IAAA5E,WAAA,CAAA+F,GAAA,EAACrH,WAAA,CAAAiJ,4BAAc;QACdC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAEpG,MAAM,EAAEyB,MAAQ;QACpCqD,KAAK,EAAG,IAAArC,QAAE,EAAE,SAAU,CAAG;QACzB4D,UAAU,EAAGA,CAAA,KAAMtH,QAAQ,CAAE;UAAEiB,MAAM,EAAE;QAAG,CAAE,CAAG;QAAAsE,QAAA,eAE/C,IAAA9F,WAAA,CAAA+F,GAAA,EAACxG,eAAA,CAAAyG,OAAc;UACdQ,QAAQ,EAAGjG,QAAU;UACrBG,KAAK,EAAGA;QAAO,CACf;MAAC,CACa,CAChB;IAAA,CACU,CACZ;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_data","_coreData","_i18n","_blockEditor","_compose","_element","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_formatControls","_stickyControl","_createNewPostLink","_perPageControl","_offsetControls","_pagesControl","_lockUnlock","_utils","_hooks","_jsxRuntime","BlockInfo","unlock","blockEditorPrivateApis","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","isSingular","query","displayLayout","order","orderBy","author","authorIds","pages","postType","perPage","offset","sticky","inherit","taxQuery","parents","format","allowedControls","useAllowedControls","showSticky","postTypesTaxonomiesMap","postTypesSelectOptions","postTypeFormatSupportMap","usePostTypes","taxonomies","useTaxonomies","isPostTypeHierarchical","useIsPostTypeHierarchical","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","hasFormatSupport","querySearch","setQuerySearch","useState","search","onChangeDebounced","useCallback","debounce","useEffect","cancel","showInheritControl","isControlAllowed","showPostTypeControl","postTypeControlLabel","__","postTypeControlHelp","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","postTypeHasFormatSupport","showFormatControl","useSelect","select","themeSupports","coreStore","getThemeSupports","formats","some","type","showFiltersPanel","dropdownMenuProps","useToolsPanelDropdownMenuProps","showPostCountControl","showOffSetControl","showPagesControl","showDisplayPanel","jsxs","Fragment","children","jsx","default","PanelBody","title","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","isBlock","onChange","value","help","__experimentalToggleGroupControlOption","SelectControl","options","map","option","RangeControl","columns","min","max","Math","Notice","status","isDismissible","__experimentalToolsPanel","className","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","values","TaxonomyControls","TextControl"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useEffect, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls } from './taxonomy-controls';\nimport FormatControls from './format-controls';\nimport StickyControl from './sticky-control';\nimport CreateNewPostLink from './create-new-post-link';\nimport PerPageControl from './per-page-control';\nimport OffsetControl from './offset-controls';\nimport PagesControl from './pages-control';\nimport { unlock } from '../../../lock-unlock';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n} from '../../utils';\nimport { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout, isSingular } = props;\n\tconst { query, displayLayout } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpages,\n\t\tpostType,\n\t\tperPage,\n\t\toffset,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t\tformat,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst showSticky = postType === 'post';\n\tconst {\n\t\tpostTypesTaxonomiesMap,\n\t\tpostTypesSelectOptions,\n\t\tpostTypeFormatSupportMap,\n\t} = usePostTypes();\n\tconst taxonomies = useTaxonomies( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\t// Post types can register post format support with `add_post_type_support`.\n\t\t// But we need to reset the `format` property when switching to post types\n\t\t// that do not support post formats.\n\t\tconst hasFormatSupport = postTypeFormatSupportMap[ newValue ];\n\t\tif ( ! hasFormatSupport ) {\n\t\t\tupdateQuery.format = [];\n\t\t}\n\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\n\tconst showInheritControl =\n\t\t! isSingular && isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst postTypeControlLabel = __( 'Post type' );\n\tconst postTypeControlHelp = __(\n\t\t'Select the type of content to display: posts, pages, or custom post types.'\n\t);\n\tconst showColumnsControl = false;\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\tconst showTaxControl =\n\t\t!! taxonomies?.length &&\n\t\tisControlAllowed( allowedControls, 'taxQuery' );\n\tconst showAuthorControl = isControlAllowed( allowedControls, 'author' );\n\tconst showSearchControl = isControlAllowed( allowedControls, 'search' );\n\tconst showParentControl =\n\t\tisControlAllowed( allowedControls, 'parents' ) &&\n\t\tisPostTypeHierarchical;\n\n\tconst postTypeHasFormatSupport = postTypeFormatSupportMap[ postType ];\n\tconst showFormatControl = useSelect(\n\t\t( select ) => {\n\t\t\t// Check if the post type supports post formats and if the control is allowed.\n\t\t\tif (\n\t\t\t\t! postTypeHasFormatSupport ||\n\t\t\t\t! isControlAllowed( allowedControls, 'format' )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst themeSupports = select( coreStore ).getThemeSupports();\n\n\t\t\t// If there are no supported formats, getThemeSupports still includes the default 'standard' format,\n\t\t\t// and in this case the control should not be shown since the user has no other formats to choose from.\n\t\t\treturn (\n\t\t\t\tthemeSupports.formats &&\n\t\t\t\tthemeSupports.formats.length > 0 &&\n\t\t\t\tthemeSupports.formats.some( ( type ) => type !== 'standard' )\n\t\t\t);\n\t\t},\n\t\t[ allowedControls, postTypeHasFormatSupport ]\n\t);\n\n\tconst showFiltersPanel =\n\t\tshowTaxControl ||\n\t\tshowAuthorControl ||\n\t\tshowSearchControl ||\n\t\tshowParentControl ||\n\t\tshowFormatControl;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst showPostCountControl = isControlAllowed(\n\t\tallowedControls,\n\t\t'postCount'\n\t);\n\tconst showOffSetControl = isControlAllowed( allowedControls, 'offset' );\n\tconst showPagesControl = isControlAllowed( allowedControls, 'pages' );\n\n\tconst showDisplayPanel =\n\t\tshowPostCountControl || showOffSetControl || showPagesControl;\n\n\treturn (\n\t\t<>\n\t\t\t{ !! postType && (\n\t\t\t\t<BlockInfo>\n\t\t\t\t\t<CreateNewPostLink postType={ postType } />\n\t\t\t\t</BlockInfo>\n\t\t\t) }\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Query type' ) }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetQuery( { inherit: value === 'default' } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tinherit\n\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t'Display a list of posts or custom post types based on the current template.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Display a list of posts or custom post types based on specific criteria.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ !! inherit ? 'default' : 'custom' }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"default\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"custom\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showPostTypeControl &&\n\t\t\t\t\t\t( postTypesSelectOptions.length > 2 ? (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ postTypesSelectOptions.map( ( option ) => (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\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</ToggleGroupControl>\n\t\t\t\t\t\t) ) }\n\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\tcolumns: value,\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\tmin={ 2 }\n\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Notice>\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\t{ showOrderControl && (\n\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\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</PanelBody>\n\t\t\t) }\n\t\t\t{ ! inherit && showDisplayPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tclassName=\"block-library-query-toolspanel__display\"\n\t\t\t\t\tlabel={ __( 'Display' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\tpages: 0,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Items per page' ) }\n\t\t\t\t\t\thasValue={ () => perPage > 0 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PerPageControl\n\t\t\t\t\t\t\tperPage={ perPage }\n\t\t\t\t\t\t\toffset={ offset }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Offset' ) }\n\t\t\t\t\t\thasValue={ () => offset > 0 }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { offset: 0 } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<OffsetControl\n\t\t\t\t\t\t\toffset={ offset }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Max pages to show' ) }\n\t\t\t\t\t\thasValue={ () => pages > 0 }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { pages: 0 } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PagesControl pages={ pages } onChange={ setQuery } />\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\" // unused but kept for backward compatibility\n\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\tformat: [],\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { taxQuery: null } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showFormatControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! format?.length }\n\t\t\t\t\t\t\tlabel={ __( 'Formats' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { format: [] } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FormatControls\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAWA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,cAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,cAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAJ,sBAAA,CAAAR,OAAA;AACA,IAAAa,cAAA,GAAAL,sBAAA,CAAAR,OAAA;AACA,IAAAc,kBAAA,GAAAN,sBAAA,CAAAR,OAAA;AACA,IAAAe,eAAA,GAAAP,sBAAA,CAAAR,OAAA;AACA,IAAAgB,eAAA,GAAAR,sBAAA,CAAAR,OAAA;AACA,IAAAiB,aAAA,GAAAT,sBAAA,CAAAR,OAAA;AACA,IAAAkB,WAA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AAiB,iBAClB,IAAA1E,WAAA,CAAA+F,GAAA,EAACrH,WAAA,CAAAiJ,4BAAc;QACdC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAErG,OAAO,EAAE0B,MAAQ;QACrCqD,KAAK,EAAG,IAAArC,QAAE,EAAE,SAAU,CAAG;QACzB4D,UAAU,EAAGA,CAAA,KAAMtH,QAAQ,CAAE;UAAEgB,OAAO,EAAE;QAAG,CAAE,CAAG;QAAAuE,QAAA,eAEhD,IAAA9F,WAAA,CAAA+F,GAAA,EAAC1G,cAAA,CAAA2G,OAAa;UACbzE,OAAO,EAAGA,OAAS;UACnBN,QAAQ,EAAGA,QAAU;UACrBuF,QAAQ,EAAGjG;QAAU,CACrB;MAAC,CACa,CAChB,EACCqE,iBAAiB,iBAClB,IAAA5E,WAAA,CAAA+F,GAAA,EAACrH,WAAA,CAAAiJ,4BAAc;QACdC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAEpG,MAAM,EAAEyB,MAAQ;QACpCqD,KAAK,EAAG,IAAArC,QAAE,EAAE,SAAU,CAAG;QACzB4D,UAAU,EAAGA,CAAA,KAAMtH,QAAQ,CAAE;UAAEiB,MAAM,EAAE;QAAG,CAAE,CAAG;QAAAsE,QAAA,eAE/C,IAAA9F,WAAA,CAAA+F,GAAA,EAACxG,eAAA,CAAAyG,OAAc;UACdQ,QAAQ,EAAGjG,QAAU;UACrBG,KAAK,EAAGA;QAAO,CACf;MAAC,CACa,CAChB;IAAA,CACU,CACZ;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -18,11 +18,11 @@ const orderOptions = [{
18
18
  label: (0, _i18n.__)('Oldest to newest'),
19
19
  value: 'date/asc'
20
20
  }, {
21
- /* translators: label for ordering posts by title in ascending order */
21
+ /* translators: Label for ordering posts by title in ascending order. */
22
22
  label: (0, _i18n.__)('A → Z'),
23
23
  value: 'title/asc'
24
24
  }, {
25
- /* translators: label for ordering posts by title in descending order */
25
+ /* translators: Label for ordering posts by title in descending order. */
26
26
  label: (0, _i18n.__)('Z → A'),
27
27
  value: 'title/desc'
28
28
  }];
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_jsxRuntime","orderOptions","label","__","value","OrderControl","order","orderBy","onChange","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","options","newOrderBy","newOrder","split","_default","exports","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/order-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst orderOptions = [\n\t{\n\t\tlabel: __( 'Newest to oldest' ),\n\t\tvalue: 'date/desc',\n\t},\n\t{\n\t\tlabel: __( 'Oldest to newest' ),\n\t\tvalue: 'date/asc',\n\t},\n\t{\n\t\t/* translators: label for ordering posts by title in ascending order */\n\t\tlabel: __( 'A → Z' ),\n\t\tvalue: 'title/asc',\n\t},\n\t{\n\t\t/* translators: label for ordering posts by title in descending order */\n\t\tlabel: __( 'Z → A' ),\n\t\tvalue: 'title/desc',\n\t},\n];\nfunction OrderControl( { order, orderBy, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderBy }/${ order }` }\n\t\t\toptions={ orderOptions }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( { order: newOrder, orderBy: newOrderBy } );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default OrderControl;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,YAAY,GAAG,CACpB;EACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACCF,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,CACD;AACD,SAASC,YAAYA,CAAE;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAS,CAAC,EAAG;EACrD,oBACC,IAAAR,WAAA,CAAAS,GAAA,EAACZ,WAAA,CAAAa,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBV,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;IAC1BC,KAAK,EAAG,GAAIG,OAAO,IAAMD,KAAK,EAAK;IACnCO,OAAO,EAAGZ,YAAc;IACxBO,QAAQ,EAAKJ,KAAK,IAAM;MACvB,MAAM,CAAEU,UAAU,EAAEC,QAAQ,CAAE,GAAGX,KAAK,CAACY,KAAK,CAAE,GAAI,CAAC;MACnDR,QAAQ,CAAE;QAAEF,KAAK,EAAES,QAAQ;QAAER,OAAO,EAAEO;MAAW,CAAE,CAAC;IACrD;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_jsxRuntime","orderOptions","label","__","value","OrderControl","order","orderBy","onChange","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","options","newOrderBy","newOrder","split","_default","exports","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/order-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst orderOptions = [\n\t{\n\t\tlabel: __( 'Newest to oldest' ),\n\t\tvalue: 'date/desc',\n\t},\n\t{\n\t\tlabel: __( 'Oldest to newest' ),\n\t\tvalue: 'date/asc',\n\t},\n\t{\n\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\tlabel: __( 'A → Z' ),\n\t\tvalue: 'title/asc',\n\t},\n\t{\n\t\t/* translators: Label for ordering posts by title in descending order. */\n\t\tlabel: __( 'Z → A' ),\n\t\tvalue: 'title/desc',\n\t},\n];\nfunction OrderControl( { order, orderBy, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderBy }/${ order }` }\n\t\t\toptions={ orderOptions }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( { order: newOrder, orderBy: newOrderBy } );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default OrderControl;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,YAAY,GAAG,CACpB;EACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACCF,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,CACD;AACD,SAASC,YAAYA,CAAE;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAS,CAAC,EAAG;EACrD,oBACC,IAAAR,WAAA,CAAAS,GAAA,EAACZ,WAAA,CAAAa,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBV,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;IAC1BC,KAAK,EAAG,GAAIG,OAAO,IAAMD,KAAK,EAAK;IACnCO,OAAO,EAAGZ,YAAc;IACxBO,QAAQ,EAAKJ,KAAK,IAAM;MACvB,MAAM,CAAEU,UAAU,EAAEC,QAAQ,CAAE,GAAGX,KAAK,CAACY,KAAK,CAAE,GAAI,CAAC;MACnDR,QAAQ,CAAE;QAAEF,KAAK,EAAES,QAAQ;QAAER,OAAO,EAAEO;MAAW,CAAE,CAAC;IACrD;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,YAAY","ignoreList":[]}
@@ -7,7 +7,6 @@ exports.default = PatternSelectionModal;
7
7
  var _element = require("@wordpress/element");
8
8
  var _data = require("@wordpress/data");
9
9
  var _components = require("@wordpress/components");
10
- var _compose = require("@wordpress/compose");
11
10
  var _blockEditor = require("@wordpress/block-editor");
12
11
  var _i18n = require("@wordpress/i18n");
13
12
  var _utils = require("../utils");
@@ -51,7 +50,6 @@ function PatternSelectionModal({
51
50
  const filteredBlockPatterns = (0, _element.useMemo)(() => {
52
51
  return (0, _searchPatterns.searchPatterns)(blockPatterns, searchValue);
53
52
  }, [blockPatterns, searchValue]);
54
- const shownBlockPatterns = (0, _compose.useAsyncList)(filteredBlockPatterns);
55
53
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, {
56
54
  overlayClassName: "block-library-query-pattern__selection-modal",
57
55
  title: (0, _i18n.__)('Choose a pattern'),
@@ -72,7 +70,6 @@ function PatternSelectionModal({
72
70
  value: blockPreviewContext,
73
71
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__experimentalBlockPatternsList, {
74
72
  blockPatterns: filteredBlockPatterns,
75
- shownPatterns: shownBlockPatterns,
76
73
  onClickPattern: onBlockPatternSelect
77
74
  })
78
75
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_components","_compose","_blockEditor","_i18n","_utils","_searchPatterns","_jsxRuntime","PatternSelectionModal","clientId","attributes","setIsPatternSelectionModalOpen","searchValue","setSearchValue","useState","replaceBlock","selectBlock","useDispatch","blockEditorStore","onBlockPatternSelect","pattern","blocks","newBlocks","queryClientIds","getTransformedBlocksFromPattern","blockPreviewContext","useMemo","previewPostType","query","postType","blockNameForPatterns","useBlockNameForPatterns","blockPatterns","usePatterns","filteredBlockPatterns","searchPatterns","shownBlockPatterns","useAsyncList","jsx","Modal","overlayClassName","title","__","onRequestClose","isFullScreen","children","jsxs","className","SearchControl","__nextHasNoMarginBottom","onChange","value","label","placeholder","BlockContextProvider","__experimentalBlockPatternsList","shownPatterns","onClickPattern"],"sources":["@wordpress/block-library/src/query/edit/pattern-selection-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { Modal, SearchControl } from '@wordpress/components';\nimport { useAsyncList } from '@wordpress/compose';\nimport {\n\tBlockContextProvider,\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockNameForPatterns,\n\tgetTransformedBlocksFromPattern,\n\tusePatterns,\n} from '../utils';\nimport { searchPatterns } from '../../utils/search-patterns';\n\nexport default function PatternSelectionModal( {\n\tclientId,\n\tattributes,\n\tsetIsPatternSelectionModalOpen,\n} ) {\n\tconst [ searchValue, setSearchValue ] = useState( '' );\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst onBlockPatternSelect = ( pattern, blocks ) => {\n\t\tconst { newBlocks, queryClientIds } = getTransformedBlocksFromPattern(\n\t\t\tblocks,\n\t\t\tattributes\n\t\t);\n\t\treplaceBlock( clientId, newBlocks );\n\t\tif ( queryClientIds[ 0 ] ) {\n\t\t\tselectBlock( queryClientIds[ 0 ] );\n\t\t}\n\t};\n\t// When we preview Query Loop blocks we should prefer the current\n\t// block's postType, which is passed through block context.\n\tconst blockPreviewContext = useMemo(\n\t\t() => ( {\n\t\t\tpreviewPostType: attributes.query.postType,\n\t\t} ),\n\t\t[ attributes.query.postType ]\n\t);\n\tconst blockNameForPatterns = useBlockNameForPatterns(\n\t\tclientId,\n\t\tattributes\n\t);\n\tconst blockPatterns = usePatterns( clientId, blockNameForPatterns );\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\treturn searchPatterns( blockPatterns, searchValue );\n\t}, [ blockPatterns, searchValue ] );\n\tconst shownBlockPatterns = useAsyncList( filteredBlockPatterns );\n\n\treturn (\n\t\t<Modal\n\t\t\toverlayClassName=\"block-library-query-pattern__selection-modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tonRequestClose={ () => setIsPatternSelectionModalOpen( false ) }\n\t\t\tisFullScreen\n\t\t>\n\t\t\t<div className=\"block-library-query-pattern__selection-content\">\n\t\t\t\t<div className=\"block-library-query-pattern__selection-search\">\n\t\t\t\t\t<SearchControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tonChange={ setSearchValue }\n\t\t\t\t\t\tvalue={ searchValue }\n\t\t\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<BlockContextProvider value={ blockPreviewContext }>\n\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\tblockPatterns={ filteredBlockPatterns }\n\t\t\t\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\t\t\t\tonClickPattern={ onBlockPatternSelect }\n\t\t\t\t\t/>\n\t\t\t\t</BlockContextProvider>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAA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element","require","_data","_components","_blockEditor","_i18n","_utils","_searchPatterns","_jsxRuntime","PatternSelectionModal","clientId","attributes","setIsPatternSelectionModalOpen","searchValue","setSearchValue","useState","replaceBlock","selectBlock","useDispatch","blockEditorStore","onBlockPatternSelect","pattern","blocks","newBlocks","queryClientIds","getTransformedBlocksFromPattern","blockPreviewContext","useMemo","previewPostType","query","postType","blockNameForPatterns","useBlockNameForPatterns","blockPatterns","usePatterns","filteredBlockPatterns","searchPatterns","jsx","Modal","overlayClassName","title","__","onRequestClose","isFullScreen","children","jsxs","className","SearchControl","__nextHasNoMarginBottom","onChange","value","label","placeholder","BlockContextProvider","__experimentalBlockPatternsList","onClickPattern"],"sources":["@wordpress/block-library/src/query/edit/pattern-selection-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { Modal, SearchControl } from '@wordpress/components';\nimport {\n\tBlockContextProvider,\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockNameForPatterns,\n\tgetTransformedBlocksFromPattern,\n\tusePatterns,\n} from '../utils';\nimport { searchPatterns } from '../../utils/search-patterns';\n\nexport default function PatternSelectionModal( {\n\tclientId,\n\tattributes,\n\tsetIsPatternSelectionModalOpen,\n} ) {\n\tconst [ searchValue, setSearchValue ] = useState( '' );\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst onBlockPatternSelect = ( pattern, blocks ) => {\n\t\tconst { newBlocks, queryClientIds } = getTransformedBlocksFromPattern(\n\t\t\tblocks,\n\t\t\tattributes\n\t\t);\n\t\treplaceBlock( clientId, newBlocks );\n\t\tif ( queryClientIds[ 0 ] ) {\n\t\t\tselectBlock( queryClientIds[ 0 ] );\n\t\t}\n\t};\n\t// When we preview Query Loop blocks we should prefer the current\n\t// block's postType, which is passed through block context.\n\tconst blockPreviewContext = useMemo(\n\t\t() => ( {\n\t\t\tpreviewPostType: attributes.query.postType,\n\t\t} ),\n\t\t[ attributes.query.postType ]\n\t);\n\tconst blockNameForPatterns = useBlockNameForPatterns(\n\t\tclientId,\n\t\tattributes\n\t);\n\tconst blockPatterns = usePatterns( clientId, blockNameForPatterns );\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\treturn searchPatterns( blockPatterns, searchValue );\n\t}, [ blockPatterns, searchValue ] );\n\n\treturn (\n\t\t<Modal\n\t\t\toverlayClassName=\"block-library-query-pattern__selection-modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tonRequestClose={ () => setIsPatternSelectionModalOpen( false ) }\n\t\t\tisFullScreen\n\t\t>\n\t\t\t<div className=\"block-library-query-pattern__selection-content\">\n\t\t\t\t<div className=\"block-library-query-pattern__selection-search\">\n\t\t\t\t\t<SearchControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tonChange={ setSearchValue }\n\t\t\t\t\t\tvalue={ searchValue }\n\t\t\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<BlockContextProvider value={ blockPreviewContext }>\n\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\tblockPatterns={ filteredBlockPatterns }\n\t\t\t\t\t\tonClickPattern={ onBlockPatternSelect }\n\t\t\t\t\t/>\n\t\t\t\t</BlockContextProvider>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,eAAA,GAAAN,OAAA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C,8CAA8C;IAC/DC,KAAK,EAAG,IAAAC,QAAE,EAAE,kBAAmB,CAAG;IAClCC,cAAc,EAAGA,CAAA,KAAM9B,8BAA8B,CAAE,KAAM,CAAG;IAChE+B,YAAY;IAAAC,QAAA,eAEZ,IAAApC,WAAA,CAAAqC,IAAA;MAAKC,SAAS,EAAC,gDAAgD;MAAAF,QAAA,gBAC9D,IAAApC,WAAA,CAAA6B,GAAA;QAAKS,SAAS,EAAC,+CAA+C;QAAAF,QAAA,eAC7D,IAAApC,WAAA,CAAA6B,GAAA,EAAClC,WAAA,CAAA4C,aAAa;UACbC,uBAAuB;UACvBC,QAAQ,EAAGnC,cAAgB;UAC3BoC,KAAK,EAAGrC,WAAa;UACrBsC,KAAK,EAAG,IAAAV,QAAE,EAAE,QAAS,CAAG;UACxBW,WAAW,EAAG,IAAAX,QAAE,EAAE,QAAS;QAAG,CAC9B;MAAC,CACE,CAAC,eACN,IAAAjC,WAAA,CAAA6B,GAAA,EAACjC,YAAA,CAAAiD,oBAAoB;QAACH,KAAK,EAAGxB,mBAAqB;QAAAkB,QAAA,eAClD,IAAApC,WAAA,CAAA6B,GAAA,EAACjC,YAAA,CAAAkD,+BAAiB;UACjBrB,aAAa,EAAGE,qBAAuB;UACvCoB,cAAc,EAAGnC;QAAsB,CACvC;MAAC,CACmB,CAAC;IAAA,CACnB;EAAC,CACA,CAAC;AAEV","ignoreList":[]}
@@ -16,6 +16,7 @@ var _enhancedPaginationControl = _interopRequireDefault(require("./inspector-con
16
16
  var _queryToolbar = _interopRequireDefault(require("./query-toolbar"));
17
17
  var _inspectorControls = _interopRequireDefault(require("./inspector-controls"));
18
18
  var _enhancedPaginationModal = _interopRequireDefault(require("./enhanced-pagination-modal"));
19
+ var _utils = require("../utils");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  /**
21
22
  * WordPress dependencies
@@ -46,8 +47,11 @@ function QueryContent({
46
47
  } = {}
47
48
  } = attributes;
48
49
  const {
49
- postType
50
+ templateSlug
50
51
  } = context;
52
+ const {
53
+ isSingular
54
+ } = (0, _utils.getQueryContextFromTemplate)(templateSlug);
51
55
  const {
52
56
  __unstableMarkNextChangeAsNotPersistent
53
57
  } = (0, _data.useDispatch)(_blockEditor.store);
@@ -56,12 +60,6 @@ function QueryContent({
56
60
  const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
57
61
  template: TEMPLATE
58
62
  });
59
- const isTemplate = (0, _data.useSelect)(select => {
60
- const currentTemplate = select(_coreData.store).__experimentalGetTemplateForLink()?.type;
61
- const isInTemplate = 'wp_template' === currentTemplate;
62
- const isInSingularContent = postType !== undefined;
63
- return isInTemplate && !isInSingularContent;
64
- }, [postType]);
65
63
  const {
66
64
  postsPerPage
67
65
  } = (0, _data.useSelect)(select => {
@@ -110,16 +108,16 @@ function QueryContent({
110
108
  } else if (!query.perPage && postsPerPage) {
111
109
  newQuery.perPage = postsPerPage;
112
110
  }
113
- // We need to reset the `inherit` value if not in a template, as queries
114
- // are not inherited when outside a template (e.g. when in singular content).
115
- if (!isTemplate && query.inherit) {
111
+ // We need to reset the `inherit` value if in a singular template, as queries
112
+ // are not inherited when in singular content (e.g. post, page, 404, blank).
113
+ if (isSingular && query.inherit) {
116
114
  newQuery.inherit = false;
117
115
  }
118
116
  if (!!Object.keys(newQuery).length) {
119
117
  __unstableMarkNextChangeAsNotPersistent();
120
118
  updateQuery(newQuery);
121
119
  }
122
- }, [query.perPage, postsPerPage, inherit, isTemplate, query.inherit, __unstableMarkNextChangeAsNotPersistent, updateQuery]);
120
+ }, [query.perPage, query.inherit, postsPerPage, inherit, isSingular, __unstableMarkNextChangeAsNotPersistent, updateQuery]);
123
121
  // We need this for multi-query block pagination.
124
122
  // Query parameters for each block are scoped to their ID.
125
123
  (0, _element.useEffect)(() => {
@@ -153,7 +151,7 @@ function QueryContent({
153
151
  setDisplayLayout: updateDisplayLayout,
154
152
  setAttributes: setAttributes,
155
153
  clientId: clientId,
156
- isTemplate: isTemplate
154
+ isSingular: isSingular
157
155
  })
158
156
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
159
157
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_queryToolbar.default, {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_compose","_element","_blockEditor","_components","_i18n","_coreData","_enhancedPaginationControl","_interopRequireDefault","_queryToolbar","_inspectorControls","_enhancedPaginationModal","_jsxRuntime","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","context","queryId","query","displayLayout","enhancedPagination","tagName","TagName","inherit","postType","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","instanceId","useInstanceId","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","isTemplate","useSelect","select","currentTemplate","coreStore","__experimentalGetTemplateForLink","type","isInTemplate","isInSingularContent","undefined","postsPerPage","getSettings","getEntityRecord","getEntityRecordEdits","canUser","settingPerPage","kind","posts_per_page","editedSettingPerPage","updateQuery","useCallback","newQuery","useEffect","perPage","Object","keys","length","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","__","section","aside","jsxs","Fragment","children","jsx","default","InspectorControls","setQuery","setDisplayLayout","BlockControls","group","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EnhancedPaginationControl from './inspector-controls/enhanced-pagination-control';\nimport QueryToolbar from './query-toolbar';\nimport QueryInspectorControls from './inspector-controls';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n\tcontext,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\tenhancedPagination,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { postType } = context;\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst isTemplate = useSelect(\n\t\t( select ) => {\n\t\t\tconst currentTemplate =\n\t\t\t\tselect( coreStore ).__experimentalGetTemplateForLink()?.type;\n\t\t\tconst isInTemplate = 'wp_template' === currentTemplate;\n\t\t\tconst isInSingularContent = postType !== undefined;\n\t\t\treturn isInTemplate && ! isInSingularContent;\n\t\t},\n\t\t[ postType ]\n\t);\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getEntityRecord, getEntityRecordEdits, canUser } =\n\t\t\tselect( coreStore );\n\t\tconst settingPerPage = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\n\t\t// Gets changes made via the template area posts per page setting. These won't be saved\n\t\t// until the page is saved, but we should reflect this setting within the query loops\n\t\t// that inherit it.\n\t\tconst editedSettingPerPage = +getEntityRecordEdits( 'root', 'site' )\n\t\t\t?.posts_per_page;\n\n\t\treturn {\n\t\t\tpostsPerPage:\n\t\t\t\teditedSettingPerPage ||\n\t\t\t\tsettingPerPage ||\n\t\t\t\tDEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tconst updateQuery = useCallback(\n\t\t( newQuery ) => setAttributes( { query: { ...query, ...newQuery } } ),\n\t\t[ query, setAttributes ]\n\t);\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\t// When we inherit from global query always need to set the `perPage`\n\t\t// based on the reading settings.\n\t\tif ( inherit && query.perPage !== postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t} else if ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\t// We need to reset the `inherit` value if not in a template, as queries\n\t\t// are not inherited when outside a template (e.g. when in singular content).\n\t\tif ( ! isTemplate && query.inherit ) {\n\t\t\tnewQuery.inherit = false;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [\n\t\tquery.perPage,\n\t\tpostsPerPage,\n\t\tinherit,\n\t\tisTemplate,\n\t\tquery.inherit,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tupdateQuery,\n\t] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [\n\t\tqueryId,\n\t\tinstanceId,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tsetAttributes,\n\t] );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\tconst htmlElementMessages = {\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only.'\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<EnhancedPaginationModal\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<QueryInspectorControls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisTemplate={ isTemplate }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\topenPatternSelectionModal={ openPatternSelectionModal }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\tenhancedPagination={ enhancedPagination }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAKA,IAAAO,0BAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,aAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,kBAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,wBAAA,GAAAH,sBAAA,CAAAR,OAAA;AAAkE,IAAAY,WAAA,GAAAZ,OAAA;AAvBlE;AACA;AACA;;AAeA;AACA;AACA;;AAMA,MAAMa,uBAAuB,GAAG,CAAC;AAEjC,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAoB,CAAE,CAAE;AAC9B,SAASC,YAAYA,CAAE;EACrCC,UAAU;EACVC,aAAa;EACbC,yBAAyB;EACzBC,IAAI;EACJC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,OAAO;IACPC,KAAK;IACLC,aAAa;IACbC,k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compose","_element","_blockEditor","_components","_i18n","_coreData","_enhancedPaginationControl","_interopRequireDefault","_queryToolbar","_inspectorControls","_enhancedPaginationModal","_utils","_jsxRuntime","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","context","queryId","query","displayLayout","enhancedPagination","tagName","TagName","inherit","templateSlug","isSingular","getQueryContextFromTemplate","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","instanceId","useInstanceId","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","postsPerPage","useSelect","select","getSettings","getEntityRecord","getEntityRecordEdits","canUser","coreStore","settingPerPage","kind","posts_per_page","editedSettingPerPage","updateQuery","useCallback","newQuery","useEffect","perPage","Object","keys","length","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","__","section","aside","jsxs","Fragment","children","jsx","default","InspectorControls","setQuery","setDisplayLayout","BlockControls","group","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EnhancedPaginationControl from './inspector-controls/enhanced-pagination-control';\nimport QueryToolbar from './query-toolbar';\nimport QueryInspectorControls from './inspector-controls';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\nimport { getQueryContextFromTemplate } from '../utils';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n\tcontext,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\tenhancedPagination,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { templateSlug } = context;\n\tconst { isSingular } = getQueryContextFromTemplate( templateSlug );\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getEntityRecord, getEntityRecordEdits, canUser } =\n\t\t\tselect( coreStore );\n\t\tconst settingPerPage = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\n\t\t// Gets changes made via the template area posts per page setting. These won't be saved\n\t\t// until the page is saved, but we should reflect this setting within the query loops\n\t\t// that inherit it.\n\t\tconst editedSettingPerPage = +getEntityRecordEdits( 'root', 'site' )\n\t\t\t?.posts_per_page;\n\n\t\treturn {\n\t\t\tpostsPerPage:\n\t\t\t\teditedSettingPerPage ||\n\t\t\t\tsettingPerPage ||\n\t\t\t\tDEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tconst updateQuery = useCallback(\n\t\t( newQuery ) => setAttributes( { query: { ...query, ...newQuery } } ),\n\t\t[ query, setAttributes ]\n\t);\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\t// When we inherit from global query always need to set the `perPage`\n\t\t// based on the reading settings.\n\t\tif ( inherit && query.perPage !== postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t} else if ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\t// We need to reset the `inherit` value if in a singular template, as queries\n\t\t// are not inherited when in singular content (e.g. post, page, 404, blank).\n\t\tif ( isSingular && query.inherit ) {\n\t\t\tnewQuery.inherit = false;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [\n\t\tquery.perPage,\n\t\tquery.inherit,\n\t\tpostsPerPage,\n\t\tinherit,\n\t\tisSingular,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tupdateQuery,\n\t] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [\n\t\tqueryId,\n\t\tinstanceId,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tsetAttributes,\n\t] );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\tconst htmlElementMessages = {\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only.'\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<EnhancedPaginationModal\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<QueryInspectorControls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisSingular={ isSingular }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\topenPatternSelectionModal={ openPatternSelectionModal }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\tenhancedPagination={ enhancedPagination }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\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AClC;UAAEF,KAAK,EAAE,WAAW;UAAEE,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEF,KAAK,EAAE,SAAS;UAAEE,KAAK,EAAE;QAAQ,CAAC,CAClC;QACHA,KAAK,EAAG3D,OAAS;QACjB4D,QAAQ,EAAKD,KAAK,IACjBrE,aAAa,CAAE;UAAES,OAAO,EAAE4D;QAAM,CAAE,CAClC;QACDE,IAAI,EAAGtB,mBAAmB,CAAEvC,OAAO;MAAI,CACvC,CAAC,eACF,IAAAf,WAAA,CAAA8D,GAAA,EAACpE,0BAAA,CAAAqE,OAAyB;QACzBlD,kBAAkB,EAAGA,kBAAoB;QACzCR,aAAa,EAAGA,aAAe;QAC/BG,QAAQ,EAAGA;MAAU,CACrB,CAAC;IAAA,CACgB,CAAC,eACpB,IAAAR,WAAA,CAAA8D,GAAA,EAAC/C,OAAO;MAAA,GAAMY;IAAgB,CAAI,CAAC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
@@ -61,7 +61,7 @@ const metadata = exports.metadata = {
61
61
  "default": false
62
62
  }
63
63
  },
64
- usesContext: ["postType"],
64
+ usesContext: ["templateSlug"],
65
65
  providesContext: {
66
66
  queryId: "queryId",
67
67
  query: "query",
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getValueFromObjectPath = exports.getTransformedBlocksFromPattern = exports.getEntitiesInfo = void 0;
6
+ exports.getEntitiesInfo = void 0;
7
+ exports.getQueryContextFromTemplate = getQueryContextFromTemplate;
8
+ exports.getValueFromObjectPath = exports.getTransformedBlocksFromPattern = void 0;
7
9
  exports.isControlAllowed = isControlAllowed;
8
10
  exports.mapToIHasNameAndId = void 0;
9
11
  exports.useAllowedControls = useAllowedControls;
@@ -422,5 +424,34 @@ const useUnsupportedBlocks = clientId => {
422
424
  return blocks;
423
425
  }, [clientId]);
424
426
  };
427
+
428
+ /**
429
+ * Helper function that returns the query context from the editor based on the
430
+ * available template slug.
431
+ *
432
+ * @param {string} templateSlug Current template slug based on context.
433
+ * @return {Object} An object with isSingular and templateType properties.
434
+ */
425
435
  exports.useUnsupportedBlocks = useUnsupportedBlocks;
436
+ function getQueryContextFromTemplate(templateSlug) {
437
+ // In the Post Editor, the template slug is not available.
438
+ if (!templateSlug) {
439
+ return {
440
+ isSingular: true
441
+ };
442
+ }
443
+ let isSingular = false;
444
+ let templateType = templateSlug === 'wp' ? 'custom' : templateSlug;
445
+ const singularTemplates = ['404', 'blank', 'single', 'page', 'custom'];
446
+ const templateTypeFromSlug = templateSlug.includes('-') ? templateSlug.split('-', 1)[0] : templateSlug;
447
+ const queryFromTemplateSlug = templateSlug.includes('-') ? templateSlug.split('-').slice(1).join('-') : '';
448
+ if (queryFromTemplateSlug) {
449
+ templateType = templateTypeFromSlug;
450
+ }
451
+ isSingular = singularTemplates.includes(templateType);
452
+ return {
453
+ isSingular,
454
+ templateType
455
+ };
456
+ }
426
457
  //# sourceMappingURL=utils.js.map
@@ -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","postTypeFormatSupportMap","supports","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 * 3. A helper map with post format support 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\tconst postTypeFormatSupportMap = 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 ] =\n\t\t\t\ttype.supports?.[ 'post-formats' ] || false;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\treturn {\n\t\tpostTypesTaxonomiesMap,\n\t\tpostTypesSelectOptions,\n\t\tpostTypeFormatSupportMap,\n\t};\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;E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AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA/D,OAAA,CAAAmF,WAAA,GAAAA,WAAA;AASO,MAAMC,oBAAoB,GAAKrB,QAAQ,IAAM;EACnD,OAAO,IAAAjD,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MAAEsE,yBAAyB;MAAEC;IAAa,CAAC,GAChDvE,MAAM,CAAE0D,kBAAiB,CAAC;IAC3B,MAAMrB,MAAM,GAAG,CAAC,CAAC;IACjBiC,yBAAyB,CAAEtB,QAAS,CAAC,CAACxD,OAAO,CAC1CgF,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;AAAC/D,OAAA,CAAAoF,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","postTypeFormatSupportMap","supports","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","getQueryContextFromTemplate","templateSlug","isSingular","templateType","singularTemplates","templateTypeFromSlug","queryFromTemplateSlug","slice","join"],"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 * 3. A helper map with post format support 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\tconst postTypeFormatSupportMap = 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 ] =\n\t\t\t\ttype.supports?.[ 'post-formats' ] || false;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\treturn {\n\t\tpostTypesTaxonomiesMap,\n\t\tpostTypesSelectOptions,\n\t\tpostTypeFormatSupportMap,\n\t};\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\n/**\n * Helper function that returns the query context from the editor based on the\n * available template slug.\n *\n * @param {string} templateSlug Current template slug based on context.\n * @return {Object} An object with isSingular and templateType properties.\n */\nexport function getQueryContextFromTemplate( templateSlug ) {\n\t// In the Post Editor, the template slug is not available.\n\tif ( ! templateSlug ) {\n\t\treturn { isSingular: true };\n\t}\n\tlet isSingular = false;\n\tlet templateType = templateSlug === 'wp' ? 'custom' : templateSlug;\n\tconst singularTemplates = [ '404', 'blank', 'single', 'page', 'custom' ];\n\tconst templateTypeFromSlug = templateSlug.includes( '-' )\n\t\t? templateSlug.split( '-', 1 )[ 0 ]\n\t\t: templateSlug;\n\tconst queryFromTemplateSlug = templateSlug.includes( '-' )\n\t\t? templateSlug.split( '-' ).slice( 1 ).join( '-' )\n\t\t: '';\n\tif ( queryFromTemplateSlug ) {\n\t\ttemplateType = templateTypeFromSlug;\n\t}\n\tisSingular = singularTemplates.includes( templateType );\n\n\treturn { isSingular, templateType };\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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AG,KAAK;EACtB,IAAIC,YAAY,GAAGF,YAAY,KAAK,IAAI,GAAG,QAAQ,GAAGA,YAAY;EAClE,MAAMG,iBAAiB,GAAG,CAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAE;EACxE,MAAMC,oBAAoB,GAAGJ,YAAY,CAAC1E,QAAQ,CAAE,GAAI,CAAC,GACtD0E,YAAY,CAAC7F,KAAK,CAAE,GAAG,EAAE,CAAE,CAAC,CAAE,CAAC,CAAE,GACjC6F,YAAY;EACf,MAAMK,qBAAqB,GAAGL,YAAY,CAAC1E,QAAQ,CAAE,GAAI,CAAC,GACvD0E,YAAY,CAAC7F,KAAK,CAAE,GAAI,CAAC,CAACmG,KAAK,CAAE,CAAE,CAAC,CAACC,IAAI,CAAE,GAAI,CAAC,GAChD,EAAE;EACL,IAAKF,qBAAqB,EAAG;IAC5BH,YAAY,GAAGE,oBAAoB;EACpC;EACAH,UAAU,GAAGE,iBAAiB,CAAC7E,QAAQ,CAAE4E,YAAa,CAAC;EAEvD,OAAO;IAAED,UAAU;IAAEC;EAAa,CAAC;AACpC","ignoreList":[]}
@@ -60,7 +60,7 @@ function QueryTitleEdit({
60
60
  if (showPrefix) {
61
61
  if (archiveNameLabel) {
62
62
  title = (0, _i18n.sprintf)(/* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */
63
- (0, _i18n.__)('%1$s: %2$s'), archiveTypeLabel, archiveNameLabel);
63
+ (0, _i18n._x)('%1$s: %2$s', 'archive label'), archiveTypeLabel, archiveNameLabel);
64
64
  } else {
65
65
  title = (0, _i18n.sprintf)(/* translators: %s: Archive type title e.g: "Category", "Tag"... */
66
66
  (0, _i18n.__)('%s: Name'), archiveTypeLabel);