@wordpress/blocks
Version:
Block API for WordPress.
8 lines (7 loc) • 19.1 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/api/utils.js"],
"sourcesContent": ["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { Component, isValidElement } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { RichTextData } from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { BLOCK_ICON_DEFAULT } from './constants';\nimport { getBlockType, getDefaultBlockName } from './registration';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\n/**\n * Array of icon colors containing a color to be used if the icon color\n * was not explicitly set but the icon background color was.\n *\n * @type {Object}\n */\nconst ICON_COLORS = [ '#191e23', '#f8f9f9' ];\n\n/**\n * Determines whether the block's attributes are equal to the default attributes\n * which means the block is unmodified.\n *\n * @param {WPBlock} block Block Object.\n * @param {?string} role Optional role to filter attributes for modification check.\n *\n * @return {boolean} Whether the block is an unmodified block.\n */\nexport function isUnmodifiedBlock( block, role ) {\n\tconst blockAttributes = getBlockType( block.name )?.attributes ?? {};\n\n\t// Filter attributes by role if a role is provided.\n\tconst attributesByRole = role\n\t\t? Object.entries( blockAttributes ).filter( ( [ key, definition ] ) => {\n\t\t\t\t// A special case for the metadata attribute.\n\t\t\t\t// It can include block bindings that serve as a source of content,\n\t\t\t\t// without directly modifying content attributes.\n\t\t\t\tif ( role === 'content' && key === 'metadata' ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tObject.keys( block.attributes[ key ]?.bindings ?? {} )\n\t\t\t\t\t\t\t.length > 0\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tdefinition.role === role ||\n\t\t\t\t\tdefinition.__experimentalRole === role\n\t\t\t\t);\n\t\t } )\n\t\t: [];\n\t// Fallback to all attributes if no attributes match the role.\n\tconst attributesToCheck = !! attributesByRole.length\n\t\t? attributesByRole\n\t\t: Object.entries( blockAttributes );\n\n\treturn attributesToCheck.every( ( [ key, definition ] ) => {\n\t\tconst value = block.attributes[ key ];\n\n\t\t// Every attribute that has a default must match the default.\n\t\tif ( definition.hasOwnProperty( 'default' ) ) {\n\t\t\treturn value === definition.default;\n\t\t}\n\n\t\t// The rich text type is a bit different from the rest because it\n\t\t// has an implicit default value of an empty RichTextData instance,\n\t\t// so check the length of the value.\n\t\tif ( definition.type === 'rich-text' ) {\n\t\t\treturn ! value?.length;\n\t\t}\n\n\t\t// Every attribute that doesn't have a default should be undefined.\n\t\treturn value === undefined;\n\t} );\n}\n\n/**\n * Determines whether the block is a default block and its attributes are equal\n * to the default attributes which means the block is unmodified.\n *\n * @param {WPBlock} block Block Object\n * @param {?string} role Optional role to filter attributes for modification check.\n *\n * @return {boolean} Whether the block is an unmodified default block.\n */\nexport function isUnmodifiedDefaultBlock( block, role ) {\n\treturn (\n\t\tblock.name === getDefaultBlockName() && isUnmodifiedBlock( block, role )\n\t);\n}\n\n/**\n * Function that checks if the parameter is a valid icon.\n *\n * @param {*} icon Parameter to be checked.\n *\n * @return {boolean} True if the parameter is a valid icon and false otherwise.\n */\n\nexport function isValidIcon( icon ) {\n\treturn (\n\t\t!! icon &&\n\t\t( typeof icon === 'string' ||\n\t\t\tisValidElement( icon ) ||\n\t\t\ttypeof icon === 'function' ||\n\t\t\ticon instanceof Component )\n\t);\n}\n\n/**\n * Function that receives an icon as set by the blocks during the registration\n * and returns a new icon object that is normalized so we can rely on just on possible icon structure\n * in the codebase.\n *\n * @param {WPBlockTypeIconRender} icon Render behavior of a block type icon;\n * one of a Dashicon slug, an element, or a\n * component.\n *\n * @return {WPBlockTypeIconDescriptor} Object describing the icon.\n */\nexport function normalizeIconObject( icon ) {\n\ticon = icon || BLOCK_ICON_DEFAULT;\n\tif ( isValidIcon( icon ) ) {\n\t\treturn { src: icon };\n\t}\n\n\tif ( 'background' in icon ) {\n\t\tconst colordBgColor = colord( icon.background );\n\t\tconst getColorContrast = ( iconColor ) =>\n\t\t\tcolordBgColor.contrast( iconColor );\n\t\tconst maxContrast = Math.max( ...ICON_COLORS.map( getColorContrast ) );\n\n\t\treturn {\n\t\t\t...icon,\n\t\t\tforeground: icon.foreground\n\t\t\t\t? icon.foreground\n\t\t\t\t: ICON_COLORS.find(\n\t\t\t\t\t\t( iconColor ) =>\n\t\t\t\t\t\t\tgetColorContrast( iconColor ) === maxContrast\n\t\t\t\t ),\n\t\t\tshadowColor: colordBgColor.alpha( 0.3 ).toRgbString(),\n\t\t};\n\t}\n\n\treturn icon;\n}\n\n/**\n * Normalizes block type passed as param. When string is passed then\n * it converts it to the matching block type object.\n * It passes the original object otherwise.\n *\n * @param {string|Object} blockTypeOrName Block type or name.\n *\n * @return {?Object} Block type.\n */\nexport function normalizeBlockType( blockTypeOrName ) {\n\tif ( typeof blockTypeOrName === 'string' ) {\n\t\treturn getBlockType( blockTypeOrName );\n\t}\n\n\treturn blockTypeOrName;\n}\n\n/**\n * Get the label for the block, usually this is either the block title,\n * or the value of the block's `label` function when that's specified.\n *\n * @param {Object} blockType The block type.\n * @param {Object} attributes The values of the block's attributes.\n * @param {Object} context The intended use for the label.\n *\n * @return {string} The block label.\n */\nexport function getBlockLabel( blockType, attributes, context = 'visual' ) {\n\tconst { __experimentalLabel: getLabel, title } = blockType;\n\n\tconst label = getLabel && getLabel( attributes, { context } );\n\n\tif ( ! label ) {\n\t\treturn title;\n\t}\n\n\tif ( label.toPlainText ) {\n\t\treturn label.toPlainText();\n\t}\n\n\t// Strip any HTML (i.e. RichText formatting) before returning.\n\treturn stripHTML( label );\n}\n\n/**\n * Get a label for the block for use by screenreaders, this is more descriptive\n * than the visual label and includes the block title and the value of the\n * `getLabel` function if it's specified.\n *\n * @param {?Object} blockType The block type.\n * @param {Object} attributes The values of the block's attributes.\n * @param {?number} position The position of the block in the block list.\n * @param {string} [direction='vertical'] The direction of the block layout.\n *\n * @return {string} The block label.\n */\nexport function getAccessibleBlockLabel(\n\tblockType,\n\tattributes,\n\tposition,\n\tdirection = 'vertical'\n) {\n\t// `title` is already localized, `label` is a user-supplied value.\n\tconst title = blockType?.title;\n\tconst label = blockType\n\t\t? getBlockLabel( blockType, attributes, 'accessibility' )\n\t\t: '';\n\tconst hasPosition = position !== undefined;\n\n\t// getBlockLabel returns the block title as a fallback when there's no label,\n\t// if it did return the title, this function needs to avoid adding the\n\t// title twice within the accessible label. Use this `hasLabel` boolean to\n\t// handle that.\n\tconst hasLabel = label && label !== title;\n\n\tif ( hasPosition && direction === 'vertical' ) {\n\t\tif ( hasLabel ) {\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */\n\t\t\t\t__( '%1$s Block. Row %2$d. %3$s' ),\n\t\t\t\ttitle,\n\t\t\t\tposition,\n\t\t\t\tlabel\n\t\t\t);\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t/* translators: accessibility text. 1: The block title. 2: The block row number. */\n\t\t\t__( '%1$s Block. Row %2$d' ),\n\t\t\ttitle,\n\t\t\tposition\n\t\t);\n\t} else if ( hasPosition && direction === 'horizontal' ) {\n\t\tif ( hasLabel ) {\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */\n\t\t\t\t__( '%1$s Block. Column %2$d. %3$s' ),\n\t\t\t\ttitle,\n\t\t\t\tposition,\n\t\t\t\tlabel\n\t\t\t);\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t/* translators: accessibility text. 1: The block title. 2: The block column number. */\n\t\t\t__( '%1$s Block. Column %2$d' ),\n\t\t\ttitle,\n\t\t\tposition\n\t\t);\n\t}\n\n\tif ( hasLabel ) {\n\t\treturn sprintf(\n\t\t\t/* translators: accessibility text. 1: The block title. 2: The block label. */\n\t\t\t__( '%1$s Block. %2$s' ),\n\t\t\ttitle,\n\t\t\tlabel\n\t\t);\n\t}\n\n\treturn sprintf(\n\t\t/* translators: accessibility text. %s: The block title. */\n\t\t__( '%s Block' ),\n\t\ttitle\n\t);\n}\n\nexport function getDefault( attributeSchema ) {\n\tif ( attributeSchema.default !== undefined ) {\n\t\treturn attributeSchema.default;\n\t}\n\n\tif ( attributeSchema.type === 'rich-text' ) {\n\t\treturn new RichTextData();\n\t}\n}\n\n/**\n * Check if a block is registered.\n *\n * @param {string} name The block's name.\n *\n * @return {boolean} Whether the block is registered.\n */\nexport function isBlockRegistered( name ) {\n\treturn getBlockType( name ) !== undefined;\n}\n\n/**\n * Ensure attributes contains only values defined by block type, and merge\n * default values for missing attributes.\n *\n * @param {string} name The block's name.\n * @param {Object} attributes The block's attributes.\n * @return {Object} The sanitized attributes.\n */\nexport function __experimentalSanitizeBlockAttributes( name, attributes ) {\n\t// Get the type definition associated with a registered block.\n\tconst blockType = getBlockType( name );\n\n\tif ( undefined === blockType ) {\n\t\tthrow new Error( `Block type '${ name }' is not registered.` );\n\t}\n\n\treturn Object.entries( blockType.attributes ).reduce(\n\t\t( accumulator, [ key, schema ] ) => {\n\t\t\tconst value = attributes[ key ];\n\n\t\t\tif ( undefined !== value ) {\n\t\t\t\tif ( schema.type === 'rich-text' ) {\n\t\t\t\t\tif ( value instanceof RichTextData ) {\n\t\t\t\t\t\taccumulator[ key ] = value;\n\t\t\t\t\t} else if ( typeof value === 'string' ) {\n\t\t\t\t\t\taccumulator[ key ] =\n\t\t\t\t\t\t\tRichTextData.fromHTMLString( value );\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tschema.type === 'string' &&\n\t\t\t\t\tvalue instanceof RichTextData\n\t\t\t\t) {\n\t\t\t\t\taccumulator[ key ] = value.toHTMLString();\n\t\t\t\t} else {\n\t\t\t\t\taccumulator[ key ] = value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst _default = getDefault( schema );\n\t\t\t\tif ( undefined !== _default ) {\n\t\t\t\t\taccumulator[ key ] = _default;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( [ 'node', 'children' ].indexOf( schema.source ) !== -1 ) {\n\t\t\t\t// Ensure value passed is always an array, which we're expecting in\n\t\t\t\t// the RichText component to handle the deprecated value.\n\t\t\t\tif ( typeof accumulator[ key ] === 'string' ) {\n\t\t\t\t\taccumulator[ key ] = [ accumulator[ key ] ];\n\t\t\t\t} else if ( ! Array.isArray( accumulator[ key ] ) ) {\n\t\t\t\t\taccumulator[ key ] = [];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn accumulator;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Filter block attributes by `role` and return their names.\n *\n * @param {string} name Block attribute's name.\n * @param {string} role The role of a block attribute.\n *\n * @return {string[]} The attribute names that have the provided role.\n */\nexport function getBlockAttributesNamesByRole( name, role ) {\n\tconst attributes = getBlockType( name )?.attributes;\n\tif ( ! attributes ) {\n\t\treturn [];\n\t}\n\tconst attributesNames = Object.keys( attributes );\n\tif ( ! role ) {\n\t\treturn attributesNames;\n\t}\n\n\treturn attributesNames.filter( ( attributeName ) => {\n\t\tconst attribute = attributes[ attributeName ];\n\t\tif ( attribute?.role === role ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( attribute?.__experimentalRole === role ) {\n\t\t\tdeprecated( '__experimentalRole attribute', {\n\t\t\t\tsince: '6.7',\n\t\t\t\tversion: '6.8',\n\t\t\t\talternative: 'role attribute',\n\t\t\t\thint: `Check the block.json of the ${ name } block.`,\n\t\t\t} );\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t} );\n}\n\nexport const __experimentalGetBlockAttributesNamesByRole = ( ...args ) => {\n\tdeprecated( '__experimentalGetBlockAttributesNamesByRole', {\n\t\tsince: '6.7',\n\t\tversion: '6.8',\n\t\talternative: 'getBlockAttributesNamesByRole',\n\t} );\n\treturn getBlockAttributesNamesByRole( ...args );\n};\n\n/**\n * Checks if a block is a content block by examining its attributes.\n * A block is considered a content block if it has at least one attribute\n * with a role of 'content'.\n *\n * @param {string} name The name of the block to check.\n * @return {boolean} Whether the block is a content block.\n */\nexport function isContentBlock( name ) {\n\tconst blockType = getBlockType( name );\n\tconst attributes = blockType?.attributes;\n\t// Not all blocks have attributes but they may support contentRole instead.\n\tconst supportsContentRole = blockType?.supports?.contentRole;\n\n\tif ( supportsContentRole ) {\n\t\treturn true;\n\t}\n\tif ( ! attributes ) {\n\t\treturn false;\n\t}\n\n\treturn !! Object.keys( attributes )?.some( ( attributeKey ) => {\n\t\tconst attribute = attributes[ attributeKey ];\n\t\treturn (\n\t\t\tattribute?.role === 'content' ||\n\t\t\tattribute?.__experimentalRole === 'content'\n\t\t);\n\t} );\n}\n\n/**\n * Return a new object with the specified keys omitted.\n *\n * @param {Object} object Original object.\n * @param {Array} keys Keys to be omitted.\n *\n * @return {Object} Object with omitted keys.\n */\nexport function omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA+B;AAC/B,mBAAwB;AACxB,kBAAuB;AAKvB,qBAA0C;AAC1C,kBAA4B;AAC5B,iBAAiD;AACjD,uBAA6B;AAC7B,wBAAuB;AAKvB,uBAAmC;AACnC,0BAAkD;AAAA,IAElD,sBAAQ,CAAE,aAAAA,SAAa,YAAAC,OAAW,CAAE;AAQpC,IAAM,cAAc,CAAE,WAAW,SAAU;AAWpC,SAAS,kBAAmB,OAAO,MAAO;AAChD,QAAM,sBAAkB,kCAAc,MAAM,IAAK,GAAG,cAAc,CAAC;AAGnE,QAAM,mBAAmB,OACtB,OAAO,QAAS,eAAgB,EAAE,OAAQ,CAAE,CAAE,KAAK,U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