@wordpress/block-library 9.18.0 → 9.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/cover/edit/index.js +3 -1
  3. package/build/cover/edit/index.js.map +1 -1
  4. package/build/form/edit.js +4 -2
  5. package/build/form/edit.js.map +1 -1
  6. package/build/image/view.js +4 -4
  7. package/build/image/view.js.map +1 -1
  8. package/build/latest-posts/edit.js +2 -1
  9. package/build/latest-posts/edit.js.map +1 -1
  10. package/build/navigation/use-template-part-area-label.js +7 -6
  11. package/build/navigation/use-template-part-area-label.js.map +1 -1
  12. package/build/navigation/view.js +2 -2
  13. package/build/navigation/view.js.map +1 -1
  14. package/build/navigation-link/edit.js +2 -1
  15. package/build/navigation-link/edit.js.map +1 -1
  16. package/build/navigation-submenu/edit.js +2 -1
  17. package/build/navigation-submenu/edit.js.map +1 -1
  18. package/build/post-author/edit.js +1 -1
  19. package/build/post-author/edit.js.map +1 -1
  20. package/build/post-author-name/edit.js +2 -2
  21. package/build/post-author-name/edit.js.map +1 -1
  22. package/build/post-comments-count/index.js +8 -1
  23. package/build/post-comments-count/index.js.map +1 -1
  24. package/build/post-navigation-link/edit.js +1 -1
  25. package/build/post-navigation-link/edit.js.map +1 -1
  26. package/build/query/edit/inspector-controls/index.js +2 -0
  27. package/build/query/edit/inspector-controls/index.js.map +1 -1
  28. package/build/query/edit/inspector-controls/order-control.js +3 -2
  29. package/build/query/edit/inspector-controls/order-control.js.map +1 -1
  30. package/build/query/utils.js +45 -0
  31. package/build/query/utils.js.map +1 -1
  32. package/build/query/view.js +2 -2
  33. package/build/query/view.js.map +1 -1
  34. package/build/query-total/index.js +2 -2
  35. package/build/query-total/index.js.map +1 -1
  36. package/build/search/view.js +2 -2
  37. package/build/search/view.js.map +1 -1
  38. package/build/site-logo/edit.js +2 -5
  39. package/build/site-logo/edit.js.map +1 -1
  40. package/build/template-part/edit/advanced-controls.js +1 -1
  41. package/build/template-part/edit/advanced-controls.js.map +1 -1
  42. package/build/template-part/edit/utils/hooks.js +1 -1
  43. package/build/template-part/edit/utils/hooks.js.map +1 -1
  44. package/build/video/edit-common-settings.js +10 -3
  45. package/build/video/edit-common-settings.js.map +1 -1
  46. package/build-module/cover/edit/index.js +3 -1
  47. package/build-module/cover/edit/index.js.map +1 -1
  48. package/build-module/form/edit.js +4 -2
  49. package/build-module/form/edit.js.map +1 -1
  50. package/build-module/image/view.js +5 -5
  51. package/build-module/image/view.js.map +1 -1
  52. package/build-module/latest-posts/edit.js +2 -1
  53. package/build-module/latest-posts/edit.js.map +1 -1
  54. package/build-module/navigation/use-template-part-area-label.js +7 -6
  55. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  56. package/build-module/navigation/view.js +3 -3
  57. package/build-module/navigation/view.js.map +1 -1
  58. package/build-module/navigation-link/edit.js +2 -1
  59. package/build-module/navigation-link/edit.js.map +1 -1
  60. package/build-module/navigation-submenu/edit.js +2 -1
  61. package/build-module/navigation-submenu/edit.js.map +1 -1
  62. package/build-module/post-author/edit.js +1 -1
  63. package/build-module/post-author/edit.js.map +1 -1
  64. package/build-module/post-author-name/edit.js +2 -2
  65. package/build-module/post-author-name/edit.js.map +1 -1
  66. package/build-module/post-comments-count/index.js +8 -1
  67. package/build-module/post-comments-count/index.js.map +1 -1
  68. package/build-module/post-navigation-link/edit.js +1 -1
  69. package/build-module/post-navigation-link/edit.js.map +1 -1
  70. package/build-module/query/edit/inspector-controls/index.js +3 -1
  71. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  72. package/build-module/query/edit/inspector-controls/order-control.js +3 -2
  73. package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
  74. package/build-module/query/utils.js +44 -0
  75. package/build-module/query/utils.js.map +1 -1
  76. package/build-module/query/view.js +3 -3
  77. package/build-module/query/view.js.map +1 -1
  78. package/build-module/query-total/index.js +2 -2
  79. package/build-module/query-total/index.js.map +1 -1
  80. package/build-module/search/view.js +3 -3
  81. package/build-module/search/view.js.map +1 -1
  82. package/build-module/site-logo/edit.js +2 -5
  83. package/build-module/site-logo/edit.js.map +1 -1
  84. package/build-module/template-part/edit/advanced-controls.js +1 -1
  85. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  86. package/build-module/template-part/edit/utils/hooks.js +1 -1
  87. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  88. package/build-module/video/edit-common-settings.js +10 -3
  89. package/build-module/video/edit-common-settings.js.map +1 -1
  90. package/build-style/editor-rtl.css +6 -9
  91. package/build-style/editor.css +6 -9
  92. package/build-style/navigation-link/editor-rtl.css +5 -9
  93. package/build-style/navigation-link/editor.css +5 -9
  94. package/build-style/post-comments-count/style-rtl.css +103 -0
  95. package/build-style/post-comments-count/style.css +103 -0
  96. package/build-style/pullquote/style-rtl.css +4 -0
  97. package/build-style/pullquote/style.css +4 -0
  98. package/build-style/social-link/editor-rtl.css +1 -0
  99. package/build-style/social-link/editor.css +1 -0
  100. package/build-style/style-rtl.css +8 -0
  101. package/build-style/style.css +8 -0
  102. package/package.json +35 -35
  103. package/src/cover/edit/index.js +2 -0
  104. package/src/cover/test/edit.js +6 -6
  105. package/src/form/edit.js +2 -0
  106. package/src/image/view.js +10 -5
  107. package/src/latest-posts/edit.js +1 -0
  108. package/src/navigation/use-template-part-area-label.js +6 -6
  109. package/src/navigation/view.js +8 -3
  110. package/src/navigation-link/edit.js +1 -0
  111. package/src/navigation-link/editor.scss +3 -24
  112. package/src/navigation-submenu/edit.js +1 -0
  113. package/src/post-author/edit.js +1 -1
  114. package/src/post-author-name/edit.js +4 -4
  115. package/src/post-comments-count/block.json +8 -1
  116. package/src/post-comments-count/style.scss +4 -0
  117. package/src/post-navigation-link/edit.js +1 -1
  118. package/src/pullquote/style.scss +4 -0
  119. package/src/query/edit/inspector-controls/index.js +3 -1
  120. package/src/query/edit/inspector-controls/order-control.js +9 -3
  121. package/src/query/utils.js +58 -0
  122. package/src/query/view.js +8 -3
  123. package/src/query-total/block.json +2 -2
  124. package/src/query-total/index.php +4 -2
  125. package/src/search/view.js +8 -3
  126. package/src/site-logo/edit.js +1 -5
  127. package/src/site-title/index.php +1 -1
  128. package/src/social-link/editor.scss +1 -0
  129. package/src/style.scss +1 -0
  130. package/src/template-part/edit/advanced-controls.js +1 -1
  131. package/src/template-part/edit/utils/hooks.js +1 -1
  132. package/src/template-part/index.php +3 -1
  133. package/src/video/edit-common-settings.js +11 -2
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_coreData","_i18n","_compose","_element","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_formatControls","_stickyControl","_perPageControl","_offsetControls","_pagesControl","_utils","_hooks","_jsxRuntime","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","__experimentalToolsPanel","label","resetAll","jsx","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","isBlock","onChange","value","help","__experimentalToggleGroupControlOption","SelectControl","options","map","option","columns","RangeControl","min","max","Math","Notice","status","isDismissible","default","className","values","TaxonomyControls","TextControl"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\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 { 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 PerPageControl from './per-page-control';\nimport OffsetControl from './offset-controls';\nimport PagesControl from './pages-control';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n} from '../../utils';\nimport { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';\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{ showSettingsPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\tpostType: 'post',\n\t\t\t\t\t\t\torder: 'desc',\n\t\t\t\t\t\t\torderBy: 'date',\n\t\t\t\t\t\t\tsticky: '',\n\t\t\t\t\t\t\tinherit: true,\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{ showInheritControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => ! inherit }\n\t\t\t\t\t\t\tlabel={ __( 'Query type' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { inherit: true } ) }\n\t\t\t\t\t\t\tisShownByDefault\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__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Query type' ) }\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\t\tinherit: value === 'default',\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\thelp={\n\t\t\t\t\t\t\t\t\tinherit\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\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\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\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\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvalue={ !! inherit ? 'default' : 'custom' }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tvalue=\"default\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tvalue=\"custom\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ showPostTypeControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => postType !== 'post' }\n\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\tonDeselect={ () => onPostTypeChange( 'post' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ postTypesSelectOptions.length > 2 ? (\n\t\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ postTypesSelectOptions.map(\n\t\t\t\t\t\t\t\t\t\t( option ) => (\n\t\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => displayLayout?.columns !== 2 }\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetDisplayLayout( { columns: 2 } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\t\tcolumns: value,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ showOrderControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\torder !== 'desc' || orderBy !== 'date'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetQuery( { order: 'desc', orderBy: 'date' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy } }\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\n\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! sticky }\n\t\t\t\t\t\t\tlabel={ __( 'Sticky posts' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { sticky: '' } ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\n\t\t\t\t\t\t\t\t}\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\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;AAUA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,cAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,eAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,cAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,eAAA,GAAAN,sBAAA,CAAAP,OAAA;AACA,IAAAc,eAAA,GAAAP,sBAAA,CAAAP,OAAA;AACA,IAAAe,aAAA,GAAAR,sBAAA,CAAA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":3,"names":["_components","require","_data","_coreData","_i18n","_compose","_element","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_formatControls","_stickyControl","_perPageControl","_offsetControls","_pagesControl","_utils","_hooks","_jsxRuntime","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","orderByOptions","useOrderByOptions","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","__experimentalToolsPanel","label","resetAll","jsx","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","isBlock","onChange","value","help","__experimentalToggleGroupControlOption","SelectControl","options","map","option","columns","RangeControl","min","max","Math","Notice","status","isDismissible","default","className","values","TaxonomyControls","TextControl"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\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 { 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 PerPageControl from './per-page-control';\nimport OffsetControl from './offset-controls';\nimport PagesControl from './pages-control';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n\tuseOrderByOptions,\n} from '../../utils';\nimport { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';\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 orderByOptions = useOrderByOptions( postType );\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{ showSettingsPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\tpostType: 'post',\n\t\t\t\t\t\t\torder: 'desc',\n\t\t\t\t\t\t\torderBy: 'date',\n\t\t\t\t\t\t\tsticky: '',\n\t\t\t\t\t\t\tinherit: true,\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{ showInheritControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => ! inherit }\n\t\t\t\t\t\t\tlabel={ __( 'Query type' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { inherit: true } ) }\n\t\t\t\t\t\t\tisShownByDefault\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__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Query type' ) }\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\t\tinherit: value === 'default',\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\thelp={\n\t\t\t\t\t\t\t\t\tinherit\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\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\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\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\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvalue={ !! inherit ? 'default' : 'custom' }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tvalue=\"default\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tvalue=\"custom\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ showPostTypeControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => postType !== 'post' }\n\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\tonDeselect={ () => onPostTypeChange( 'post' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ postTypesSelectOptions.length > 2 ? (\n\t\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ postTypesSelectOptions.map(\n\t\t\t\t\t\t\t\t\t\t( option ) => (\n\t\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => displayLayout?.columns !== 2 }\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetDisplayLayout( { columns: 2 } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\t\tcolumns: value,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ showOrderControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\torder !== 'desc' || orderBy !== 'date'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetQuery( { order: 'desc', orderBy: 'date' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy, orderByOptions } }\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\n\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! sticky }\n\t\t\t\t\t\t\tlabel={ __( 'Sticky posts' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { sticky: '' } ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\n\t\t\t\t\t\t\t\t}\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\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;AAUA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,cAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,eAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,cAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,eAAA,GAAAN,sBAAA,CAAAP,OAAA;AACA,IAAAc,eAAA,GAAAP,sBAAA,CAAAP,OAAA;AACA,IAAAe,aAAA,GAAAR,sBAAA,CAAAP,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AAQA,IAAAiB,MAAA,GAAAjB,OAAA;AAAsE,IAAAkB,WAAA,GAAAlB,OAAA;AAvCtE;AACA;AACA;;AAiBA;AACA;AACA;;AAoBe,SAASmB,sBAAsBA,CAAEC,KAAK,EAAG;EACvD,MAAM;IAAEC,UAAU;IAAEC,QAAQ;IAAEC,gBAA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AAU,CAAG;UACzB2C,KAAK,EAAG1D,WAAa;UACrByD,QAAQ,EAAGxD;QAAgB,CAC3B;MAAC,CACa,CAChB,EACCuB,iBAAiB,iBAClB,IAAAzE,WAAA,CAAAiG,GAAA,EAACpH,WAAA,CAAAqH,4BAAc;QACdC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAE/E,OAAO,EAAE0B,MAAQ;QACrCiD,KAAK,EAAG,IAAA/B,QAAE,EAAE,SAAU,CAAG;QACzBoC,UAAU,EAAGA,CAAA,KAAMhG,QAAQ,CAAE;UAAEgB,OAAO,EAAE;QAAG,CAAE,CAAG;QAAAyE,QAAA,eAEhD,IAAA7F,WAAA,CAAAiG,GAAA,EAAC1G,cAAA,CAAAmI,OAAa;UACbtG,OAAO,EAAGA,OAAS;UACnBN,QAAQ,EAAGA,QAAU;UACrB4F,QAAQ,EAAGtG;QAAU,CACrB;MAAC,CACa,CAChB,EACCuE,iBAAiB,iBAClB,IAAA3E,WAAA,CAAAiG,GAAA,EAACpH,WAAA,CAAAqH,4BAAc;QACdC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAE9E,MAAM,EAAEyB,MAAQ;QACpCiD,KAAK,EAAG,IAAA/B,QAAE,EAAE,SAAU,CAAG;QACzBoC,UAAU,EAAGA,CAAA,KAAMhG,QAAQ,CAAE;UAAEiB,MAAM,EAAE;QAAG,CAAE,CAAG;QAAAwE,QAAA,eAE/C,IAAA7F,WAAA,CAAAiG,GAAA,EAACxG,eAAA,CAAAiI,OAAc;UACdhB,QAAQ,EAAGtG,QAAU;UACrBG,KAAK,EAAGA;QAAO,CACf;MAAC,CACa,CAChB;IAAA,CACU,CACZ;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -11,7 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
11
11
  * WordPress dependencies
12
12
  */
13
13
 
14
- const orderOptions = [{
14
+ const defaultOrderByOptions = [{
15
15
  label: (0, _i18n.__)('Newest to oldest'),
16
16
  value: 'date/desc'
17
17
  }, {
@@ -29,6 +29,7 @@ const orderOptions = [{
29
29
  function OrderControl({
30
30
  order,
31
31
  orderBy,
32
+ orderByOptions = defaultOrderByOptions,
32
33
  onChange
33
34
  }) {
34
35
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
@@ -36,7 +37,7 @@ function OrderControl({
36
37
  __next40pxDefaultSize: true,
37
38
  label: (0, _i18n.__)('Order by'),
38
39
  value: `${orderBy}/${order}`,
39
- options: orderOptions,
40
+ options: orderByOptions,
40
41
  onChange: value => {
41
42
  const [newOrderBy, newOrder] = value.split('/');
42
43
  onChange({
@@ -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","defaultOrderByOptions","label","__","value","OrderControl","order","orderBy","orderByOptions","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 defaultOrderByOptions = [\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];\n\nfunction OrderControl( {\n\torder,\n\torderBy,\n\torderByOptions = defaultOrderByOptions,\n\tonChange,\n} ) {\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={ orderByOptions }\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,qBAAqB,GAAG,CAC7B;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;AAED,SAASC,YAAYA,CAAE;EACtBC,KAAK;EACLC,OAAO;EACPC,cAAc,GAAGP,qBAAqB;EACtCQ;AACD,CAAC,EAAG;EACH,oBACC,IAAAT,WAAA,CAAAU,GAAA,EAACb,WAAA,CAAAc,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBX,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;IAC1BC,KAAK,EAAG,GAAIG,OAAO,IAAMD,KAAK,EAAK;IACnCQ,OAAO,EAAGN,cAAgB;IAC1BC,QAAQ,EAAKL,KAAK,IAAM;MACvB,MAAM,CAAEW,UAAU,EAAEC,QAAQ,CAAE,GAAGZ,KAAK,CAACa,KAAK,CAAE,GAAI,CAAC;MACnDR,QAAQ,CAAE;QAAEH,KAAK,EAAEU,QAAQ;QAAET,OAAO,EAAEQ;MAAW,CAAE,CAAC;IACrD;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcf,YAAY","ignoreList":[]}
@@ -11,6 +11,7 @@ exports.mapToIHasNameAndId = void 0;
11
11
  exports.useAllowedControls = useAllowedControls;
12
12
  exports.useBlockNameForPatterns = useBlockNameForPatterns;
13
13
  exports.useIsPostTypeHierarchical = useIsPostTypeHierarchical;
14
+ exports.useOrderByOptions = useOrderByOptions;
14
15
  exports.usePostTypes = exports.usePatterns = void 0;
15
16
  exports.useScopedBlockVariations = useScopedBlockVariations;
16
17
  exports.useUnsupportedBlocks = exports.useTaxonomies = void 0;
@@ -19,12 +20,14 @@ var _element = require("@wordpress/element");
19
20
  var _coreData = require("@wordpress/core-data");
20
21
  var _blockEditor = require("@wordpress/block-editor");
21
22
  var _htmlEntities = require("@wordpress/html-entities");
23
+ var _i18n = require("@wordpress/i18n");
22
24
  var _blocks = require("@wordpress/blocks");
23
25
  /**
24
26
  * WordPress dependencies
25
27
  */
26
28
 
27
29
  /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
30
+ /** @typedef {import('@wordpress/components/build-types/query-controls/types').OrderByOption} OrderByOption */
28
31
 
29
32
  /**
30
33
  * @typedef IHasNameAndId
@@ -207,6 +210,48 @@ function useIsPostTypeHierarchical(postType) {
207
210
  }, [postType]);
208
211
  }
209
212
 
213
+ /**
214
+ * List of avaiable options to order by.
215
+ *
216
+ * @param {string} postType The post type to check.
217
+ * @return {OrderByOption[]} List of order options.
218
+ */
219
+ function useOrderByOptions(postType) {
220
+ const supportsCustomOrder = (0, _data.useSelect)(select => {
221
+ const type = select(_coreData.store).getPostType(postType);
222
+ return !!type?.supports?.['page-attributes'];
223
+ }, [postType]);
224
+ return (0, _element.useMemo)(() => {
225
+ const orderByOptions = [{
226
+ label: (0, _i18n.__)('Newest to oldest'),
227
+ value: 'date/desc'
228
+ }, {
229
+ label: (0, _i18n.__)('Oldest to newest'),
230
+ value: 'date/asc'
231
+ }, {
232
+ /* translators: Label for ordering posts by title in ascending order. */
233
+ label: (0, _i18n.__)('A → Z'),
234
+ value: 'title/asc'
235
+ }, {
236
+ /* translators: Label for ordering posts by title in descending order. */
237
+ label: (0, _i18n.__)('Z → A'),
238
+ value: 'title/desc'
239
+ }];
240
+ if (supportsCustomOrder) {
241
+ orderByOptions.push({
242
+ /* translators: Label for ordering posts by ascending menu order. */
243
+ label: (0, _i18n.__)('Ascending by order'),
244
+ value: 'menu_order/asc'
245
+ }, {
246
+ /* translators: Label for ordering posts by descending menu order. */
247
+ label: (0, _i18n.__)('Descending by order'),
248
+ value: 'menu_order/desc'
249
+ });
250
+ }
251
+ return orderByOptions;
252
+ }, [supportsCustomOrder]);
253
+ }
254
+
210
255
  /**
211
256
  * Hook that returns the query properties' names defined by the active
212
257
  * block variation, to determine which block's filters to show.
@@ -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","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","blockName","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 entities 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\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst activeVariationName = select(\n\t\t\t\tblocksStore\n\t\t\t).getActiveBlockVariation( 'core/query', attributes )?.name;\n\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn 'core/query';\n\t\t\t}\n\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\t`core/query/${ activeVariationName }`,\n\t\t\t\trootClientId\n\t\t\t);\n\n\t\t\treturn activePatterns.length > 0\n\t\t\t\t? `core/query/${ activeVariationName }`\n\t\t\t\t: 'core/query';\n\t\t},\n\t\t[ clientId, attributes ]\n\t);\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,C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AAE;IAAK,CAAC;EAC5B;EACA,IAAIA,UAAU,GAAG,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,CAACzE,QAAQ,CAAE,GAAI,CAAC,GACtDyE,YAAY,CAAC5F,KAAK,CAAE,GAAG,EAAE,CAAE,CAAC,CAAE,CAAC,CAAE,GACjC4F,YAAY;EACf,MAAMK,qBAAqB,GAAGL,YAAY,CAACzE,QAAQ,CAAE,GAAI,CAAC,GACvDyE,YAAY,CAAC5F,KAAK,CAAE,GAAI,CAAC,CAACkG,KAAK,CAAE,CAAE,CAAC,CAACC,IAAI,CAAE,GAAI,CAAC,GAChD,EAAE;EACL,IAAKF,qBAAqB,EAAG;IAC5BH,YAAY,GAAGE,oBAAoB;EACpC;EACAH,UAAU,GAAGE,iBAAiB,CAAC5E,QAAQ,CAAE2E,YAAa,CAAC;EAEvD,OAAO;IAAED,UAAU;IAAEC;EAAa,CAAC;AACpC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_coreData","_blockEditor","_htmlEntities","_i18n","_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","useOrderByOptions","supportsCustomOrder","orderByOptions","__","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","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","blockName","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 { __ } from '@wordpress/i18n';\nimport {\n\tcloneBlock,\n\tgetBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n/** @typedef {import('@wordpress/components/build-types/query-controls/types').OrderByOption} OrderByOption */\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 entities 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 * List of avaiable options to order by.\n *\n * @param {string} postType The post type to check.\n * @return {OrderByOption[]} List of order options.\n */\nexport function useOrderByOptions( postType ) {\n\tconst supportsCustomOrder = useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn !! type?.supports?.[ 'page-attributes' ];\n\t\t},\n\t\t[ postType ]\n\t);\n\n\treturn useMemo( () => {\n\t\tconst orderByOptions = [\n\t\t\t{\n\t\t\t\tlabel: __( 'Newest to oldest' ),\n\t\t\t\tvalue: 'date/desc',\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Oldest to newest' ),\n\t\t\t\tvalue: 'date/asc',\n\t\t\t},\n\t\t\t{\n\t\t\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\t\t\tlabel: __( 'A → Z' ),\n\t\t\t\tvalue: 'title/asc',\n\t\t\t},\n\t\t\t{\n\t\t\t\t/* translators: Label for ordering posts by title in descending order. */\n\t\t\t\tlabel: __( 'Z → A' ),\n\t\t\t\tvalue: 'title/desc',\n\t\t\t},\n\t\t];\n\n\t\tif ( supportsCustomOrder ) {\n\t\t\torderByOptions.push(\n\t\t\t\t{\n\t\t\t\t\t/* translators: Label for ordering posts by ascending menu order. */\n\t\t\t\t\tlabel: __( 'Ascending by order' ),\n\t\t\t\t\tvalue: 'menu_order/asc',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t/* translators: Label for ordering posts by descending menu order. */\n\t\t\t\t\tlabel: __( 'Descending by order' ),\n\t\t\t\t\tvalue: 'menu_order/desc',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn orderByOptions;\n\t}, [ supportsCustomOrder ] );\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\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst activeVariationName = select(\n\t\t\t\tblocksStore\n\t\t\t).getActiveBlockVariation( 'core/query', attributes )?.name;\n\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn 'core/query';\n\t\t\t}\n\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\t`core/query/${ activeVariationName }`,\n\t\t\t\trootClientId\n\t\t\t);\n\n\t\t\treturn activePatterns.length > 0\n\t\t\t\t? `core/query/${ activeVariationName }`\n\t\t\t\t: 'core/query';\n\t\t},\n\t\t[ clientId, attributes ]\n\t);\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,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,O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
17
  !event.shiftKey && !event.defaultPrevented;
18
18
  (0, _interactivity.store)('core/query', {
19
19
  actions: {
20
- *navigate(event) {
20
+ navigate: (0, _interactivity.withSyncEvent)(function* (event) {
21
21
  const ctx = (0, _interactivity.getContext)();
22
22
  const {
23
23
  ref
@@ -35,7 +35,7 @@ const isValidEvent = event => event.button === 0 &&
35
35
  const firstAnchor = `.wp-block-post-template a[href]`;
36
36
  queryRef.querySelector(firstAnchor)?.focus();
37
37
  }
38
- },
38
+ }),
39
39
  *prefetch() {
40
40
  const {
41
41
  ref
@@ -1 +1 @@
1
- {"version":3,"names":["_interactivity","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isValidLink","ref","window","HTMLAnchorElement","href","target","origin","location","isValidEvent","event","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","store","actions","navigate","ctx","getContext","getElement","queryRef","closest","preventDefault","Promise","resolve","then","url","firstAnchor","querySelector","focus","prefetch","callbacks","lock"],"sources":["@wordpress/block-library/src/query/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst isValidLink = ( ref ) =>\n\tref &&\n\tref instanceof window.HTMLAnchorElement &&\n\tref.href &&\n\t( ! ref.target || ref.target === '_self' ) &&\n\tref.origin === window.location.origin;\n\nconst isValidEvent = ( event ) =>\n\tevent.button === 0 && // Left clicks only.\n\t! event.metaKey && // Open in new tab (Mac).\n\t! event.ctrlKey && // Open in new tab (Windows).\n\t! event.altKey && // Download.\n\t! event.shiftKey &&\n\t! event.defaultPrevented;\n\nstore(\n\t'core/query',\n\t{\n\t\tactions: {\n\t\t\t*navigate( event ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tconst queryRef = ref.closest(\n\t\t\t\t\t'.wp-block-query[data-wp-router-region]'\n\t\t\t\t);\n\n\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.navigate( ref.href );\n\t\t\t\t\tctx.url = ref.href;\n\n\t\t\t\t\t// Focus the first anchor of the Query block.\n\t\t\t\t\tconst firstAnchor = `.wp-block-post-template a[href]`;\n\t\t\t\t\tqueryRef.querySelector( firstAnchor )?.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\t*prefetch() {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\t*prefetch() {\n\t\t\t\tconst { url } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( url && isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAAyE,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA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EJ;MAAI,CAAC,GAAG,IAAAR,yBAAU,EAAC,CAAC;MAC5B,MAAM;QAAEnB;MAAI,CAAC,GAAG,IAAAoB,yBAAU,EAAC,CAAC;MAC5B,IAAKO,GAAG,IAAI5B,WAAW,CAAEC,GAAI,CAAC,EAAG;QAChC,MAAM;UAAEgB;QAAQ,CAAC,GAAG,MAAAQ,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAA3C,uBAAA,CAAAN,OAAA,CACnB,iCAAiC,GACjC;QACD,MAAMuC,OAAO,CAACe,QAAQ,CAAE/B,GAAG,CAACG,IAAK,CAAC;MACnC;IACD;EACD;AACD,CAAC,EACD;EAAE8B,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_interactivity","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isValidLink","ref","window","HTMLAnchorElement","href","target","origin","location","isValidEvent","event","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","store","actions","navigate","withSyncEvent","ctx","getContext","getElement","queryRef","closest","preventDefault","Promise","resolve","then","url","firstAnchor","querySelector","focus","prefetch","callbacks","lock"],"sources":["@wordpress/block-library/src/query/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tstore,\n\tgetContext,\n\tgetElement,\n\twithSyncEvent,\n} from '@wordpress/interactivity';\n\nconst isValidLink = ( ref ) =>\n\tref &&\n\tref instanceof window.HTMLAnchorElement &&\n\tref.href &&\n\t( ! ref.target || ref.target === '_self' ) &&\n\tref.origin === window.location.origin;\n\nconst isValidEvent = ( event ) =>\n\tevent.button === 0 && // Left clicks only.\n\t! event.metaKey && // Open in new tab (Mac).\n\t! event.ctrlKey && // Open in new tab (Windows).\n\t! event.altKey && // Download.\n\t! event.shiftKey &&\n\t! event.defaultPrevented;\n\nstore(\n\t'core/query',\n\t{\n\t\tactions: {\n\t\t\tnavigate: withSyncEvent( function* ( event ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tconst queryRef = ref.closest(\n\t\t\t\t\t'.wp-block-query[data-wp-router-region]'\n\t\t\t\t);\n\n\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.navigate( ref.href );\n\t\t\t\t\tctx.url = ref.href;\n\n\t\t\t\t\t// Focus the first anchor of the Query block.\n\t\t\t\t\tconst firstAnchor = `.wp-block-post-template a[href]`;\n\t\t\t\t\tqueryRef.querySelector( firstAnchor )?.focus();\n\t\t\t\t}\n\t\t\t} ),\n\t\t\t*prefetch() {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\t*prefetch() {\n\t\t\t\tconst { url } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( url && isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAKkC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA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,CAAAN,OAAA,CACnB,iCAAiC,GACjC;QACD,MAAMuC,OAAO,CAACgB,QAAQ,CAAEhC,GAAG,CAACG,IAAK,CAAC;MACnC;IACD;EACD,CAAC;EACD8B,SAAS,EAAE;IACV,CAACD,QAAQA,CAAA,EAAG;MACX,MAAM;QAAEJ;MAAI,CAAC,GAAG,IAAAR,yBAAU,EAAC,CAAC;MAC5B,MAAM;QAAEpB;MAAI,CAAC,GAAG,IAAAqB,yBAAU,EAAC,CAAC;MAC5B,IAAKO,GAAG,IAAI7B,WAAW,CAAEC,GAAI,CAAC,EAAG;QAChC,MAAM;UAAEgB;QAAQ,CAAC,GAAG,MAAAS,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAA5C,uBAAA,CAAAN,OAAA,CACnB,iCAAiC,GACjC;QACD,MAAMuC,OAAO,CAACgB,QAAQ,CAAEhC,GAAG,CAACG,IAAK,CAAC;MACnC;IACD;EACD;AACD,CAAC,EACD;EAAE+B,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
@@ -36,9 +36,9 @@ const metadata = exports.metadata = {
36
36
  },
37
37
  color: {
38
38
  gradients: true,
39
- text: true,
40
39
  __experimentalDefaultControls: {
41
- background: true
40
+ background: true,
41
+ text: true
42
42
  }
43
43
  },
44
44
  typography: {
@@ -1 +1 @@
1
- {"version":3,"names":["_edit","_interopRequireDefault","require","_initBlock","_icons","metadata","exports","$schema","apiVersion","name","title","category","ancestor","description","textdomain","attributes","displayType","type","usesContext","supports","align","html","spacing","margin","padding","color","gradients","text","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","settings","icon","queryTotal","edit","init","initBlock"],"sources":["@wordpress/block-library/src/query-total/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport initBlock from '../utils/init-block';\nimport { queryTotal } from './icons';\n\n/* Block settings */\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: queryTotal,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AANA;AACA;AACA;AAFA,MAAAG,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;MAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAV,6BAAA;QAAAG,QAAA;MAAA;IAAA;IAAAQ,oBAAA;MAAAC,MAAA;MAAAf,KAAA;MAAAgB,KAAA;MAAAC,KAAA;MAAAd,6BAAA;QAAAY,MAAA;QAAAf,KAAA;QAAAgB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAA,KAAA;AAAA;AAQA;AACA,MAAM;EAAEjC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMkC,QAAQ,GAAArC,OAAA,CAAAqC,QAAA,GAAG;EACvBC,IAAI,EAAEC,iBAAU;EAChBC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEvC,IAAI;EAAEJ,QAAQ;EAAEsC;AAAS,CAAE,CAAC;AAACrC,OAAA,CAAAyC,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_edit","_interopRequireDefault","require","_initBlock","_icons","metadata","exports","$schema","apiVersion","name","title","category","ancestor","description","textdomain","attributes","displayType","type","usesContext","supports","align","html","spacing","margin","padding","color","gradients","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","settings","icon","queryTotal","edit","init","initBlock"],"sources":["@wordpress/block-library/src/query-total/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport initBlock from '../utils/init-block';\nimport { queryTotal } from './icons';\n\n/* Block settings */\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: queryTotal,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AANA;AACA;AACA;AAFA,MAAAG,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;MAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAX,6BAAA;QAAAI,QAAA;MAAA;IAAA;IAAAQ,oBAAA;MAAAC,MAAA;MAAAf,KAAA;MAAAgB,KAAA;MAAAC,KAAA;MAAAf,6BAAA;QAAAa,MAAA;QAAAf,KAAA;QAAAgB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAA,KAAA;AAAA;AAQA;AACA,MAAM;EAAEjC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMkC,QAAQ,GAAArC,OAAA,CAAAqC,QAAA,GAAG;EACvBC,IAAI,EAAEC,iBAAU;EAChBC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEvC,IAAI;EAAEJ,QAAQ;EAAEsC;AAAS,CAAE,CAAC;AAACrC,OAAA,CAAAyC,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -38,7 +38,7 @@ const {
38
38
  }
39
39
  },
40
40
  actions: {
41
- openSearchInput(event) {
41
+ openSearchInput: (0, _interactivity.withSyncEvent)(event => {
42
42
  const ctx = (0, _interactivity.getContext)();
43
43
  const {
44
44
  ref
@@ -48,7 +48,7 @@ const {
48
48
  ctx.isSearchInputVisible = true;
49
49
  ref.parentElement.querySelector('input').focus();
50
50
  }
51
- },
51
+ }),
52
52
  closeSearchInput() {
53
53
  const ctx = (0, _interactivity.getContext)();
54
54
  ctx.isSearchInputVisible = false;
@@ -1 +1 @@
1
- {"version":3,"names":["_interactivity","require","actions","store","state","ariaLabel","isSearchInputVisible","ariaLabelCollapsed","ariaLabelExpanded","getContext","ariaControls","inputId","type","tabindex","openSearchInput","event","ctx","ref","getElement","preventDefault","parentElement","querySelector","focus","closeSearchInput","handleSearchKeydown","key","handleSearchFocusout","contains","relatedTarget","target","window","document","activeElement","lock"],"sources":["@wordpress/block-library/src/search/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { actions } = store(\n\t'core/search',\n\t{\n\t\tstate: {\n\t\t\tget ariaLabel() {\n\t\t\t\tconst {\n\t\t\t\t\tisSearchInputVisible,\n\t\t\t\t\tariaLabelCollapsed,\n\t\t\t\t\tariaLabelExpanded,\n\t\t\t\t} = getContext();\n\t\t\t\treturn isSearchInputVisible\n\t\t\t\t\t? ariaLabelExpanded\n\t\t\t\t\t: ariaLabelCollapsed;\n\t\t\t},\n\t\t\tget ariaControls() {\n\t\t\t\tconst { isSearchInputVisible, inputId } = getContext();\n\t\t\t\treturn isSearchInputVisible ? null : inputId;\n\t\t\t},\n\t\t\tget type() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? 'submit' : 'button';\n\t\t\t},\n\t\t\tget tabindex() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? '0' : '-1';\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenSearchInput( event ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( ! ctx.isSearchInputVisible ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tctx.isSearchInputVisible = true;\n\t\t\t\t\tref.parentElement.querySelector( 'input' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tcloseSearchInput() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tctx.isSearchInputVisible = false;\n\t\t\t},\n\t\t\thandleSearchKeydown( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If Escape close the menu.\n\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleSearchFocusout( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If focus is outside search form, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\t\t\t\tif (\n\t\t\t\t\t! ref.contains( event.relatedTarget ) &&\n\t\t\t\t\tevent.target !== window.document.activeElement\n\t\t\t\t) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAM;EAAEC;AAAQ,CAAC,GAAG,IAAAC,oBAAK,EACxB,aAAa,EACb;EACCC,KAAK,EAAE;IACN,IAAIC,SAASA,CAAA,EAAG;MACf,MAAM;QACLC,oBAAoB;QACpBC,kBAAkB;QAClBC;MACD,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;MAChB,OAAOH,oBAAoB,GACxBE,iBAAiB,GACjBD,kBAAkB;IACtB,CAAC;IACD,IAAIG,YAAYA,CAAA,EAAG;MAClB,MAAM;QAAEJ,oBAAoB;QAAEK;MAAQ,CAAC,GAAG,IAAAF,yBAAU,EAAC,CAAC;MACtD,OAAOH,oBAAoB,GAAG,IAAI,GAAGK,OAAO;IAC7C,CAAC;IACD,IAAIC,IAAIA,CAAA,EAAG;MACV,MAAM;QAAEN;MAAqB,CAAC,GAAG,IAAAG,yBAAU,EAAC,CAAC;MAC7C,OAAOH,oBAAoB,GAAG,QAAQ,GAAG,QAAQ;IAClD,CAAC;IACD,IAAIO,QAAQA,CAAA,EAAG;MACd,MAAM;QAAEP;MAAqB,CAAC,GAAG,IAAAG,yBAAU,EAAC,CAAC;MAC7C,OAAOH,oBAAoB,GAAG,GAAG,GAAG,IAAI;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ivity","require","actions","store","state","ariaLabel","isSearchInputVisible","ariaLabelCollapsed","ariaLabelExpanded","getContext","ariaControls","inputId","type","tabindex","openSearchInput","withSyncEvent","event","ctx","ref","getElement","preventDefault","parentElement","querySelector","focus","closeSearchInput","handleSearchKeydown","key","handleSearchFocusout","contains","relatedTarget","target","window","document","activeElement","lock"],"sources":["@wordpress/block-library/src/search/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tstore,\n\tgetContext,\n\tgetElement,\n\twithSyncEvent,\n} from '@wordpress/interactivity';\n\nconst { actions } = store(\n\t'core/search',\n\t{\n\t\tstate: {\n\t\t\tget ariaLabel() {\n\t\t\t\tconst {\n\t\t\t\t\tisSearchInputVisible,\n\t\t\t\t\tariaLabelCollapsed,\n\t\t\t\t\tariaLabelExpanded,\n\t\t\t\t} = getContext();\n\t\t\t\treturn isSearchInputVisible\n\t\t\t\t\t? ariaLabelExpanded\n\t\t\t\t\t: ariaLabelCollapsed;\n\t\t\t},\n\t\t\tget ariaControls() {\n\t\t\t\tconst { isSearchInputVisible, inputId } = getContext();\n\t\t\t\treturn isSearchInputVisible ? null : inputId;\n\t\t\t},\n\t\t\tget type() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? 'submit' : 'button';\n\t\t\t},\n\t\t\tget tabindex() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? '0' : '-1';\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenSearchInput: withSyncEvent( ( event ) => {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( ! ctx.isSearchInputVisible ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tctx.isSearchInputVisible = true;\n\t\t\t\t\tref.parentElement.querySelector( 'input' ).focus();\n\t\t\t\t}\n\t\t\t} ),\n\t\t\tcloseSearchInput() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tctx.isSearchInputVisible = false;\n\t\t\t},\n\t\t\thandleSearchKeydown( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If Escape close the menu.\n\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleSearchFocusout( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If focus is outside search form, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\t\t\t\tif (\n\t\t\t\t\t! ref.contains( event.relatedTarget ) &&\n\t\t\t\t\tevent.target !== window.document.activeElement\n\t\t\t\t) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAQA,MAAM;EAAEC;AAAQ,CAAC,GAAG,IAAAC,oBAAK,EACxB,aAAa,EACb;EACCC,KAAK,EAAE;IACN,IAAIC,SAASA,CAAA,EAAG;MACf,MAAM;QACLC,oBAAoB;QACpBC,kBAAkB;QAClBC;MACD,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;MAChB,OAAOH,oBAAoB,GACxBE,iBAAiB,GACjBD,kBAAkB;IACtB,CAAC;IACD,IAAIG,YAAYA,CAAA,EAAG;MAClB,MAAM;QAAEJ,oBAAoB;QAAEK;MAAQ,CAAC,GAAG,IAAAF,yBAAU,EAAC,CAAC;MACtD,OAAOH,oBAAoB,GAAG,IAAI,GAAGK,OAAO;IAC7C,CAAC;IACD,IAAIC,IAAIA,CAAA,EAAG;MACV,MAAM;QAAEN;MAAqB,CAAC,GAAG,IAAAG,yBAAU,EAAC,CAAC;MAC7C,OA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CAAC,IACrCb,KAAK,CAACc,MAAM,KAAKC,MAAM,CAACC,QAAQ,CAACC,aAAa,EAC7C;QACD/B,OAAO,CAACsB,gBAAgB,CAAC,CAAC;MAC3B;IACD;EACD;AACD,CAAC,EACD;EAAEU,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
@@ -460,10 +460,6 @@ function LogoEdit({
460
460
  setTemporaryURL();
461
461
  };
462
462
  const onFilesDrop = filesList => {
463
- if (filesList?.length > 1) {
464
- onUploadError((0, _i18n.__)('Only one image can be used as a site logo.'));
465
- return;
466
- }
467
463
  getSettings().mediaUpload({
468
464
  allowedTypes: ALLOWED_MEDIA_TYPES,
469
465
  filesList,
@@ -474,7 +470,8 @@ function LogoEdit({
474
470
  }
475
471
  onInitialSelectLogo(image);
476
472
  },
477
- onError: onUploadError
473
+ onError: onUploadError,
474
+ multiple: false
478
475
  });
479
476
  };
480
477
  const mediaReplaceFlowProps = {