UNPKG

@wordpress/global-styles-ui

Version:
1 lines • 17.7 kB
{"version":3,"file":"utils.mjs","names":["globalStylesEnginePrivateApis"],"sources":["../src/utils.ts"],"sourcesContent":["import {\n\tareGlobalStylesEqual,\n\tprivateApis as globalStylesEnginePrivateApis,\n} from '@wordpress/global-styles-engine';\nimport type {\n\tGlobalStylesConfig,\n\tGlobalStylesSettings,\n} from '@wordpress/global-styles-engine';\nimport { __ } from '@wordpress/i18n';\nimport { unlock } from './lock-unlock';\n\nconst { getViewportBreakpoints, resolveStyle } = unlock(\n\tglobalStylesEnginePrivateApis\n);\n\n/**\n * State definition with value and label.\n */\nexport interface StateDefinition {\n\tvalue: string;\n\tlabel: string;\n}\n\n/**\n * Valid states for elements with their labels.\n * This mirrors the PHP constant in lib/class-wp-theme-json-gutenberg.php\n */\nexport const VALID_ELEMENT_STATES: Record< string, StateDefinition[] > = {\n\tlink: [\n\t\t{ value: ':link', label: __( 'Link' ) },\n\t\t{ value: ':any-link', label: __( 'Any Link' ) },\n\t\t{ value: ':visited', label: __( 'Visited' ) },\n\t\t{ value: ':hover', label: __( 'Hover' ) },\n\t\t{ value: ':focus', label: __( 'Focus' ) },\n\t\t{ value: ':focus-visible', label: __( 'Focus-visible' ) },\n\t\t{ value: ':active', label: __( 'Active' ) },\n\t],\n\tbutton: [\n\t\t{ value: ':link', label: __( 'Link' ) },\n\t\t{ value: ':any-link', label: __( 'Any Link' ) },\n\t\t{ value: ':visited', label: __( 'Visited' ) },\n\t\t{ value: ':hover', label: __( 'Hover' ) },\n\t\t{ value: ':focus', label: __( 'Focus' ) },\n\t\t{ value: ':focus-visible', label: __( 'Focus-visible' ) },\n\t\t{ value: ':active', label: __( 'Active' ) },\n\t],\n};\n\n/**\n * Valid states for blocks with their labels.\n * This mirrors the PHP constant in lib/class-wp-theme-json-gutenberg.php\n */\nexport const VALID_BLOCK_STATES: Record< string, StateDefinition[] > = {\n\t'core/button': [\n\t\t{ value: ':hover', label: __( 'Hover' ) },\n\t\t{ value: ':focus', label: __( 'Focus' ) },\n\t\t{ value: ':focus-visible', label: __( 'Focus-visible' ) },\n\t\t{ value: ':active', label: __( 'Active' ) },\n\t],\n\t'core/navigation-link': [\n\t\t{ value: ':hover', label: __( 'Hover' ) },\n\t\t{ value: ':focus', label: __( 'Focus' ) },\n\t\t{ value: ':focus-visible', label: __( 'Focus-visible' ) },\n\t\t{ value: ':active', label: __( 'Active' ) },\n\t],\n};\n\n/**\n * Responsive breakpoint states available for all blocks.\n * These map to CSS media queries wrapping the block's styles.\n */\nexport const RESPONSIVE_STATES: StateDefinition[] = [\n\t{ value: '@tablet', label: __( 'Tablet' ) },\n\t{ value: '@mobile', label: __( 'Mobile' ) },\n];\n\n/**\n * Get the valid pseudo states for a given block or element.\n *\n * @param name The block name (e.g., 'core/button') or element name (e.g., 'button')\n * @return Array of valid pseudo state definitions, or empty array if none\n */\nexport function getValidPseudoStates( name: string ): StateDefinition[] {\n\t// Check if it's a block (contains a slash, e.g. 'core/button').\n\tif ( VALID_BLOCK_STATES[ name ] ) {\n\t\treturn VALID_BLOCK_STATES[ name ] ?? [];\n\t}\n\n\t// Check if it's an element\n\tif ( VALID_ELEMENT_STATES[ name ] ) {\n\t\treturn VALID_ELEMENT_STATES[ name ];\n\t}\n\n\treturn [];\n}\n\n/**\n * Get the valid viewport state definitions.\n *\n * @param viewportSettings\n * @return Array of valid viewport state definitions.\n */\nexport function getValidViewportStates(\n\tviewportSettings?: GlobalStylesSettings[ 'viewport' ]\n): StateDefinition[] {\n\tconst breakpoints = getViewportBreakpoints( viewportSettings );\n\n\treturn RESPONSIVE_STATES.filter(\n\t\t( state ) =>\n\t\t\t( state.value !== '@tablet' || breakpoints.tablet !== undefined ) &&\n\t\t\t( state.value !== '@mobile' || breakpoints.mobile !== undefined )\n\t);\n}\n\n/**\n * Removes all instances of properties from an object.\n *\n * @param object The object to remove the properties from.\n * @param properties The properties to remove.\n * @return The modified object.\n */\nexport function removePropertiesFromObject(\n\tobject: any,\n\tproperties: string[]\n): any {\n\tif ( ! properties?.length ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertiesFromObject( object[ key ], properties );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * Returns a new object, with properties specified in `properties` array.,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given properties.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the properties are `[ 'test' ]`.\n *\n * @param object The object to filter\n * @param properties The properties to filter by\n * @return The merged object.\n */\nexport const filterObjectByProperties = (\n\tobject: any,\n\tproperties: string[]\n): any => {\n\tif ( ! object || ! properties?.length ) {\n\t\treturn {};\n\t}\n\n\tconst newObject: any = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperties(\n\t\t\t\tobject[ key ],\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Compares a style variation to the same variation filtered by the specified properties.\n * Returns true if the variation contains only the properties specified.\n *\n * @param variation The variation to compare.\n * @param properties The properties to compare.\n * @return Whether the variation contains only the specified properties.\n */\nexport function isVariationWithProperties(\n\tvariation: GlobalStylesConfig,\n\tproperties: string[]\n): boolean {\n\tconst variationWithProperties = filterObjectByProperties(\n\t\tstructuredClone( variation ),\n\t\tproperties\n\t);\n\n\treturn areGlobalStylesEqual( variationWithProperties, variation );\n}\n\nfunction getFontFamilyFromSetting( fontFamilies: any[], setting: string ): any {\n\tif ( ! Array.isArray( fontFamilies ) || ! setting ) {\n\t\treturn null;\n\t}\n\n\tconst fontFamilyVariable = setting.replace( 'var(', '' ).replace( ')', '' );\n\tconst fontFamilySlug = fontFamilyVariable?.split( '--' ).slice( -1 )[ 0 ];\n\n\treturn fontFamilies.find(\n\t\t( fontFamily ) => fontFamily.slug === fontFamilySlug\n\t);\n}\n\n/**\n * Extracts font families from a theme JSON configuration.\n *\n * @param themeJson The theme JSON configuration\n * @return Array containing [bodyFontFamily, headingFontFamily]\n */\nexport function getFontFamilies( themeJson: any ): [ any, any ] {\n\tconst themeFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.theme;\n\tconst customFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.custom;\n\n\tlet fontFamilies: any[] = [];\n\tif ( themeFontFamilies && customFontFamilies ) {\n\t\tfontFamilies = [ ...themeFontFamilies, ...customFontFamilies ];\n\t} else if ( themeFontFamilies ) {\n\t\tfontFamilies = themeFontFamilies;\n\t} else if ( customFontFamilies ) {\n\t\tfontFamilies = customFontFamilies;\n\t}\n\tconst bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;\n\tconst bodyFontFamily = getFontFamilyFromSetting(\n\t\tfontFamilies,\n\t\tbodyFontFamilySetting\n\t);\n\n\tconst headingFontFamilySetting =\n\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily;\n\n\tlet headingFontFamily;\n\tif ( ! headingFontFamilySetting ) {\n\t\theadingFontFamily = bodyFontFamily;\n\t} else {\n\t\theadingFontFamily = getFontFamilyFromSetting(\n\t\t\tfontFamilies,\n\t\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily\n\t\t);\n\t}\n\n\treturn [ bodyFontFamily, headingFontFamily ];\n}\n\n/**\n * Iterates through the presets array and searches for slugs that start with the specified\n * slugPrefix followed by a numerical suffix. It identifies the highest numerical suffix found\n * and returns one greater than the highest found suffix, ensuring that the new index is unique.\n *\n * @param presets The array of preset objects, each potentially containing a slug property.\n * @param slugPrefix The prefix to look for in the preset slugs.\n *\n * @return The next available index for a preset with the specified slug prefix, or 1 if no matching slugs are found.\n */\n/**\n * Gets the variation class name for a block style variation.\n *\n * @param variation The variation name.\n * @return The variation class name.\n */\nexport function getVariationClassName( variation: string ): string {\n\tif ( ! variation ) {\n\t\treturn '';\n\t}\n\treturn `is-style-${ variation }`;\n}\n\nexport function getNewIndexFromPresets(\n\tpresets: any[],\n\tslugPrefix: string\n): number {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }([\\\\d]+)$` );\n\tconst highestPresetValue = presets.reduce( ( currentHighest, preset ) => {\n\t\tif ( typeof preset?.slug === 'string' ) {\n\t\t\tconst matches = preset?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id > currentHighest ) {\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentHighest;\n\t}, 0 );\n\treturn highestPresetValue + 1;\n}\n\n// Heading blocks render at any level, so every heading screen shares one list.\nconst HEADING_ELEMENTS = [ 'heading', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ];\n\n// Has no block styles, so resolving with it leaves only the root and element\n// layers, while `{ ref }` values can still point into `styles.blocks`.\nconst ELEMENT_ONLY_BLOCK_NAME = 'core/__element-only';\n\nfunction getElementKeys( element: string ): string[] {\n\treturn HEADING_ELEMENTS.includes( element )\n\t\t? HEADING_ELEMENTS\n\t\t: [ element ];\n}\n\n// State and viewport styles go to other selectors, so they cannot override\n// the element itself.\nfunction isOwnStylePath( path: string ) {\n\treturn ! path.startsWith( ':' ) && ! path.startsWith( '@' );\n}\n\nconst BOX_SIDES = [ 'top', 'right', 'bottom', 'left' ];\n\n// Shorthands whose longhands live elsewhere in the tree. Nested longhands,\n// such as `border.radius.topLeft` or `spacing.padding.top`, sit under their\n// shorthand and match by path.\nconst SHORTHAND_LONGHANDS: Record< string, string[] > = {\n\t'border.color': BOX_SIDES.map( ( side ) => `border.${ side }.color` ),\n\t'border.style': BOX_SIDES.map( ( side ) => `border.${ side }.style` ),\n\t'border.width': BOX_SIDES.map( ( side ) => `border.${ side }.width` ),\n\t// Output as the `background` shorthand.\n\t'color.gradient': [\n\t\t'color.background',\n\t\t'background.backgroundImage',\n\t\t'background.backgroundPosition',\n\t\t'background.backgroundRepeat',\n\t\t'background.backgroundSize',\n\t\t'background.backgroundAttachment',\n\t\t'background.backgroundClip',\n\t],\n};\n\nfunction isSameOrNestedPath( path: string, otherPath: string ) {\n\treturn (\n\t\tpath === otherPath ||\n\t\tpath.startsWith( `${ otherPath }.` ) ||\n\t\totherPath.startsWith( `${ path }.` )\n\t);\n}\n\n// Whether two paths set any of the same CSS, whichever sets the shorthand.\nfunction setsSameProperty( path: string, otherPath: string ) {\n\tconst longhands = SHORTHAND_LONGHANDS[ path ] ?? [ path ];\n\tconst otherLonghands = SHORTHAND_LONGHANDS[ otherPath ] ?? [ otherPath ];\n\treturn longhands.some( ( longhand ) =>\n\t\totherLonghands.some( ( otherLonghand ) =>\n\t\t\tisSameOrNestedPath( longhand, otherLonghand )\n\t\t)\n\t);\n}\n\n/**\n * The block types an element paints whose own Global Styles beat the element\n * for at least one property it sets. Block style variations are not counted.\n *\n * @param config Merged Global Styles config.\n * @param element Element key, e.g. `heading`, `h2` or `button`.\n * @param blockNames Block types that paint the element.\n * @return Block names, in the given order.\n */\nexport function getOverridingBlockTypes(\n\tconfig: GlobalStylesConfig | undefined,\n\telement: string,\n\tblockNames: string[]\n): string[] {\n\tif ( ! blockNames.length || ! config?.styles ) {\n\t\treturn [];\n\t}\n\tconst elements = getElementKeys( element );\n\tconst { sources: elementSources } = resolveStyle( config, {\n\t\tblockName: ELEMENT_ONLY_BLOCK_NAME,\n\t\telements,\n\t} );\n\tconst elementPaths = Object.keys( elementSources ).filter(\n\t\t( path ) => elementSources[ path ].layer === 'element'\n\t);\n\treturn blockNames.filter( ( blockName ) => {\n\t\tconst { sources } = resolveStyle( config, { blockName, elements } );\n\t\treturn Object.keys( sources ).some(\n\t\t\t( path ) =>\n\t\t\t\tisOwnStylePath( path ) &&\n\t\t\t\tsources[ path ].layer === 'block' &&\n\t\t\t\telementPaths.some( ( elementPath ) =>\n\t\t\t\t\tsetsSameProperty( path, elementPath )\n\t\t\t\t)\n\t\t);\n\t} );\n}\n"],"mappings":";;;;AAWA,MAAM,EAAE,wBAAwB,iBAAiB,OAChDA,WACD;;;;;AAcA,MAAa,uBAA4D;CACxE,MAAM;EACL;GAAE,OAAO;GAAS,OAAO,GAAI,MAAO;EAAE;EACtC;GAAE,OAAO;GAAa,OAAO,GAAI,UAAW;EAAE;EAC9C;GAAE,OAAO;GAAY,OAAO,GAAI,SAAU;EAAE;EAC5C;GAAE,OAAO;GAAU,OAAO,GAAI,OAAQ;EAAE;EACxC;GAAE,OAAO;GAAU,OAAO,GAAI,OAAQ;EAAE;EACxC;GAAE,OAAO;GAAkB,OAAO,GAAI,eAAgB;EAAE;EACxD;GAAE,OAAO;GAAW,OAAO,GAAI,QAAS;EAAE;CAC3C;CACA,QAAQ;EACP;GAAE,OAAO;GAAS,OAAO,GAAI,MAAO;EAAE;EACtC;GAAE,OAAO;GAAa,OAAO,GAAI,UAAW;EAAE;EAC9C;GAAE,OAAO;GAAY,OAAO,GAAI,SAAU;EAAE;EAC5C;GAAE,OAAO;GAAU,OAAO,GAAI,OAAQ;EAAE;EACxC;GAAE,OAAO;GAAU,OAAO,GAAI,OAAQ;EAAE;EACxC;GAAE,OAAO;GAAkB,OAAO,GAAI,eAAgB;EAAE;EACxD;GAAE,OAAO;GAAW,OAAO,GAAI,QAAS;EAAE;CAC3C;AACD;;;;;AAMA,MAAa,qBAA0D;CACtE,eAAe;EACd;GAAE,OAAO;GAAU,OAAO,GAAI,OAAQ;EAAE;EACxC;GAAE,OAAO;GAAU,OAAO,GAAI,OAAQ;EAAE;EACxC;GAAE,OAAO;GAAkB,OAAO,GAA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