@wordpress/block-library
Version:
Block library for the WordPress editor.
8 lines (7 loc) • 23.4 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../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 \u2192 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 \u2192 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 * Hook that, given a block clientId, determines if it has unsupported blocks or not.\n *\n * @param {string} clientId The block's client ID.\n * @return {boolean} True if there are any unsupported blocks.\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\treturn getClientIdsOfDescendants( clientId ).some(\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\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! blockSupportsInteractivity &&\n\t\t\t\t\t\t! blockSupportsInteractivityClientNavigation\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\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 { isSing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