@wordpress/block-editor 12.18.0 → 12.18.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 (41) hide show
  1. package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  2. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  3. package/build/components/global-styles/dimensions-panel.js +30 -5
  4. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  5. package/build/components/global-styles/hooks.js +9 -7
  6. package/build/components/global-styles/hooks.js.map +1 -1
  7. package/build/components/global-styles/use-global-styles-output.js +6 -0
  8. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  9. package/build/hooks/dimensions.js +71 -1
  10. package/build/hooks/dimensions.js.map +1 -1
  11. package/build/hooks/index.js +2 -2
  12. package/build/hooks/index.js.map +1 -1
  13. package/build/hooks/style.js +3 -0
  14. package/build/hooks/style.js.map +1 -1
  15. package/build/hooks/utils.js +3 -2
  16. package/build/hooks/utils.js.map +1 -1
  17. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  18. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  19. package/build-module/components/global-styles/dimensions-panel.js +30 -5
  20. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  21. package/build-module/components/global-styles/hooks.js +9 -7
  22. package/build-module/components/global-styles/hooks.js.map +1 -1
  23. package/build-module/components/global-styles/use-global-styles-output.js +6 -0
  24. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  25. package/build-module/hooks/dimensions.js +70 -2
  26. package/build-module/hooks/dimensions.js.map +1 -1
  27. package/build-module/hooks/index.js +2 -1
  28. package/build-module/hooks/index.js.map +1 -1
  29. package/build-module/hooks/style.js +3 -0
  30. package/build-module/hooks/style.js.map +1 -1
  31. package/build-module/hooks/utils.js +3 -2
  32. package/build-module/hooks/utils.js.map +1 -1
  33. package/package.json +4 -4
  34. package/src/components/dimensions-tool/aspect-ratio-tool.js +4 -1
  35. package/src/components/global-styles/dimensions-panel.js +50 -1
  36. package/src/components/global-styles/hooks.js +9 -6
  37. package/src/components/global-styles/use-global-styles-output.js +6 -0
  38. package/src/hooks/dimensions.js +74 -3
  39. package/src/hooks/index.js +2 -0
  40. package/src/hooks/style.js +4 -0
  41. package/src/hooks/utils.js +4 -0
@@ -1 +1 @@
1
- {"version":3,"names":["__EXPERIMENTAL_STYLE_PROPERTY","STYLE_PROPERTY","__EXPERIMENTAL_ELEMENTS","ELEMENTS","getBlockSupport","getBlockTypes","store","blocksStore","useSelect","useContext","useMemo","getCSSRules","privateApis","componentsPrivateApis","PRESET_METADATA","ROOT_BLOCK_SELECTOR","scopeSelector","appendToSelector","getBlockCSSSelector","getTypographyFontSizeValue","getFluidTypographyOptionsFromSettings","GlobalStylesContext","useGlobalSetting","getDuotoneFilter","getGapCSSValue","blockEditorStore","LAYOUT_DEFINITIONS","getValueFromObjectPath","setImmutably","BlockContext","unlock","BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS","__experimentalBorder","color","spacing","typography","compileStyleValue","uncompiledValue","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","startsWith","variable","slice","length","split","join","getPresetsDeclarations","blockPresets","mergedSettings","kebabCase","reduce","declarations","path","valueKey","valueFunc","cssVarInfix","presetByOrigin","forEach","origin","value","push","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","colors","flattenTree","input","prefix","token","result","Object","keys","key","newKey","replace","newLeaf","newPrefix","concatFeatureVariationSelectorString","featureSelector","styleVariationSelector","featureSelectors","combinedSelectors","trim","getFeatureDeclarations","selectors","styles","entries","feature","isShorthand","subfeature","subfeatureSelector","subfeatureStyles","newDeclarations","getStylesDeclarations","root","featureStyles","blockStyles","useRootPaddingAlign","tree","isTemplate","isRoot","output","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","rule","ruleValue","ref","refPath","size","settings","getLayoutStyles","layoutDefinitions","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","blockGap","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","validDisplayModes","displayMode","baseStyles","includes","baseStyle","STYLE_KEYS","pickStyleKeys","treeToPickFrom","pickedEntries","clonedEntries","JSON","parse","stringify","fromEntries","getNodesWithStyles","blockSelectors","_tree$styles$blocks","nodes","elements","blocks","blockName","node","_node$elements","variations","variation","duotoneSelector","hasLayoutSupport","styleVariationSelectors","elementName","sel","elementSelectors","elementSelector","getNodesWithSettings","_tree$settings$blocks","pickPresets","presets","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","layout","featureDeclarations","cssSelector","styleVariationName","styleVariations","baseSelector","styleVariationDeclarations","duotoneStyles","duotoneDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getSelectorsConfig","blockType","rootSelector","config","featureKey","featureName","getBlockSelectors","blockTypes","getBlockStyles","duotoneSupport","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","undefined","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processCSSNesting","css","processedCSS","parts","part","isRootCss","splittedPart","nestedSelector","useGlobalStylesOutputWithConfig","mergedConfig","select","getSettings","blockContext","templateSlug","_mergedConfig$styles$","customProperties","globalStyles","svgs","isGlobalStyles","assets","__unstableType","useGlobalStylesOutput","merged"],"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-output.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n\tgetBlockSupport,\n\tgetBlockTypes,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { getCSSRules } from '@wordpress/style-engine';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPRESET_METADATA,\n\tROOT_BLOCK_SELECTOR,\n\tscopeSelector,\n\tappendToSelector,\n} from './utils';\nimport { getBlockCSSSelector } from './get-block-css-selector';\nimport {\n\tgetTypographyFontSizeValue,\n\tgetFluidTypographyOptionsFromSettings,\n} from './typography-utils';\nimport { GlobalStylesContext } from './context';\nimport { useGlobalSetting } from './hooks';\nimport { getDuotoneFilter } from '../duotone/utils';\nimport { getGapCSSValue } from '../../hooks/gap';\nimport { store as blockEditorStore } from '../../store';\nimport { LAYOUT_DEFINITIONS } from '../../layouts/definitions';\nimport { getValueFromObjectPath, setImmutably } from '../../utils/object';\nimport BlockContext from '../block-context';\nimport { unlock } from '../../lock-unlock';\n\n// List of block support features that can have their related styles\n// generated under their own feature level selector rather than the block's.\nconst BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {\n\t__experimentalBorder: 'border',\n\tcolor: 'color',\n\tspacing: 'spacing',\n\ttypography: 'typography',\n};\n\nfunction compileStyleValue( uncompiledValue ) {\n\tconst VARIABLE_REFERENCE_PREFIX = 'var:';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\n\n\tif ( uncompiledValue?.startsWith?.( VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Transform given preset tree into a set of style declarations.\n *\n * @param {Object} blockPresets\n * @param {Object} mergedSettings Merged theme.json settings.\n *\n * @return {Array<Object>} An array of style declarations.\n */\nfunction getPresetsDeclarations( blockPresets = {}, mergedSettings ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, valueKey, valueFunc, cssVarInfix } ) => {\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( value ) => {\n\t\t\t\t\t\tif ( valueKey && ! valueFunc ) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ value[ valueKey ] }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tvalueFunc &&\n\t\t\t\t\t\t\ttypeof valueFunc === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ valueFunc( value, mergedSettings ) }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Transform given preset tree into a set of preset class declarations.\n *\n * @param {?string} blockSelector\n * @param {Object} blockPresets\n * @return {string} CSS declarations for the preset classes.\n */\nfunction getPresetsClasses( blockSelector = '*', blockPresets = {} ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, cssVarInfix, classes } ) => {\n\t\t\tif ( ! classes ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( { slug } ) => {\n\t\t\t\t\t\tclasses.forEach( ( { classSuffix, propertyName } ) => {\n\t\t\t\t\t\t\tconst classSelectorToUse = `.has-${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) }-${ classSuffix }`;\n\t\t\t\t\t\t\tconst selectorToUse = blockSelector\n\t\t\t\t\t\t\t\t.split( ',' ) // Selector can be \"h1, h2, h3\"\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t( selector ) =>\n\t\t\t\t\t\t\t\t\t\t`${ selector }${ classSelectorToUse }`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t\t\tconst value = `var(--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) })`;\n\t\t\t\t\t\t\tdeclarations += `${ selectorToUse }{${ propertyName }: ${ value } !important;}`;\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn declarations;\n\t\t},\n\t\t''\n\t);\n}\n\nfunction getPresetsSvgFilters( blockPresets = {} ) {\n\treturn PRESET_METADATA.filter(\n\t\t// Duotone are the only type of filters for now.\n\t\t( metadata ) => metadata.path.at( -1 ) === 'duotone'\n\t).flatMap( ( metadata ) => {\n\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\tblockPresets,\n\t\t\tmetadata.path,\n\t\t\t{}\n\t\t);\n\t\treturn [ 'default', 'theme' ]\n\t\t\t.filter( ( origin ) => presetByOrigin[ origin ] )\n\t\t\t.flatMap( ( origin ) =>\n\t\t\t\tpresetByOrigin[ origin ].map( ( preset ) =>\n\t\t\t\t\tgetDuotoneFilter(\n\t\t\t\t\t\t`wp-duotone-${ preset.slug }`,\n\t\t\t\t\t\tpreset.colors\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t.join( '' );\n\t} );\n}\n\nfunction flattenTree( input = {}, prefix, token ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tlet result = [];\n\tObject.keys( input ).forEach( ( key ) => {\n\t\tconst newKey = prefix + kebabCase( key.replace( '/', '-' ) );\n\t\tconst newLeaf = input[ key ];\n\n\t\tif ( newLeaf instanceof Object ) {\n\t\t\tconst newPrefix = newKey + token;\n\t\t\tresult = [ ...result, ...flattenTree( newLeaf, newPrefix, token ) ];\n\t\t} else {\n\t\t\tresult.push( `${ newKey }: ${ newLeaf }` );\n\t\t}\n\t} );\n\treturn result;\n}\n\n/**\n * Gets variation selector string from feature selector.\n *\n * @param {string} featureSelector The feature selector.\n *\n * @param {string} styleVariationSelector The style variation selector.\n * @return {string} Combined selector string.\n */\nfunction concatFeatureVariationSelectorString(\n\tfeatureSelector,\n\tstyleVariationSelector\n) {\n\tconst featureSelectors = featureSelector.split( ',' );\n\tconst combinedSelectors = [];\n\tfeatureSelectors.forEach( ( selector ) => {\n\t\tcombinedSelectors.push(\n\t\t\t`${ styleVariationSelector.trim() }${ selector.trim() }`\n\t\t);\n\t} );\n\treturn combinedSelectors.join( ', ' );\n}\n\n/**\n * Generate style declarations for a block's custom feature and subfeature\n * selectors.\n *\n * NOTE: The passed `styles` object will be mutated by this function.\n *\n * @param {Object} selectors Custom selectors object for a block.\n * @param {Object} styles A block's styles object.\n *\n * @return {Object} Style declarations.\n */\nconst getFeatureDeclarations = ( selectors, styles ) => {\n\tconst declarations = {};\n\n\tObject.entries( selectors ).forEach( ( [ feature, selector ] ) => {\n\t\t// We're only processing features/subfeatures that have styles.\n\t\tif ( feature === 'root' || ! styles?.[ feature ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isShorthand = typeof selector === 'string';\n\n\t\t// If we have a selector object instead of shorthand process it.\n\t\tif ( ! isShorthand ) {\n\t\t\tObject.entries( selector ).forEach(\n\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t// Don't process root feature selector yet or any\n\t\t\t\t\t// subfeature that doesn't have a style.\n\t\t\t\t\tif (\n\t\t\t\t\t\tsubfeature === 'root' ||\n\t\t\t\t\t\t! styles?.[ feature ][ subfeature ]\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create a temporary styles object and build\n\t\t\t\t\t// declarations for subfeature.\n\t\t\t\t\tconst subfeatureStyles = {\n\t\t\t\t\t\t[ feature ]: {\n\t\t\t\t\t\t\t[ subfeature ]: styles[ feature ][ subfeature ],\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tconst newDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( subfeatureStyles );\n\n\t\t\t\t\t// Merge new declarations in with any others that\n\t\t\t\t\t// share the same selector.\n\t\t\t\t\tdeclarations[ subfeatureSelector ] = [\n\t\t\t\t\t\t...( declarations[ subfeatureSelector ] || [] ),\n\t\t\t\t\t\t...newDeclarations,\n\t\t\t\t\t];\n\n\t\t\t\t\t// Remove the subfeature's style now it will be\n\t\t\t\t\t// included under its own selector not the block's.\n\t\t\t\t\tdelete styles[ feature ][ subfeature ];\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Now subfeatures have been processed and removed, we can\n\t\t// process root, or shorthand, feature selectors.\n\t\tif ( isShorthand || selector.root ) {\n\t\t\tconst featureSelector = isShorthand ? selector : selector.root;\n\n\t\t\t// Create temporary style object and build declarations for feature.\n\t\t\tconst featureStyles = { [ feature ]: styles[ feature ] };\n\t\t\tconst newDeclarations = getStylesDeclarations( featureStyles );\n\n\t\t\t// Merge new declarations with any others that share the selector.\n\t\t\tdeclarations[ featureSelector ] = [\n\t\t\t\t...( declarations[ featureSelector ] || [] ),\n\t\t\t\t...newDeclarations,\n\t\t\t];\n\n\t\t\t// Remove the feature from the block's styles now as it will be\n\t\t\t// included under its own selector not the block's.\n\t\t\tdelete styles[ feature ];\n\t\t}\n\t} );\n\n\treturn declarations;\n};\n\n/**\n * Transform given style tree into a set of style declarations.\n *\n * @param {Object} blockStyles Block styles.\n *\n * @param {string} selector The selector these declarations should attach to.\n *\n * @param {boolean} useRootPaddingAlign Whether to use CSS custom properties in root selector.\n *\n * @param {Object} tree A theme.json tree containing layout definitions.\n *\n * @param {boolean} isTemplate Whether the entity being edited is a full template or a pattern.\n * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {},\n\tisTemplate = true\n) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst isRoot = ROOT_BLOCK_SELECTOR === selector;\n\tconst output = Object.entries( STYLE_PROPERTY ).reduce(\n\t\t(\n\t\t\tdeclarations,\n\t\t\t[ key, { value, properties, useEngine, rootOnly } ]\n\t\t) => {\n\t\t\tif ( rootOnly && ! isRoot ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\t\t\tconst pathToValue = value;\n\t\t\tif ( pathToValue[ 0 ] === 'elements' || useEngine ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\tblockStyles,\n\t\t\t\tpathToValue\n\t\t\t);\n\n\t\t\t// Root-level padding styles don't currently support strings with CSS shorthand values.\n\t\t\t// This may change: https://github.com/WordPress/gutenberg/issues/40132.\n\t\t\tif (\n\t\t\t\tkey === '--wp--style--root--padding' &&\n\t\t\t\t( typeof styleValue === 'string' || ! useRootPaddingAlign )\n\t\t\t) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tif ( properties && typeof styleValue !== 'string' ) {\n\t\t\t\tObject.entries( properties ).forEach( ( entry ) => {\n\t\t\t\t\tconst [ name, prop ] = entry;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! getValueFromObjectPath( styleValue, [ prop ], false )\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Do not create a declaration\n\t\t\t\t\t\t// for sub-properties that don't have any value.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cssProperty = name.startsWith( '--' )\n\t\t\t\t\t\t? name\n\t\t\t\t\t\t: kebabCase( name );\n\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\t\tgetValueFromObjectPath( styleValue, [ prop ] )\n\t\t\t\t\t\t) }`\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue, false )\n\t\t\t) {\n\t\t\t\tconst cssProperty = key.startsWith( '--' )\n\t\t\t\t\t? key\n\t\t\t\t\t: kebabCase( key );\n\t\t\t\tdeclarations.push(\n\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue )\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tconst extraRules = getCSSRules( blockStyles );\n\textraRules.forEach( ( rule ) => {\n\t\t// Don't output padding properties if padding variables are set or if we're not editing a full template.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\t( useRootPaddingAlign || ! isTemplate ) &&\n\t\t\trule.key.startsWith( 'padding' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst cssProperty = rule.key.startsWith( '--' )\n\t\t\t? rule.key\n\t\t\t: kebabCase( rule.key );\n\n\t\tlet ruleValue = rule.value;\n\t\tif ( typeof ruleValue !== 'string' && ruleValue?.ref ) {\n\t\t\tconst refPath = ruleValue.ref.split( '.' );\n\t\t\truleValue = getValueFromObjectPath( tree, refPath );\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif ( ! ruleValue || ruleValue?.ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate fluid typography rules where available.\n\t\tif ( cssProperty === 'font-size' ) {\n\t\t\t/*\n\t\t\t * getTypographyFontSizeValue() will check\n\t\t\t * if fluid typography has been activated and also\n\t\t\t * whether the incoming value can be converted to a fluid value.\n\t\t\t * Values that already have a \"clamp()\" function will not pass the test,\n\t\t\t * and therefore the original $value will be returned.\n\t\t\t */\n\t\t\truleValue = getTypographyFontSizeValue(\n\t\t\t\t{ size: ruleValue },\n\t\t\t\tgetFluidTypographyOptionsFromSettings( tree?.settings )\n\t\t\t);\n\t\t}\n\n\t\toutput.push( `${ cssProperty }: ${ ruleValue }` );\n\t} );\n\n\treturn output;\n}\n\n/**\n * Get generated CSS for layout styles by looking up layout definitions provided\n * in theme.json, and outputting common layout styles, and specific blockGap values.\n *\n * @param {Object} props\n * @param {Object} props.layoutDefinitions Layout definitions, keyed by layout type.\n * @param {Object} props.style A style object containing spacing values.\n * @param {string} props.selector Selector used to group together layout styling rules.\n * @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support.\n * @param {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles.\n * @param {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available.\n * @return {string} Generated CSS rules for the layout styles.\n */\nexport function getLayoutStyles( {\n\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\tstyle,\n\tselector,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tfallbackGapValue,\n} ) {\n\tlet ruleset = '';\n\tlet gapValue = hasBlockGapSupport\n\t\t? getGapCSSValue( style?.spacing?.blockGap )\n\t\t: '';\n\n\t// Ensure a fallback gap value for the root layout definitions,\n\t// and use a fallback value if one is provided for the current block.\n\tif ( hasFallbackGapSupport ) {\n\t\tif ( selector === ROOT_BLOCK_SELECTOR ) {\n\t\t\tgapValue = ! gapValue ? '0.5em' : gapValue;\n\t\t} else if ( ! hasBlockGapSupport && fallbackGapValue ) {\n\t\t\tgapValue = fallbackGapValue;\n\t\t}\n\t}\n\n\tif ( gapValue && layoutDefinitions ) {\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, name, spacingStyles } ) => {\n\t\t\t\t// Allow outputting fallback gap styles for flex layout type when block gap support isn't available.\n\t\t\t\tif (\n\t\t\t\t\t! hasBlockGapSupport &&\n\t\t\t\t\t'flex' !== name &&\n\t\t\t\t\t'grid' !== name\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( spacingStyles?.length ) {\n\t\t\t\t\tspacingStyles.forEach( ( spacingStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( spacingStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( spacingStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${\n\t\t\t\t\t\t\t\t\t\t\tcssValue ? cssValue : gapValue\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}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tlet combinedSelector = '';\n\n\t\t\t\t\t\t\tif ( ! hasBlockGapSupport ) {\n\t\t\t\t\t\t\t\t// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`\n\t\t\t\t\t\t\t\t\t\t: `:where(${ selector }.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(${ selector } .${ className })${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`\n\t\t\t\t\t\t\t\t\t\t: `${ selector }-${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t// For backwards compatibility, ensure the legacy block gap CSS variable is still available.\n\t\tif ( selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport ) {\n\t\t\truleset += `${ selector } { --wp--style--block-gap: ${ gapValue }; }`;\n\t\t}\n\t}\n\n\t// Output base styles\n\tif ( selector === ROOT_BLOCK_SELECTOR && layoutDefinitions ) {\n\t\tconst validDisplayModes = [ 'block', 'flex', 'grid' ];\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, displayMode, baseStyles } ) => {\n\t\t\t\tif (\n\t\t\t\t\tdisplayMode &&\n\t\t\t\t\tvalidDisplayModes.includes( displayMode )\n\t\t\t\t) {\n\t\t\t\t\truleset += `${ selector } .${ className } { display:${ displayMode }; }`;\n\t\t\t\t}\n\n\t\t\t\tif ( baseStyles?.length ) {\n\t\t\t\t\tbaseStyles.forEach( ( baseStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( baseStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( baseStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${ cssValue }`\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);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst combinedSelector = `${ selector } .${ className }${\n\t\t\t\t\t\t\t\tbaseStyle?.selector || ''\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\treturn ruleset;\n}\n\nconst STYLE_KEYS = [\n\t'border',\n\t'color',\n\t'dimensions',\n\t'spacing',\n\t'typography',\n\t'filter',\n\t'outline',\n\t'shadow',\n];\n\nfunction pickStyleKeys( treeToPickFrom ) {\n\tif ( ! treeToPickFrom ) {\n\t\treturn {};\n\t}\n\tconst entries = Object.entries( treeToPickFrom );\n\tconst pickedEntries = entries.filter( ( [ key ] ) =>\n\t\tSTYLE_KEYS.includes( key )\n\t);\n\t// clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it\n\tconst clonedEntries = pickedEntries.map( ( [ key, style ] ) => [\n\t\tkey,\n\t\tJSON.parse( JSON.stringify( style ) ),\n\t] );\n\treturn Object.fromEntries( clonedEntries );\n}\n\nexport const getNodesWithStyles = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.styles ) {\n\t\treturn nodes;\n\t}\n\n\t// Top-level.\n\tconst styles = pickStyleKeys( tree.styles );\n\tif ( styles ) {\n\t\tnodes.push( {\n\t\t\tstyles,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\tObject.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {\n\t\tif ( tree.styles?.elements?.[ name ] ) {\n\t\t\tnodes.push( {\n\t\t\t\tstyles: tree.styles?.elements?.[ name ],\n\t\t\t\tselector,\n\t\t\t} );\n\t\t}\n\t} );\n\n\t// Iterate over blocks: they can have styles & elements.\n\tObject.entries( tree.styles?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockStyles = pickStyleKeys( node );\n\n\t\t\tif ( node?.variations ) {\n\t\t\t\tconst variations = {};\n\t\t\t\tObject.keys( node.variations ).forEach( ( variation ) => {\n\t\t\t\t\tvariations[ variation ] = pickStyleKeys(\n\t\t\t\t\t\tnode.variations[ variation ]\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\tblockStyles.variations = variations;\n\t\t\t}\n\t\t\tif ( blockStyles && blockSelectors?.[ blockName ]?.selector ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tduotoneSelector:\n\t\t\t\t\t\tblockSelectors[ blockName ].duotoneSelector,\n\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\tblockSelectors[ blockName ].fallbackGapValue,\n\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\tblockSelectors[ blockName ].hasLayoutSupport,\n\t\t\t\t\tselector: blockSelectors[ blockName ].selector,\n\t\t\t\t\tstyles: blockStyles,\n\t\t\t\t\tfeatureSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].featureSelectors,\n\t\t\t\t\tstyleVariationSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].styleVariationSelectors,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tObject.entries( node?.elements ?? {} ).forEach(\n\t\t\t\t( [ elementName, value ] ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tvalue &&\n\t\t\t\t\t\tblockSelectors?.[ blockName ] &&\n\t\t\t\t\t\tELEMENTS[ elementName ]\n\t\t\t\t\t) {\n\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\tstyles: value,\n\t\t\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel ) => {\n\t\t\t\t\t\t\t\t\tconst elementSelectors =\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ elementName ].split( ',' );\n\t\t\t\t\t\t\t\t\treturn elementSelectors.map(\n\t\t\t\t\t\t\t\t\t\t( elementSelector ) =>\n\t\t\t\t\t\t\t\t\t\t\tsel + ' ' + elementSelector\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\t.join( ',' ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const getNodesWithSettings = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.settings ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickPresets = ( treeToPickFrom ) => {\n\t\tlet presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = getValueFromObjectPath( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tpresets = setImmutably( presets, path, value );\n\t\t\t}\n\t\t} );\n\t\treturn presets;\n\t};\n\n\t// Top-level.\n\tconst presets = pickPresets( tree.settings );\n\tconst custom = tree.settings?.custom;\n\tif ( Object.keys( presets ).length > 0 || custom ) {\n\t\tnodes.push( {\n\t\t\tpresets,\n\t\t\tcustom,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\t// Blocks.\n\tObject.entries( tree.settings?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockPresets = pickPresets( node );\n\t\t\tconst blockCustom = node.custom;\n\t\t\tif ( Object.keys( blockPresets ).length > 0 || blockCustom ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tpresets: blockPresets,\n\t\t\t\t\tcustom: blockCustom,\n\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const toCustomProperties = ( tree, blockSelectors ) => {\n\tconst settings = getNodesWithSettings( tree, blockSelectors );\n\tlet ruleset = '';\n\tsettings.forEach( ( { presets, custom, selector } ) => {\n\t\tconst declarations = getPresetsDeclarations( presets, tree?.settings );\n\t\tconst customProps = flattenTree( custom, '--wp--custom--', '--' );\n\t\tif ( customProps.length > 0 ) {\n\t\t\tdeclarations.push( ...customProps );\n\t\t}\n\n\t\tif ( declarations.length > 0 ) {\n\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport const toStyles = (\n\ttree,\n\tblockSelectors,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tdisableLayoutStyles = false,\n\tisTemplate = true\n) => {\n\tconst nodesWithStyles = getNodesWithStyles( tree, blockSelectors );\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\tconst useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments;\n\tconst { contentSize, wideSize } = tree?.settings?.layout || {};\n\n\t/*\n\t * Reset default browser margin on the root body element.\n\t * This is set on the root selector **before** generating the ruleset\n\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t * `margin` in its `spacing` declaration for the `body` element then these\n\t * user-generated values take precedence in the CSS cascade.\n\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t */\n\tlet ruleset = 'body {margin: 0;';\n\n\tif ( contentSize ) {\n\t\truleset += ` --wp--style--global--content-size: ${ contentSize };`;\n\t}\n\n\tif ( wideSize ) {\n\t\truleset += ` --wp--style--global--wide-size: ${ wideSize };`;\n\t}\n\n\t// Root padding styles should only be output for full templates, not patterns or template parts.\n\tif ( useRootPaddingAlign && isTemplate ) {\n\t\t/*\n\t\t * These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508\n\t\t * almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors.\n\t\t */\n\t\truleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;`;\n\t}\n\n\truleset += '}';\n\n\tnodesWithStyles.forEach(\n\t\t( {\n\t\t\tselector,\n\t\t\tduotoneSelector,\n\t\t\tstyles,\n\t\t\tfallbackGapValue,\n\t\t\thasLayoutSupport,\n\t\t\tfeatureSelectors,\n\t\t\tstyleVariationSelectors,\n\t\t} ) => {\n\t\t\t// Process styles for block support features with custom feature level\n\t\t\t// CSS selectors set.\n\t\t\tif ( featureSelectors ) {\n\t\t\t\tconst featureDeclarations = getFeatureDeclarations(\n\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\tstyles\n\t\t\t\t);\n\n\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t( [ cssSelector, declarations ] ) => {\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst rules = declarations.join( ';' );\n\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( styleVariationSelectors ) {\n\t\t\t\tObject.entries( styleVariationSelectors ).forEach(\n\t\t\t\t\t( [ styleVariationName, styleVariationSelector ] ) => {\n\t\t\t\t\t\tconst styleVariations =\n\t\t\t\t\t\t\tstyles?.variations?.[ styleVariationName ];\n\t\t\t\t\t\tif ( styleVariations ) {\n\t\t\t\t\t\t\t// If the block uses any custom selectors for block support, add those first.\n\t\t\t\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\t\tgetFeatureDeclarations(\n\t\t\t\t\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\t\t\t\t\tstyleVariations\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t\t\t\t\t( [ baseSelector, declarations ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\t\t\t\tconst cssSelector =\n\t\t\t\t\t\t\t\t\t\t\t\tconcatFeatureVariationSelectorString(\n\t\t\t\t\t\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyleVariationSelector\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tconst rules =\n\t\t\t\t\t\t\t\t\t\t\t\tdeclarations.join( ';' );\n\t\t\t\t\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\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);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise add regular selectors.\n\t\t\t\t\t\t\tconst styleVariationDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations(\n\t\t\t\t\t\t\t\t\tstyleVariations,\n\t\t\t\t\t\t\t\t\tstyleVariationSelector,\n\t\t\t\t\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\t\t\t\t\ttree\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( styleVariationDeclarations.length ) {\n\t\t\t\t\t\t\t\truleset += `${ styleVariationSelector }{${ styleVariationDeclarations.join(\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Process duotone styles.\n\t\t\tif ( duotoneSelector ) {\n\t\t\t\tconst duotoneStyles = {};\n\t\t\t\tif ( styles?.filter ) {\n\t\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\t\tdelete styles.filter;\n\t\t\t\t}\n\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\tif ( duotoneDeclarations.length ) {\n\t\t\t\t\truleset += `${ duotoneSelector }{${ duotoneDeclarations.join(\n\t\t\t\t\t\t';'\n\t\t\t\t\t) };}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process blockGap and layout styles.\n\t\t\tif (\n\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t) {\n\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\tstyle: styles,\n\t\t\t\t\tselector,\n\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\tfallbackGapValue,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\tconst declarations = getStylesDeclarations(\n\t\t\t\tstyles,\n\t\t\t\tselector,\n\t\t\t\tuseRootPaddingAlign,\n\t\t\t\ttree,\n\t\t\t\tisTemplate\n\t\t\t);\n\t\t\tif ( declarations?.length ) {\n\t\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t\t}\n\n\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t);\n\n\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// `selector` maybe provided in a form\n\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t// string.\n\t\t\t\t\t\t// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;\n\t\t\t\t\t\t// Split and append pseudo selector to create\n\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t.map( ( sel ) => sel + pseudoKey )\n\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\tconst pseudoRule = `${ _selector }{${ pseudoDeclarations.join(\n\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t) };}`;\n\n\t\t\t\t\t\truleset += pseudoRule;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n\t/* Add alignment / layout styles */\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\n\tif ( hasBlockGapSupport ) {\n\t\t// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.\n\t\tconst gapValue =\n\t\t\tgetGapCSSValue( tree?.styles?.spacing?.blockGap ) || '0.5em';\n\t\truleset =\n\t\t\truleset +\n\t\t\t`:where(.wp-site-blocks) > * { margin-block-start: ${ gapValue }; margin-block-end: 0; }`;\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }';\n\t}\n\n\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\tif ( ROOT_BLOCK_SELECTOR === selector ) {\n\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\tselector = '';\n\t\t}\n\n\t\tconst classes = getPresetsClasses( selector, presets );\n\t\tif ( classes.length > 0 ) {\n\t\t\truleset += classes;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport function toSvgFilters( tree, blockSelectors ) {\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\treturn nodesWithSettings.flatMap( ( { presets } ) => {\n\t\treturn getPresetsSvgFilters( presets );\n\t} );\n}\n\nconst getSelectorsConfig = ( blockType, rootSelector ) => {\n\tif (\n\t\tblockType?.selectors &&\n\t\tObject.keys( blockType.selectors ).length > 0\n\t) {\n\t\treturn blockType.selectors;\n\t}\n\n\tconst config = { root: rootSelector };\n\tObject.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(\n\t\t( [ featureKey, featureName ] ) => {\n\t\t\tconst featureSelector = getBlockCSSSelector(\n\t\t\t\tblockType,\n\t\t\t\tfeatureKey\n\t\t\t);\n\n\t\t\tif ( featureSelector ) {\n\t\t\t\tconfig[ featureName ] = featureSelector;\n\t\t\t}\n\t\t}\n\t);\n\n\treturn config;\n};\n\nexport const getBlockSelectors = ( blockTypes, getBlockStyles ) => {\n\tconst result = {};\n\tblockTypes.forEach( ( blockType ) => {\n\t\tconst name = blockType.name;\n\t\tconst selector = getBlockCSSSelector( blockType );\n\t\tlet duotoneSelector = getBlockCSSSelector(\n\t\t\tblockType,\n\t\t\t'filter.duotone'\n\t\t);\n\n\t\t// Keep backwards compatibility for support.color.__experimentalDuotone.\n\t\tif ( ! duotoneSelector ) {\n\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tduotoneSelector =\n\t\t\t\tduotoneSupport && scopeSelector( rootSelector, duotoneSupport );\n\t\t}\n\n\t\tconst hasLayoutSupport =\n\t\t\t!! blockType?.supports?.layout ||\n\t\t\t!! blockType?.supports?.__experimentalLayout;\n\t\tconst fallbackGapValue =\n\t\t\tblockType?.supports?.spacing?.blockGap?.__experimentalDefault;\n\n\t\tconst blockStyleVariations = getBlockStyles( name );\n\t\tconst styleVariationSelectors = {};\n\t\tif ( blockStyleVariations?.length ) {\n\t\t\tblockStyleVariations.forEach( ( variation ) => {\n\t\t\t\tconst styleVariationSelector = `.is-style-${ variation.name }${ selector }`;\n\t\t\t\tstyleVariationSelectors[ variation.name ] =\n\t\t\t\t\tstyleVariationSelector;\n\t\t\t} );\n\t\t}\n\t\t// For each block support feature add any custom selectors.\n\t\tconst featureSelectors = getSelectorsConfig( blockType, selector );\n\n\t\tresult[ name ] = {\n\t\t\tduotoneSelector,\n\t\t\tfallbackGapValue,\n\t\t\tfeatureSelectors: Object.keys( featureSelectors ).length\n\t\t\t\t? featureSelectors\n\t\t\t\t: undefined,\n\t\t\thasLayoutSupport,\n\t\t\tname,\n\t\t\tselector,\n\t\t\tstyleVariationSelectors: Object.keys( styleVariationSelectors )\n\t\t\t\t.length\n\t\t\t\t? styleVariationSelectors\n\t\t\t\t: undefined,\n\t\t};\n\t} );\n\n\treturn result;\n};\n\n/**\n * If there is a separator block whose color is defined in theme.json via background,\n * update the separator color to the same value by using border color.\n *\n * @param {Object} config Theme.json configuration file object.\n * @return {Object} configTheme.json configuration file object updated.\n */\nfunction updateConfigWithSeparator( config ) {\n\tconst needsSeparatorStyleUpdate =\n\t\tconfig.styles?.blocks?.[ 'core/separator' ] &&\n\t\tconfig.styles?.blocks?.[ 'core/separator' ].color?.background &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].color?.text &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].border?.color;\n\tif ( needsSeparatorStyleUpdate ) {\n\t\treturn {\n\t\t\t...config,\n\t\t\tstyles: {\n\t\t\t\t...config.styles,\n\t\t\t\tblocks: {\n\t\t\t\t\t...config.styles.blocks,\n\t\t\t\t\t'core/separator': {\n\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ],\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ].color,\n\t\t\t\t\t\t\ttext: config.styles?.blocks[ 'core/separator' ]\n\t\t\t\t\t\t\t\t.color.background,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\treturn config;\n}\n\nexport function processCSSNesting( css, blockSelector ) {\n\tlet processedCSS = '';\n\n\t// Split CSS nested rules.\n\tconst parts = css.split( '&' );\n\tparts.forEach( ( part ) => {\n\t\tconst isRootCss = ! part.includes( '{' );\n\t\tif ( isRootCss ) {\n\t\t\t// If the part doesn't contain braces, it applies to the root level.\n\t\t\tprocessedCSS += `${ blockSelector }{${ part.trim() }}`;\n\t\t} else {\n\t\t\t// If the part contains braces, it's a nested CSS rule.\n\t\t\tconst splittedPart = part.replace( '}', '' ).split( '{' );\n\t\t\tif ( splittedPart.length !== 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst [ nestedSelector, cssValue ] = splittedPart;\n\t\t\tconst combinedSelector = nestedSelector.startsWith( ' ' )\n\t\t\t\t? scopeSelector( blockSelector, nestedSelector )\n\t\t\t\t: appendToSelector( blockSelector, nestedSelector );\n\n\t\t\tprocessedCSS += `${ combinedSelector }{${ cssValue.trim() }}`;\n\t\t}\n\t} );\n\treturn processedCSS;\n}\n\n/**\n * Returns the global styles output using a global styles configuration.\n * If wishing to generate global styles and settings based on the\n * global styles config loaded in the editor context, use `useGlobalStylesOutput()`.\n * The use case for a custom config is to generate bespoke styles\n * and settings for previews, or other out-of-editor experiences.\n *\n * @param {Object} mergedConfig Global styles configuration.\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig( mergedConfig = {} ) {\n\tconst [ blockGap ] = useGlobalSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGap !== null;\n\tconst hasFallbackGapSupport = ! hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support.\n\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn !! getSettings().disableLayoutStyles;\n\t} );\n\n\tconst blockContext = useContext( BlockContext );\n\n\tconst isTemplate = blockContext?.templateSlug !== undefined;\n\n\tconst getBlockStyles = useSelect( ( select ) => {\n\t\treturn select( blocksStore ).getBlockStyles;\n\t}, [] );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [];\n\t\t}\n\t\tmergedConfig = updateConfigWithSeparator( mergedConfig );\n\n\t\tconst blockSelectors = getBlockSelectors(\n\t\t\tgetBlockTypes(),\n\t\t\tgetBlockStyles\n\t\t);\n\n\t\tconst customProperties = toCustomProperties(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors\n\t\t);\n\t\tconst globalStyles = toStyles(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors,\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tisTemplate\n\t\t);\n\t\tconst svgs = toSvgFilters( mergedConfig, blockSelectors );\n\n\t\tconst styles = [\n\t\t\t{\n\t\t\t\tcss: customProperties,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tcss: globalStyles,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.\n\t\t\t{\n\t\t\t\tcss: mergedConfig.styles.css ?? '',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tassets: svgs,\n\t\t\t\t__unstableType: 'svg',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t];\n\n\t\t// Loop through the blocks to check if there are custom CSS values.\n\t\t// If there are, get the block selector and push the selector together with\n\t\t// the CSS value to the 'stylesheets' array.\n\t\tgetBlockTypes().forEach( ( blockType ) => {\n\t\t\tif ( mergedConfig.styles.blocks[ blockType.name ]?.css ) {\n\t\t\t\tconst selector = blockSelectors[ blockType.name ].selector;\n\t\t\t\tstyles.push( {\n\t\t\t\t\tcss: processCSSNesting(\n\t\t\t\t\t\tmergedConfig.styles.blocks[ blockType.name ]?.css,\n\t\t\t\t\t\tselector\n\t\t\t\t\t),\n\t\t\t\t\tisGlobalStyles: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn [ styles, mergedConfig.settings ];\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t] );\n}\n\n/**\n * Returns the global styles output based on the current state of global styles config loaded in the editor context.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput() {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn useGlobalStylesOutputWithConfig( mergedConfig );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,6BAA6B,IAAIC,cAAc,EAC/CC,uBAAuB,IAAIC,QAAQ,EACnCC,eAAe,EACfC,aAAa,EACbC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SACCC,eAAe,EACfC,mBAAmB,EACnBC,aAAa,EACbC,gBAAgB,QACV,SAAS;AAChB,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SACCC,0BAA0B,EAC1BC,qCAAqC,QAC/B,oBAAoB;AAC3B,SAASC,mBAAmB,QAAQ,WAAW;AAC/C,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASlB,KAAK,IAAImB,gBAAgB,QAAQ,aAAa;AACvD,SAASC,kBAAkB,QAAQ,2BAA2B;AAC9D,SAASC,sBAAsB,EAAEC,YAAY,QAAQ,oBAAoB;AACzE,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,MAAM,QAAQ,mBAAmB;;AAE1C;AACA;AACA,MAAMC,qCAAqC,GAAG;EA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;UACZ2K,GAAG,EAAED,iBAAiB,CACrBS,YAAY,CAAC7I,MAAM,CAACoE,MAAM,CAAE6C,SAAS,CAAC1F,IAAI,CAAE,EAAE8G,GAAG,EACjDjK,QACD,CAAC;UACDkL,cAAc,EAAE;QACjB,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAO,CAAEtJ,MAAM,EAAE6I,YAAY,CAAC7G,QAAQ,CAAE;EACzC,CAAC,EAAE,CACFI,kBAAkB,EAClBC,qBAAqB,EACrBwG,YAAY,EACZnD,mBAAmB,CAClB,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS+D,qBAAqBA,CAAA,EAAG;EACvC,MAAM;IAAEC,MAAM,EAAEb;EAAa,CAAC,GAAGvO,UAAU,CAAEY,mBAAoB,CAAC;EAClE,OAAO0N,+BAA+B,CAAEC,YAAa,CAAC;AACvD"}
1
+ {"version":3,"names":["__EXPERIMENTAL_STYLE_PROPERTY","STYLE_PROPERTY","__EXPERIMENTAL_ELEMENTS","ELEMENTS","getBlockSupport","getBlockTypes","store","blocksStore","useSelect","useContext","useMemo","getCSSRules","privateApis","componentsPrivateApis","PRESET_METADATA","ROOT_BLOCK_SELECTOR","scopeSelector","appendToSelector","getBlockCSSSelector","getTypographyFontSizeValue","getFluidTypographyOptionsFromSettings","GlobalStylesContext","useGlobalSetting","getDuotoneFilter","getGapCSSValue","blockEditorStore","LAYOUT_DEFINITIONS","getValueFromObjectPath","setImmutably","BlockContext","unlock","BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS","__experimentalBorder","color","spacing","typography","compileStyleValue","uncompiledValue","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","startsWith","variable","slice","length","split","join","getPresetsDeclarations","blockPresets","mergedSettings","kebabCase","reduce","declarations","path","valueKey","valueFunc","cssVarInfix","presetByOrigin","forEach","origin","value","push","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","colors","flattenTree","input","prefix","token","result","Object","keys","key","newKey","replace","newLeaf","newPrefix","concatFeatureVariationSelectorString","featureSelector","styleVariationSelector","featureSelectors","combinedSelectors","trim","getFeatureDeclarations","selectors","styles","entries","feature","isShorthand","subfeature","subfeatureSelector","subfeatureStyles","newDeclarations","getStylesDeclarations","root","featureStyles","blockStyles","useRootPaddingAlign","tree","isTemplate","isRoot","output","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","rule","ruleValue","ref","refPath","size","settings","getLayoutStyles","layoutDefinitions","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","blockGap","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","validDisplayModes","displayMode","baseStyles","includes","baseStyle","STYLE_KEYS","pickStyleKeys","treeToPickFrom","pickedEntries","clonedEntries","JSON","parse","stringify","fromEntries","getNodesWithStyles","blockSelectors","_tree$styles$blocks","nodes","elements","blocks","blockName","node","_node$elements","variations","variation","duotoneSelector","hasLayoutSupport","styleVariationSelectors","elementName","sel","elementSelectors","elementSelector","getNodesWithSettings","_tree$settings$blocks","pickPresets","presets","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","layout","featureDeclarations","cssSelector","styleVariationName","styleVariations","baseSelector","styleVariationDeclarations","duotoneStyles","duotoneDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getSelectorsConfig","blockType","rootSelector","config","featureKey","featureName","getBlockSelectors","blockTypes","getBlockStyles","duotoneSupport","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","undefined","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processCSSNesting","css","processedCSS","parts","part","isRootCss","splittedPart","nestedSelector","useGlobalStylesOutputWithConfig","mergedConfig","select","getSettings","blockContext","templateSlug","_mergedConfig$styles$","customProperties","globalStyles","svgs","isGlobalStyles","assets","__unstableType","useGlobalStylesOutput","merged"],"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-output.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n\tgetBlockSupport,\n\tgetBlockTypes,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { getCSSRules } from '@wordpress/style-engine';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPRESET_METADATA,\n\tROOT_BLOCK_SELECTOR,\n\tscopeSelector,\n\tappendToSelector,\n} from './utils';\nimport { getBlockCSSSelector } from './get-block-css-selector';\nimport {\n\tgetTypographyFontSizeValue,\n\tgetFluidTypographyOptionsFromSettings,\n} from './typography-utils';\nimport { GlobalStylesContext } from './context';\nimport { useGlobalSetting } from './hooks';\nimport { getDuotoneFilter } from '../duotone/utils';\nimport { getGapCSSValue } from '../../hooks/gap';\nimport { store as blockEditorStore } from '../../store';\nimport { LAYOUT_DEFINITIONS } from '../../layouts/definitions';\nimport { getValueFromObjectPath, setImmutably } from '../../utils/object';\nimport BlockContext from '../block-context';\nimport { unlock } from '../../lock-unlock';\n\n// List of block support features that can have their related styles\n// generated under their own feature level selector rather than the block's.\nconst BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {\n\t__experimentalBorder: 'border',\n\tcolor: 'color',\n\tspacing: 'spacing',\n\ttypography: 'typography',\n};\n\nfunction compileStyleValue( uncompiledValue ) {\n\tconst VARIABLE_REFERENCE_PREFIX = 'var:';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\n\n\tif ( uncompiledValue?.startsWith?.( VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Transform given preset tree into a set of style declarations.\n *\n * @param {Object} blockPresets\n * @param {Object} mergedSettings Merged theme.json settings.\n *\n * @return {Array<Object>} An array of style declarations.\n */\nfunction getPresetsDeclarations( blockPresets = {}, mergedSettings ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, valueKey, valueFunc, cssVarInfix } ) => {\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( value ) => {\n\t\t\t\t\t\tif ( valueKey && ! valueFunc ) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ value[ valueKey ] }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tvalueFunc &&\n\t\t\t\t\t\t\ttypeof valueFunc === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ valueFunc( value, mergedSettings ) }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Transform given preset tree into a set of preset class declarations.\n *\n * @param {?string} blockSelector\n * @param {Object} blockPresets\n * @return {string} CSS declarations for the preset classes.\n */\nfunction getPresetsClasses( blockSelector = '*', blockPresets = {} ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, cssVarInfix, classes } ) => {\n\t\t\tif ( ! classes ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( { slug } ) => {\n\t\t\t\t\t\tclasses.forEach( ( { classSuffix, propertyName } ) => {\n\t\t\t\t\t\t\tconst classSelectorToUse = `.has-${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) }-${ classSuffix }`;\n\t\t\t\t\t\t\tconst selectorToUse = blockSelector\n\t\t\t\t\t\t\t\t.split( ',' ) // Selector can be \"h1, h2, h3\"\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t( selector ) =>\n\t\t\t\t\t\t\t\t\t\t`${ selector }${ classSelectorToUse }`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t\t\tconst value = `var(--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) })`;\n\t\t\t\t\t\t\tdeclarations += `${ selectorToUse }{${ propertyName }: ${ value } !important;}`;\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn declarations;\n\t\t},\n\t\t''\n\t);\n}\n\nfunction getPresetsSvgFilters( blockPresets = {} ) {\n\treturn PRESET_METADATA.filter(\n\t\t// Duotone are the only type of filters for now.\n\t\t( metadata ) => metadata.path.at( -1 ) === 'duotone'\n\t).flatMap( ( metadata ) => {\n\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\tblockPresets,\n\t\t\tmetadata.path,\n\t\t\t{}\n\t\t);\n\t\treturn [ 'default', 'theme' ]\n\t\t\t.filter( ( origin ) => presetByOrigin[ origin ] )\n\t\t\t.flatMap( ( origin ) =>\n\t\t\t\tpresetByOrigin[ origin ].map( ( preset ) =>\n\t\t\t\t\tgetDuotoneFilter(\n\t\t\t\t\t\t`wp-duotone-${ preset.slug }`,\n\t\t\t\t\t\tpreset.colors\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t.join( '' );\n\t} );\n}\n\nfunction flattenTree( input = {}, prefix, token ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tlet result = [];\n\tObject.keys( input ).forEach( ( key ) => {\n\t\tconst newKey = prefix + kebabCase( key.replace( '/', '-' ) );\n\t\tconst newLeaf = input[ key ];\n\n\t\tif ( newLeaf instanceof Object ) {\n\t\t\tconst newPrefix = newKey + token;\n\t\t\tresult = [ ...result, ...flattenTree( newLeaf, newPrefix, token ) ];\n\t\t} else {\n\t\t\tresult.push( `${ newKey }: ${ newLeaf }` );\n\t\t}\n\t} );\n\treturn result;\n}\n\n/**\n * Gets variation selector string from feature selector.\n *\n * @param {string} featureSelector The feature selector.\n *\n * @param {string} styleVariationSelector The style variation selector.\n * @return {string} Combined selector string.\n */\nfunction concatFeatureVariationSelectorString(\n\tfeatureSelector,\n\tstyleVariationSelector\n) {\n\tconst featureSelectors = featureSelector.split( ',' );\n\tconst combinedSelectors = [];\n\tfeatureSelectors.forEach( ( selector ) => {\n\t\tcombinedSelectors.push(\n\t\t\t`${ styleVariationSelector.trim() }${ selector.trim() }`\n\t\t);\n\t} );\n\treturn combinedSelectors.join( ', ' );\n}\n\n/**\n * Generate style declarations for a block's custom feature and subfeature\n * selectors.\n *\n * NOTE: The passed `styles` object will be mutated by this function.\n *\n * @param {Object} selectors Custom selectors object for a block.\n * @param {Object} styles A block's styles object.\n *\n * @return {Object} Style declarations.\n */\nconst getFeatureDeclarations = ( selectors, styles ) => {\n\tconst declarations = {};\n\n\tObject.entries( selectors ).forEach( ( [ feature, selector ] ) => {\n\t\t// We're only processing features/subfeatures that have styles.\n\t\tif ( feature === 'root' || ! styles?.[ feature ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isShorthand = typeof selector === 'string';\n\n\t\t// If we have a selector object instead of shorthand process it.\n\t\tif ( ! isShorthand ) {\n\t\t\tObject.entries( selector ).forEach(\n\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t// Don't process root feature selector yet or any\n\t\t\t\t\t// subfeature that doesn't have a style.\n\t\t\t\t\tif (\n\t\t\t\t\t\tsubfeature === 'root' ||\n\t\t\t\t\t\t! styles?.[ feature ][ subfeature ]\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create a temporary styles object and build\n\t\t\t\t\t// declarations for subfeature.\n\t\t\t\t\tconst subfeatureStyles = {\n\t\t\t\t\t\t[ feature ]: {\n\t\t\t\t\t\t\t[ subfeature ]: styles[ feature ][ subfeature ],\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tconst newDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( subfeatureStyles );\n\n\t\t\t\t\t// Merge new declarations in with any others that\n\t\t\t\t\t// share the same selector.\n\t\t\t\t\tdeclarations[ subfeatureSelector ] = [\n\t\t\t\t\t\t...( declarations[ subfeatureSelector ] || [] ),\n\t\t\t\t\t\t...newDeclarations,\n\t\t\t\t\t];\n\n\t\t\t\t\t// Remove the subfeature's style now it will be\n\t\t\t\t\t// included under its own selector not the block's.\n\t\t\t\t\tdelete styles[ feature ][ subfeature ];\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Now subfeatures have been processed and removed, we can\n\t\t// process root, or shorthand, feature selectors.\n\t\tif ( isShorthand || selector.root ) {\n\t\t\tconst featureSelector = isShorthand ? selector : selector.root;\n\n\t\t\t// Create temporary style object and build declarations for feature.\n\t\t\tconst featureStyles = { [ feature ]: styles[ feature ] };\n\t\t\tconst newDeclarations = getStylesDeclarations( featureStyles );\n\n\t\t\t// Merge new declarations with any others that share the selector.\n\t\t\tdeclarations[ featureSelector ] = [\n\t\t\t\t...( declarations[ featureSelector ] || [] ),\n\t\t\t\t...newDeclarations,\n\t\t\t];\n\n\t\t\t// Remove the feature from the block's styles now as it will be\n\t\t\t// included under its own selector not the block's.\n\t\t\tdelete styles[ feature ];\n\t\t}\n\t} );\n\n\treturn declarations;\n};\n\n/**\n * Transform given style tree into a set of style declarations.\n *\n * @param {Object} blockStyles Block styles.\n *\n * @param {string} selector The selector these declarations should attach to.\n *\n * @param {boolean} useRootPaddingAlign Whether to use CSS custom properties in root selector.\n *\n * @param {Object} tree A theme.json tree containing layout definitions.\n *\n * @param {boolean} isTemplate Whether the entity being edited is a full template or a pattern.\n * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {},\n\tisTemplate = true\n) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst isRoot = ROOT_BLOCK_SELECTOR === selector;\n\tconst output = Object.entries( STYLE_PROPERTY ).reduce(\n\t\t(\n\t\t\tdeclarations,\n\t\t\t[ key, { value, properties, useEngine, rootOnly } ]\n\t\t) => {\n\t\t\tif ( rootOnly && ! isRoot ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\t\t\tconst pathToValue = value;\n\t\t\tif ( pathToValue[ 0 ] === 'elements' || useEngine ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\tblockStyles,\n\t\t\t\tpathToValue\n\t\t\t);\n\n\t\t\t// Root-level padding styles don't currently support strings with CSS shorthand values.\n\t\t\t// This may change: https://github.com/WordPress/gutenberg/issues/40132.\n\t\t\tif (\n\t\t\t\tkey === '--wp--style--root--padding' &&\n\t\t\t\t( typeof styleValue === 'string' || ! useRootPaddingAlign )\n\t\t\t) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tif ( properties && typeof styleValue !== 'string' ) {\n\t\t\t\tObject.entries( properties ).forEach( ( entry ) => {\n\t\t\t\t\tconst [ name, prop ] = entry;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! getValueFromObjectPath( styleValue, [ prop ], false )\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Do not create a declaration\n\t\t\t\t\t\t// for sub-properties that don't have any value.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cssProperty = name.startsWith( '--' )\n\t\t\t\t\t\t? name\n\t\t\t\t\t\t: kebabCase( name );\n\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\t\tgetValueFromObjectPath( styleValue, [ prop ] )\n\t\t\t\t\t\t) }`\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue, false )\n\t\t\t) {\n\t\t\t\tconst cssProperty = key.startsWith( '--' )\n\t\t\t\t\t? key\n\t\t\t\t\t: kebabCase( key );\n\t\t\t\tdeclarations.push(\n\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue )\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tconst extraRules = getCSSRules( blockStyles );\n\textraRules.forEach( ( rule ) => {\n\t\t// Don't output padding properties if padding variables are set or if we're not editing a full template.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\t( useRootPaddingAlign || ! isTemplate ) &&\n\t\t\trule.key.startsWith( 'padding' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst cssProperty = rule.key.startsWith( '--' )\n\t\t\t? rule.key\n\t\t\t: kebabCase( rule.key );\n\n\t\tlet ruleValue = rule.value;\n\t\tif ( typeof ruleValue !== 'string' && ruleValue?.ref ) {\n\t\t\tconst refPath = ruleValue.ref.split( '.' );\n\t\t\truleValue = getValueFromObjectPath( tree, refPath );\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif ( ! ruleValue || ruleValue?.ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate fluid typography rules where available.\n\t\tif ( cssProperty === 'font-size' ) {\n\t\t\t/*\n\t\t\t * getTypographyFontSizeValue() will check\n\t\t\t * if fluid typography has been activated and also\n\t\t\t * whether the incoming value can be converted to a fluid value.\n\t\t\t * Values that already have a \"clamp()\" function will not pass the test,\n\t\t\t * and therefore the original $value will be returned.\n\t\t\t */\n\t\t\truleValue = getTypographyFontSizeValue(\n\t\t\t\t{ size: ruleValue },\n\t\t\t\tgetFluidTypographyOptionsFromSettings( tree?.settings )\n\t\t\t);\n\t\t}\n\n\t\t// For aspect ratio to work, other dimensions rules (and Cover block defaults) must be unset.\n\t\t// This ensures that a fixed height does not override the aspect ratio.\n\t\tif ( cssProperty === 'aspect-ratio' ) {\n\t\t\toutput.push( 'min-height: unset' );\n\t\t}\n\n\t\toutput.push( `${ cssProperty }: ${ ruleValue }` );\n\t} );\n\n\treturn output;\n}\n\n/**\n * Get generated CSS for layout styles by looking up layout definitions provided\n * in theme.json, and outputting common layout styles, and specific blockGap values.\n *\n * @param {Object} props\n * @param {Object} props.layoutDefinitions Layout definitions, keyed by layout type.\n * @param {Object} props.style A style object containing spacing values.\n * @param {string} props.selector Selector used to group together layout styling rules.\n * @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support.\n * @param {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles.\n * @param {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available.\n * @return {string} Generated CSS rules for the layout styles.\n */\nexport function getLayoutStyles( {\n\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\tstyle,\n\tselector,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tfallbackGapValue,\n} ) {\n\tlet ruleset = '';\n\tlet gapValue = hasBlockGapSupport\n\t\t? getGapCSSValue( style?.spacing?.blockGap )\n\t\t: '';\n\n\t// Ensure a fallback gap value for the root layout definitions,\n\t// and use a fallback value if one is provided for the current block.\n\tif ( hasFallbackGapSupport ) {\n\t\tif ( selector === ROOT_BLOCK_SELECTOR ) {\n\t\t\tgapValue = ! gapValue ? '0.5em' : gapValue;\n\t\t} else if ( ! hasBlockGapSupport && fallbackGapValue ) {\n\t\t\tgapValue = fallbackGapValue;\n\t\t}\n\t}\n\n\tif ( gapValue && layoutDefinitions ) {\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, name, spacingStyles } ) => {\n\t\t\t\t// Allow outputting fallback gap styles for flex layout type when block gap support isn't available.\n\t\t\t\tif (\n\t\t\t\t\t! hasBlockGapSupport &&\n\t\t\t\t\t'flex' !== name &&\n\t\t\t\t\t'grid' !== name\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( spacingStyles?.length ) {\n\t\t\t\t\tspacingStyles.forEach( ( spacingStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( spacingStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( spacingStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${\n\t\t\t\t\t\t\t\t\t\t\tcssValue ? cssValue : gapValue\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}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tlet combinedSelector = '';\n\n\t\t\t\t\t\t\tif ( ! hasBlockGapSupport ) {\n\t\t\t\t\t\t\t\t// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`\n\t\t\t\t\t\t\t\t\t\t: `:where(${ selector }.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(${ selector } .${ className })${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`\n\t\t\t\t\t\t\t\t\t\t: `${ selector }-${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t// For backwards compatibility, ensure the legacy block gap CSS variable is still available.\n\t\tif ( selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport ) {\n\t\t\truleset += `${ selector } { --wp--style--block-gap: ${ gapValue }; }`;\n\t\t}\n\t}\n\n\t// Output base styles\n\tif ( selector === ROOT_BLOCK_SELECTOR && layoutDefinitions ) {\n\t\tconst validDisplayModes = [ 'block', 'flex', 'grid' ];\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, displayMode, baseStyles } ) => {\n\t\t\t\tif (\n\t\t\t\t\tdisplayMode &&\n\t\t\t\t\tvalidDisplayModes.includes( displayMode )\n\t\t\t\t) {\n\t\t\t\t\truleset += `${ selector } .${ className } { display:${ displayMode }; }`;\n\t\t\t\t}\n\n\t\t\t\tif ( baseStyles?.length ) {\n\t\t\t\t\tbaseStyles.forEach( ( baseStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( baseStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( baseStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${ cssValue }`\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);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst combinedSelector = `${ selector } .${ className }${\n\t\t\t\t\t\t\t\tbaseStyle?.selector || ''\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\treturn ruleset;\n}\n\nconst STYLE_KEYS = [\n\t'border',\n\t'color',\n\t'dimensions',\n\t'spacing',\n\t'typography',\n\t'filter',\n\t'outline',\n\t'shadow',\n];\n\nfunction pickStyleKeys( treeToPickFrom ) {\n\tif ( ! treeToPickFrom ) {\n\t\treturn {};\n\t}\n\tconst entries = Object.entries( treeToPickFrom );\n\tconst pickedEntries = entries.filter( ( [ key ] ) =>\n\t\tSTYLE_KEYS.includes( key )\n\t);\n\t// clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it\n\tconst clonedEntries = pickedEntries.map( ( [ key, style ] ) => [\n\t\tkey,\n\t\tJSON.parse( JSON.stringify( style ) ),\n\t] );\n\treturn Object.fromEntries( clonedEntries );\n}\n\nexport const getNodesWithStyles = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.styles ) {\n\t\treturn nodes;\n\t}\n\n\t// Top-level.\n\tconst styles = pickStyleKeys( tree.styles );\n\tif ( styles ) {\n\t\tnodes.push( {\n\t\t\tstyles,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\tObject.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {\n\t\tif ( tree.styles?.elements?.[ name ] ) {\n\t\t\tnodes.push( {\n\t\t\t\tstyles: tree.styles?.elements?.[ name ],\n\t\t\t\tselector,\n\t\t\t} );\n\t\t}\n\t} );\n\n\t// Iterate over blocks: they can have styles & elements.\n\tObject.entries( tree.styles?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockStyles = pickStyleKeys( node );\n\n\t\t\tif ( node?.variations ) {\n\t\t\t\tconst variations = {};\n\t\t\t\tObject.keys( node.variations ).forEach( ( variation ) => {\n\t\t\t\t\tvariations[ variation ] = pickStyleKeys(\n\t\t\t\t\t\tnode.variations[ variation ]\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\tblockStyles.variations = variations;\n\t\t\t}\n\t\t\tif ( blockStyles && blockSelectors?.[ blockName ]?.selector ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tduotoneSelector:\n\t\t\t\t\t\tblockSelectors[ blockName ].duotoneSelector,\n\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\tblockSelectors[ blockName ].fallbackGapValue,\n\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\tblockSelectors[ blockName ].hasLayoutSupport,\n\t\t\t\t\tselector: blockSelectors[ blockName ].selector,\n\t\t\t\t\tstyles: blockStyles,\n\t\t\t\t\tfeatureSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].featureSelectors,\n\t\t\t\t\tstyleVariationSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].styleVariationSelectors,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tObject.entries( node?.elements ?? {} ).forEach(\n\t\t\t\t( [ elementName, value ] ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tvalue &&\n\t\t\t\t\t\tblockSelectors?.[ blockName ] &&\n\t\t\t\t\t\tELEMENTS[ elementName ]\n\t\t\t\t\t) {\n\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\tstyles: value,\n\t\t\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel ) => {\n\t\t\t\t\t\t\t\t\tconst elementSelectors =\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ elementName ].split( ',' );\n\t\t\t\t\t\t\t\t\treturn elementSelectors.map(\n\t\t\t\t\t\t\t\t\t\t( elementSelector ) =>\n\t\t\t\t\t\t\t\t\t\t\tsel + ' ' + elementSelector\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\t.join( ',' ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const getNodesWithSettings = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.settings ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickPresets = ( treeToPickFrom ) => {\n\t\tlet presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = getValueFromObjectPath( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tpresets = setImmutably( presets, path, value );\n\t\t\t}\n\t\t} );\n\t\treturn presets;\n\t};\n\n\t// Top-level.\n\tconst presets = pickPresets( tree.settings );\n\tconst custom = tree.settings?.custom;\n\tif ( Object.keys( presets ).length > 0 || custom ) {\n\t\tnodes.push( {\n\t\t\tpresets,\n\t\t\tcustom,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\t// Blocks.\n\tObject.entries( tree.settings?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockPresets = pickPresets( node );\n\t\t\tconst blockCustom = node.custom;\n\t\t\tif ( Object.keys( blockPresets ).length > 0 || blockCustom ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tpresets: blockPresets,\n\t\t\t\t\tcustom: blockCustom,\n\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const toCustomProperties = ( tree, blockSelectors ) => {\n\tconst settings = getNodesWithSettings( tree, blockSelectors );\n\tlet ruleset = '';\n\tsettings.forEach( ( { presets, custom, selector } ) => {\n\t\tconst declarations = getPresetsDeclarations( presets, tree?.settings );\n\t\tconst customProps = flattenTree( custom, '--wp--custom--', '--' );\n\t\tif ( customProps.length > 0 ) {\n\t\t\tdeclarations.push( ...customProps );\n\t\t}\n\n\t\tif ( declarations.length > 0 ) {\n\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport const toStyles = (\n\ttree,\n\tblockSelectors,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tdisableLayoutStyles = false,\n\tisTemplate = true\n) => {\n\tconst nodesWithStyles = getNodesWithStyles( tree, blockSelectors );\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\tconst useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments;\n\tconst { contentSize, wideSize } = tree?.settings?.layout || {};\n\n\t/*\n\t * Reset default browser margin on the root body element.\n\t * This is set on the root selector **before** generating the ruleset\n\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t * `margin` in its `spacing` declaration for the `body` element then these\n\t * user-generated values take precedence in the CSS cascade.\n\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t */\n\tlet ruleset = 'body {margin: 0;';\n\n\tif ( contentSize ) {\n\t\truleset += ` --wp--style--global--content-size: ${ contentSize };`;\n\t}\n\n\tif ( wideSize ) {\n\t\truleset += ` --wp--style--global--wide-size: ${ wideSize };`;\n\t}\n\n\t// Root padding styles should only be output for full templates, not patterns or template parts.\n\tif ( useRootPaddingAlign && isTemplate ) {\n\t\t/*\n\t\t * These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508\n\t\t * almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors.\n\t\t */\n\t\truleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;`;\n\t}\n\n\truleset += '}';\n\n\tnodesWithStyles.forEach(\n\t\t( {\n\t\t\tselector,\n\t\t\tduotoneSelector,\n\t\t\tstyles,\n\t\t\tfallbackGapValue,\n\t\t\thasLayoutSupport,\n\t\t\tfeatureSelectors,\n\t\t\tstyleVariationSelectors,\n\t\t} ) => {\n\t\t\t// Process styles for block support features with custom feature level\n\t\t\t// CSS selectors set.\n\t\t\tif ( featureSelectors ) {\n\t\t\t\tconst featureDeclarations = getFeatureDeclarations(\n\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\tstyles\n\t\t\t\t);\n\n\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t( [ cssSelector, declarations ] ) => {\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst rules = declarations.join( ';' );\n\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( styleVariationSelectors ) {\n\t\t\t\tObject.entries( styleVariationSelectors ).forEach(\n\t\t\t\t\t( [ styleVariationName, styleVariationSelector ] ) => {\n\t\t\t\t\t\tconst styleVariations =\n\t\t\t\t\t\t\tstyles?.variations?.[ styleVariationName ];\n\t\t\t\t\t\tif ( styleVariations ) {\n\t\t\t\t\t\t\t// If the block uses any custom selectors for block support, add those first.\n\t\t\t\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\t\tgetFeatureDeclarations(\n\t\t\t\t\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\t\t\t\t\tstyleVariations\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t\t\t\t\t( [ baseSelector, declarations ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\t\t\t\tconst cssSelector =\n\t\t\t\t\t\t\t\t\t\t\t\tconcatFeatureVariationSelectorString(\n\t\t\t\t\t\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyleVariationSelector\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tconst rules =\n\t\t\t\t\t\t\t\t\t\t\t\tdeclarations.join( ';' );\n\t\t\t\t\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\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);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise add regular selectors.\n\t\t\t\t\t\t\tconst styleVariationDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations(\n\t\t\t\t\t\t\t\t\tstyleVariations,\n\t\t\t\t\t\t\t\t\tstyleVariationSelector,\n\t\t\t\t\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\t\t\t\t\ttree\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( styleVariationDeclarations.length ) {\n\t\t\t\t\t\t\t\truleset += `${ styleVariationSelector }{${ styleVariationDeclarations.join(\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Process duotone styles.\n\t\t\tif ( duotoneSelector ) {\n\t\t\t\tconst duotoneStyles = {};\n\t\t\t\tif ( styles?.filter ) {\n\t\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\t\tdelete styles.filter;\n\t\t\t\t}\n\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\tif ( duotoneDeclarations.length ) {\n\t\t\t\t\truleset += `${ duotoneSelector }{${ duotoneDeclarations.join(\n\t\t\t\t\t\t';'\n\t\t\t\t\t) };}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process blockGap and layout styles.\n\t\t\tif (\n\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t) {\n\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\tstyle: styles,\n\t\t\t\t\tselector,\n\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\tfallbackGapValue,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\tconst declarations = getStylesDeclarations(\n\t\t\t\tstyles,\n\t\t\t\tselector,\n\t\t\t\tuseRootPaddingAlign,\n\t\t\t\ttree,\n\t\t\t\tisTemplate\n\t\t\t);\n\t\t\tif ( declarations?.length ) {\n\t\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t\t}\n\n\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t);\n\n\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// `selector` maybe provided in a form\n\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t// string.\n\t\t\t\t\t\t// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;\n\t\t\t\t\t\t// Split and append pseudo selector to create\n\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t.map( ( sel ) => sel + pseudoKey )\n\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\tconst pseudoRule = `${ _selector }{${ pseudoDeclarations.join(\n\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t) };}`;\n\n\t\t\t\t\t\truleset += pseudoRule;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n\t/* Add alignment / layout styles */\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\n\tif ( hasBlockGapSupport ) {\n\t\t// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.\n\t\tconst gapValue =\n\t\t\tgetGapCSSValue( tree?.styles?.spacing?.blockGap ) || '0.5em';\n\t\truleset =\n\t\t\truleset +\n\t\t\t`:where(.wp-site-blocks) > * { margin-block-start: ${ gapValue }; margin-block-end: 0; }`;\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }';\n\t}\n\n\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\tif ( ROOT_BLOCK_SELECTOR === selector ) {\n\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\tselector = '';\n\t\t}\n\n\t\tconst classes = getPresetsClasses( selector, presets );\n\t\tif ( classes.length > 0 ) {\n\t\t\truleset += classes;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport function toSvgFilters( tree, blockSelectors ) {\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\treturn nodesWithSettings.flatMap( ( { presets } ) => {\n\t\treturn getPresetsSvgFilters( presets );\n\t} );\n}\n\nconst getSelectorsConfig = ( blockType, rootSelector ) => {\n\tif (\n\t\tblockType?.selectors &&\n\t\tObject.keys( blockType.selectors ).length > 0\n\t) {\n\t\treturn blockType.selectors;\n\t}\n\n\tconst config = { root: rootSelector };\n\tObject.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(\n\t\t( [ featureKey, featureName ] ) => {\n\t\t\tconst featureSelector = getBlockCSSSelector(\n\t\t\t\tblockType,\n\t\t\t\tfeatureKey\n\t\t\t);\n\n\t\t\tif ( featureSelector ) {\n\t\t\t\tconfig[ featureName ] = featureSelector;\n\t\t\t}\n\t\t}\n\t);\n\n\treturn config;\n};\n\nexport const getBlockSelectors = ( blockTypes, getBlockStyles ) => {\n\tconst result = {};\n\tblockTypes.forEach( ( blockType ) => {\n\t\tconst name = blockType.name;\n\t\tconst selector = getBlockCSSSelector( blockType );\n\t\tlet duotoneSelector = getBlockCSSSelector(\n\t\t\tblockType,\n\t\t\t'filter.duotone'\n\t\t);\n\n\t\t// Keep backwards compatibility for support.color.__experimentalDuotone.\n\t\tif ( ! duotoneSelector ) {\n\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tduotoneSelector =\n\t\t\t\tduotoneSupport && scopeSelector( rootSelector, duotoneSupport );\n\t\t}\n\n\t\tconst hasLayoutSupport =\n\t\t\t!! blockType?.supports?.layout ||\n\t\t\t!! blockType?.supports?.__experimentalLayout;\n\t\tconst fallbackGapValue =\n\t\t\tblockType?.supports?.spacing?.blockGap?.__experimentalDefault;\n\n\t\tconst blockStyleVariations = getBlockStyles( name );\n\t\tconst styleVariationSelectors = {};\n\t\tif ( blockStyleVariations?.length ) {\n\t\t\tblockStyleVariations.forEach( ( variation ) => {\n\t\t\t\tconst styleVariationSelector = `.is-style-${ variation.name }${ selector }`;\n\t\t\t\tstyleVariationSelectors[ variation.name ] =\n\t\t\t\t\tstyleVariationSelector;\n\t\t\t} );\n\t\t}\n\t\t// For each block support feature add any custom selectors.\n\t\tconst featureSelectors = getSelectorsConfig( blockType, selector );\n\n\t\tresult[ name ] = {\n\t\t\tduotoneSelector,\n\t\t\tfallbackGapValue,\n\t\t\tfeatureSelectors: Object.keys( featureSelectors ).length\n\t\t\t\t? featureSelectors\n\t\t\t\t: undefined,\n\t\t\thasLayoutSupport,\n\t\t\tname,\n\t\t\tselector,\n\t\t\tstyleVariationSelectors: Object.keys( styleVariationSelectors )\n\t\t\t\t.length\n\t\t\t\t? styleVariationSelectors\n\t\t\t\t: undefined,\n\t\t};\n\t} );\n\n\treturn result;\n};\n\n/**\n * If there is a separator block whose color is defined in theme.json via background,\n * update the separator color to the same value by using border color.\n *\n * @param {Object} config Theme.json configuration file object.\n * @return {Object} configTheme.json configuration file object updated.\n */\nfunction updateConfigWithSeparator( config ) {\n\tconst needsSeparatorStyleUpdate =\n\t\tconfig.styles?.blocks?.[ 'core/separator' ] &&\n\t\tconfig.styles?.blocks?.[ 'core/separator' ].color?.background &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].color?.text &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].border?.color;\n\tif ( needsSeparatorStyleUpdate ) {\n\t\treturn {\n\t\t\t...config,\n\t\t\tstyles: {\n\t\t\t\t...config.styles,\n\t\t\t\tblocks: {\n\t\t\t\t\t...config.styles.blocks,\n\t\t\t\t\t'core/separator': {\n\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ],\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ].color,\n\t\t\t\t\t\t\ttext: config.styles?.blocks[ 'core/separator' ]\n\t\t\t\t\t\t\t\t.color.background,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\treturn config;\n}\n\nexport function processCSSNesting( css, blockSelector ) {\n\tlet processedCSS = '';\n\n\t// Split CSS nested rules.\n\tconst parts = css.split( '&' );\n\tparts.forEach( ( part ) => {\n\t\tconst isRootCss = ! part.includes( '{' );\n\t\tif ( isRootCss ) {\n\t\t\t// If the part doesn't contain braces, it applies to the root level.\n\t\t\tprocessedCSS += `${ blockSelector }{${ part.trim() }}`;\n\t\t} else {\n\t\t\t// If the part contains braces, it's a nested CSS rule.\n\t\t\tconst splittedPart = part.replace( '}', '' ).split( '{' );\n\t\t\tif ( splittedPart.length !== 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst [ nestedSelector, cssValue ] = splittedPart;\n\t\t\tconst combinedSelector = nestedSelector.startsWith( ' ' )\n\t\t\t\t? scopeSelector( blockSelector, nestedSelector )\n\t\t\t\t: appendToSelector( blockSelector, nestedSelector );\n\n\t\t\tprocessedCSS += `${ combinedSelector }{${ cssValue.trim() }}`;\n\t\t}\n\t} );\n\treturn processedCSS;\n}\n\n/**\n * Returns the global styles output using a global styles configuration.\n * If wishing to generate global styles and settings based on the\n * global styles config loaded in the editor context, use `useGlobalStylesOutput()`.\n * The use case for a custom config is to generate bespoke styles\n * and settings for previews, or other out-of-editor experiences.\n *\n * @param {Object} mergedConfig Global styles configuration.\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig( mergedConfig = {} ) {\n\tconst [ blockGap ] = useGlobalSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGap !== null;\n\tconst hasFallbackGapSupport = ! hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support.\n\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn !! getSettings().disableLayoutStyles;\n\t} );\n\n\tconst blockContext = useContext( BlockContext );\n\n\tconst isTemplate = blockContext?.templateSlug !== undefined;\n\n\tconst getBlockStyles = useSelect( ( select ) => {\n\t\treturn select( blocksStore ).getBlockStyles;\n\t}, [] );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [];\n\t\t}\n\t\tmergedConfig = updateConfigWithSeparator( mergedConfig );\n\n\t\tconst blockSelectors = getBlockSelectors(\n\t\t\tgetBlockTypes(),\n\t\t\tgetBlockStyles\n\t\t);\n\n\t\tconst customProperties = toCustomProperties(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors\n\t\t);\n\t\tconst globalStyles = toStyles(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors,\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tisTemplate\n\t\t);\n\t\tconst svgs = toSvgFilters( mergedConfig, blockSelectors );\n\n\t\tconst styles = [\n\t\t\t{\n\t\t\t\tcss: customProperties,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tcss: globalStyles,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.\n\t\t\t{\n\t\t\t\tcss: mergedConfig.styles.css ?? '',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tassets: svgs,\n\t\t\t\t__unstableType: 'svg',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t];\n\n\t\t// Loop through the blocks to check if there are custom CSS values.\n\t\t// If there are, get the block selector and push the selector together with\n\t\t// the CSS value to the 'stylesheets' array.\n\t\tgetBlockTypes().forEach( ( blockType ) => {\n\t\t\tif ( mergedConfig.styles.blocks[ blockType.name ]?.css ) {\n\t\t\t\tconst selector = blockSelectors[ blockType.name ].selector;\n\t\t\t\tstyles.push( {\n\t\t\t\t\tcss: processCSSNesting(\n\t\t\t\t\t\tmergedConfig.styles.blocks[ blockType.name ]?.css,\n\t\t\t\t\t\tselector\n\t\t\t\t\t),\n\t\t\t\t\tisGlobalStyles: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn [ styles, mergedConfig.settings ];\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t] );\n}\n\n/**\n * Returns the global styles output based on the current state of global styles config loaded in the editor context.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput() {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn useGlobalStylesOutputWithConfig( mergedConfig );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,6BAA6B,IAAIC,cAAc,EAC/CC,uBAAuB,IAAIC,QAAQ,EACnCC,eAAe,EACfC,aAAa,EACbC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SACCC,eAAe,EACfC,mBAAmB,EACnBC,aAAa,EACbC,gBAAgB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B,GAAG,EAAEe,YAAY;MACjBE,cAAc,EAAE;IACjB,CAAC;IACD;IACA;MACCjB,GAAG,GAAAa,qBAAA,GAAEL,YAAY,CAAC7I,MAAM,CAACqI,GAAG,cAAAa,qBAAA,cAAAA,qBAAA,GAAI,EAAE;MAClCI,cAAc,EAAE;IACjB,CAAC,EACD;MACCC,MAAM,EAAEF,IAAI;MACZG,cAAc,EAAE,KAAK;MACrBF,cAAc,EAAE;IACjB,CAAC,CACD;;IAED;IACA;IACA;IACApP,aAAa,CAAC,CAAC,CAACqD,OAAO,CAAI0J,SAAS,IAAM;MACzC,IAAK4B,YAAY,CAAC7I,MAAM,CAACoE,MAAM,CAAE6C,SAAS,CAAC1F,IAAI,CAAE,EAAE8G,GAAG,EAAG;QACxD,MAAMjK,QAAQ,GAAG4F,cAAc,CAAEiD,SAAS,CAAC1F,IAAI,CAAE,CAACnD,QAAQ;QAC1D4B,MAAM,CAACtC,IAAI,CAAE;UACZ2K,GAAG,EAAED,iBAAiB,CACrBS,YAAY,CAAC7I,MAAM,CAACoE,MAAM,CAAE6C,SAAS,CAAC1F,IAAI,CAAE,EAAE8G,GAAG,EACjDjK,QACD,CAAC;UACDkL,cAAc,EAAE;QACjB,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAO,CAAEtJ,MAAM,EAAE6I,YAAY,CAAC7G,QAAQ,CAAE;EACzC,CAAC,EAAE,CACFI,kBAAkB,EAClBC,qBAAqB,EACrBwG,YAAY,EACZnD,mBAAmB,CAClB,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS+D,qBAAqBA,CAAA,EAAG;EACvC,MAAM;IAAEC,MAAM,EAAEb;EAAa,CAAC,GAAGvO,UAAU,CAAEY,mBAAoB,CAAC;EAClE,OAAO0N,+BAA+B,CAAEC,YAAa,CAAC;AACvD"}
@@ -1,8 +1,13 @@
1
1
  import { createElement, Fragment } from "react";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import classnames from 'classnames';
6
+
2
7
  /**
3
8
  * WordPress dependencies
4
9
  */
5
- import { useState, useEffect, useCallback } from '@wordpress/element';
10
+ import { Platform, useState, useEffect, useCallback } from '@wordpress/element';
6
11
  import { useDispatch, useSelect } from '@wordpress/data';
7
12
  import { getBlockSupport } from '@wordpress/blocks';
8
13
  import deprecated from '@wordpress/deprecated';
@@ -16,7 +21,7 @@ import { MarginVisualizer } from './margin';
16
21
  import { PaddingVisualizer } from './padding';
17
22
  import { store as blockEditorStore } from '../store';
18
23
  import { unlock } from '../lock-unlock';
19
- import { cleanEmptyObject } from './utils';
24
+ import { cleanEmptyObject, shouldSkipSerialization } from './utils';
20
25
  export const DIMENSIONS_SUPPORT_KEY = 'dimensions';
21
26
  export const SPACING_SUPPORT_KEY = 'spacing';
22
27
  export const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
@@ -95,6 +100,69 @@ export function DimensionsPanel({
95
100
  }));
96
101
  }
97
102
 
103
+ /**
104
+ * Determine whether there is block support for dimensions.
105
+ *
106
+ * @param {string} blockName Block name.
107
+ * @param {string} feature Background image feature to check for.
108
+ *
109
+ * @return {boolean} Whether there is support.
110
+ */
111
+ export function hasDimensionsSupport(blockName, feature = 'any') {
112
+ if (Platform.OS !== 'web') {
113
+ return false;
114
+ }
115
+ const support = getBlockSupport(blockName, DIMENSIONS_SUPPORT_KEY);
116
+ if (support === true) {
117
+ return true;
118
+ }
119
+ if (feature === 'any') {
120
+ return !!(support?.aspectRatio || !!support?.minHeight);
121
+ }
122
+ return !!support?.[feature];
123
+ }
124
+ export default {
125
+ useBlockProps,
126
+ attributeKeys: ['minHeight', 'style'],
127
+ hasSupport(name) {
128
+ return hasDimensionsSupport(name, 'aspectRatio');
129
+ }
130
+ };
131
+ function useBlockProps({
132
+ name,
133
+ minHeight,
134
+ style
135
+ }) {
136
+ if (!hasDimensionsSupport(name, 'aspectRatio') || shouldSkipSerialization(name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio')) {
137
+ return {};
138
+ }
139
+ const className = classnames({
140
+ 'has-aspect-ratio': !!style?.dimensions?.aspectRatio
141
+ });
142
+
143
+ // Allow dimensions-based inline style overrides to override any global styles rules that
144
+ // might be set for the block, and therefore affect the display of the aspect ratio.
145
+ const inlineStyleOverrides = {};
146
+
147
+ // Apply rules to unset incompatible styles.
148
+ // Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.
149
+ // This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio
150
+ // that is set should be intentional and should override any existing minHeight. The Cover block
151
+ // and dimensions controls have logic that will manually clear the aspect ratio if a minHeight
152
+ // is set.
153
+ if (style?.dimensions?.aspectRatio) {
154
+ // To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.
155
+ inlineStyleOverrides.minHeight = 'unset';
156
+ } else if (minHeight || style?.dimensions?.minHeight) {
157
+ // To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.
158
+ inlineStyleOverrides.aspectRatio = 'unset';
159
+ }
160
+ return {
161
+ className,
162
+ style: inlineStyleOverrides
163
+ };
164
+ }
165
+
98
166
  /**
99
167
  * @deprecated
100
168
  */
@@ -1 +1 @@
1
- {"version":3,"names":["useState","useEffect","useCallback","useDispatch","useSelect","getBlockSupport","deprecated","InspectorControls","DimensionsPanel","StylesDimensionsPanel","useHasDimensionsPanel","MarginVisualizer","PaddingVisualizer","store","blockEditorStore","unlock","cleanEmptyObject","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","hideBlockInterface","showBlockInterface","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","attributes","existingStyle","style","updatedStyle","createElement","group","clientId","name","setAttributes","settings","isEnabled","value","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","defaultDimensionsControls","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","forceShow","margin","useCustomSides","since","version"],"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer } from './margin';\nimport { PaddingVisualizer } from './padding';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nimport { cleanEmptyObject } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: updatedStyle,\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId )?.style,\n\t\t[ clientId ]\n\t);\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding && (\n\t\t\t\t<PaddingVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin && (\n\t\t\t\t<MarginVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\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A+B,CAC9B,CAAC;EACH,MAAMgC,eAAe,GAAG;IACvB,GAAGF,yBAAyB;IAC5B,GAAGC;EACJ,CAAC;EAED,OACCf,aAAA,CAAAiB,QAAA,QACCjB,aAAA,CAACzB,qBAAqB;IACrB2C,EAAE,EAAG1B,0BAA4B;IACjC2B,OAAO,EAAGjB,QAAU;IACpBG,QAAQ,EAAGA,QAAU;IACrBE,KAAK,EAAGA,KAAO;IACfK,QAAQ,EAAGA,QAAU;IACrBI,eAAe,EAAGA,eAAiB;IACnCI,WAAW,EAAGT;EAAuB,CACrC,CAAC,EACA,CAAC,CAAEN,QAAQ,EAAEgB,OAAO,EAAEC,OAAO,IAC9BtB,aAAA,CAACtB,iBAAiB;IACjB6C,SAAS,EAAGb,kBAAkB,KAAK,SAAW;IAC9CR,QAAQ,EAAGA,QAAU;IACrBK,KAAK,EAAGA;EAAO,CACf,CACD,EACC,CAAC,CAAEF,QAAQ,EAAEgB,OAAO,EAAEG,MAAM,IAC7BxB,aAAA,CAACvB,gBAAgB;IAChB8C,SAAS,EAAGb,kBAAkB,KAAK,QAAU;IAC7CR,QAAQ,EAAGA,QAAU;IACrBK,KAAK,EAAGA;EAAO,CACf,CAED,CAAC;AAEL;;AAEA;AACA;AACA;AACA,OAAO,SAASkB,cAAcA,CAAA,EAAG;EAChCrD,UAAU,CAAE,6CAA6C,EAAE;IAC1DsD,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["classnames","Platform","useState","useEffect","useCallback","useDispatch","useSelect","getBlockSupport","deprecated","InspectorControls","DimensionsPanel","StylesDimensionsPanel","useHasDimensionsPanel","MarginVisualizer","PaddingVisualizer","store","blockEditorStore","unlock","cleanEmptyObject","shouldSkipSerialization","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","hideBlockInterface","showBlockInterface","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","attributes","existingStyle","style","updatedStyle","createElement","group","clientId","name","setAttributes","settings","isEnabled","value","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","defaultDimensionsControls","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","forceShow","margin","hasDimensionsSupport","blockName","feature","OS","support","aspectRatio","minHeight","useBlockProps","attributeKeys","hasSupport","className","dimensions","inlineStyleOverrides","useCustomSides","since","version"],"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer } from './margin';\nimport { PaddingVisualizer } from './padding';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: updatedStyle,\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId )?.style,\n\t\t[ clientId ]\n\t);\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding && (\n\t\t\t\t<PaddingVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin && (\n\t\t\t\t<MarginVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determine whether there is block support for dimensions.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! ( support?.aspectRatio || !! support?.minHeight );\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'minHeight', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasDimensionsSupport( name, 'aspectRatio' );\n\t},\n};\n\nfunction useBlockProps( { name, minHeight, style } ) {\n\tif (\n\t\t! hasDimensionsSupport( name, 'aspectRatio' ) ||\n\t\tshouldSkipSerialization( name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst className = classnames( {\n\t\t'has-aspect-ratio': !! style?.dimensions?.aspectRatio,\n\t} );\n\n\t// Allow dimensions-based inline style overrides to override any global styles rules that\n\t// might be set for the block, and therefore affect the display of the aspect ratio.\n\tconst inlineStyleOverrides = {};\n\n\t// Apply rules to unset incompatible styles.\n\t// Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.\n\t// This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio\n\t// that is set should be intentional and should override any existing minHeight. The Cover block\n\t// and dimensions controls have logic that will manually clear the aspect ratio if a minHeight\n\t// is set.\n\tif ( style?.dimensions?.aspectRatio ) {\n\t\t// To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.\n\t\tinlineStyleOverrides.minHeight = 'unset';\n\t} else if ( minHeight || style?.dimensions?.minHeight ) {\n\t\t// To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.\n\t\tinlineStyleOverrides.aspectRatio = 'unset';\n\t}\n\n\treturn { className, style: inlineStyleOverrides };\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\n\t\tsince: '6.3',\n\t\tversion: '6.4',\n\t} );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAC/E,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SACCC,eAAe,IAAIC,qBAAqB,EACxCC,qBAAqB,QACf,6BAA6B;AACpC,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,iBAAiB,QAAQ,WAAW;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,gBAAgB,EAAEC,uBAAuB,QAAQ,SAAS;AAEnE,OAAO,MAAMC,sBAAsB,GAAG,YAAY;AAClD,OAAO,MAAMC,mBAAmB,GAAG,SAAS;AAC5C,OAAO,MAAMC,SAAS,GAAG,CAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAE;AAC7D,OAAO,MAAMC,WAAW,G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AACN,SAAS,GAAG,OAAO;EACzC,CAAC,MAAM,IAAKA,SAAS,IAAIjC,KAAK,EAAEsC,UAAU,EAAEL,SAAS,EAAG;IACvD;IACAM,oBAAoB,CAACP,WAAW,GAAG,OAAO;EAC3C;EAEA,OAAO;IAAEK,SAAS;IAAErC,KAAK,EAAEuC;EAAqB,CAAC;AAClD;;AAEA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAChCnE,UAAU,CAAE,6CAA6C,EAAE;IAC1DoE,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
@@ -12,6 +12,7 @@ import './generated-class-name';
12
12
  import style from './style';
13
13
  import './settings';
14
14
  import color from './color';
15
+ import dimensions from './dimensions';
15
16
  import duotone from './duotone';
16
17
  import fontFamily from './font-family';
17
18
  import fontSize from './font-size';
@@ -25,7 +26,7 @@ import blockHooks from './block-hooks';
25
26
  import blockRenaming from './block-renaming';
26
27
  import './use-bindings-attributes';
27
28
  createBlockEditFilter([align, anchor, customClassName, style, duotone, position, layout, contentLockUI, blockHooks, blockRenaming].filter(Boolean));
28
- createBlockListBlockFilter([align, style, color, duotone, fontFamily, fontSize, border, position, childLayout]);
29
+ createBlockListBlockFilter([align, style, color, dimensions, duotone, fontFamily, fontSize, border, position, childLayout]);
29
30
  createBlockSaveFilter([align, anchor, ariaLabel, customClassName, border, color, style, fontFamily, fontSize]);
30
31
  export { useCustomSides } from './dimensions';
31
32
  export { useLayoutClasses, useLayoutStyles } from './layout';
@@ -1 +1 @@
1
- {"version":3,"names":["createBlockEditFilter","createBlockListBlockFilter","createBlockSaveFilter","align","anchor","ariaLabel","customClassName","style","color","duotone","fontFamily","fontSize","border","position","layout","childLayout","contentLockUI","blockHooks","blockRenaming","filter","Boolean","useCustomSides","useLayoutClasses","useLayoutStyles","getBorderClassesAndStyles","useBorderProps","getShadowClassesAndStyles","useShadowProps","getColorClassesAndStyles","useColorProps","getSpacingClassesAndStyles","getTypographyClassesAndStyles","getGapCSSValue","useCachedTruthy"],"sources":["@wordpress/block-editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport './lock';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport border from './border';\nimport position from './position';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport contentLockUI from './content-lock-ui';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockRenaming from './block-renaming';\nimport './use-bindings-attributes';\n\ncreateBlockEditFilter(\n\t[\n\t\talign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tduotone,\n\t\tposition,\n\t\tlayout,\n\t\tcontentLockUI,\n\t\tblockHooks,\n\t\tblockRenaming,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\tstyle,\n\tcolor,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tborder,\n\tposition,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\n"],"mappings":"AAAA;AACA;AAC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AAEC,eAAe,QAAQ,UAAU;AAC5D,SAASC,yBAAyB,EAAEC,cAAc,QAAQ,oBAAoB;AAC9E,SAASC,yBAAyB,EAAEC,cAAc,QAAQ,oBAAoB;AAC9E,SAASC,wBAAwB,EAAEC,aAAa,QAAQ,mBAAmB;AAC3E,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,6BAA6B,QAAQ,wBAAwB;AACtE,SAASC,cAAc,QAAQ,OAAO;AACtC,SAASC,eAAe,QAAQ,qBAAqB"}
1
+ {"version":3,"names":["createBlockEditFilter","createBlockListBlockFilter","createBlockSaveFilter","align","anchor","ariaLabel","customClassName","style","color","dimensions","duotone","fontFamily","fontSize","border","position","layout","childLayout","contentLockUI","blockHooks","blockRenaming","filter","Boolean","useCustomSides","useLayoutClasses","useLayoutStyles","getBorderClassesAndStyles","useBorderProps","getShadowClassesAndStyles","useShadowProps","getColorClassesAndStyles","useColorProps","getSpacingClassesAndStyles","getTypographyClassesAndStyles","getGapCSSValue","useCachedTruthy"],"sources":["@wordpress/block-editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport './lock';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport dimensions from './dimensions';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport border from './border';\nimport position from './position';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport contentLockUI from './content-lock-ui';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockRenaming from './block-renaming';\nimport './use-bindings-attributes';\n\ncreateBlockEditFilter(\n\t[\n\t\talign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tduotone,\n\t\tposition,\n\t\tlayout,\n\t\tcontentLockUI,\n\t\tblockHooks,\n\t\tblockRenaming,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\tstyle,\n\tcolor,\n\tdimensions,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tborder,\n\tposition,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,qBAAqB,EACrBC,0BAA0B,EAC1BC,qBAAqB,QACf,SAAS;AAChB,OAAO,UAAU;AACjB,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAO,QAAQ;AACf,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAO,wBAAwB;AAC/B,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAO,YAAY;AACnB,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAO,YAAY;AACnB,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAO,2BAA2B;AAElCnB,qBAAqB,CACpB,CACCG,KAAK,EACLC,MAAM,EACNE,eAAe,EACfC,KAAK,EACLG,OAAO,EACPI,QAAQ,EACRC,MAAM,EACNE,aAAa,EACbC,UAAU,EACVC,aAAa,CACb,CAACC,MAAM,CAAEC,OAAQ,CACnB,CAAC;AACDpB,0BAA0B,CAAE,CAC3BE,KAAK,EACLI,KAAK,EACLC,KAAK,EACLC,UAAU,EACVC,OAAO,EACPC,UAAU,EACVC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRE,WAAW,CACV,CAAC;AACHd,qBAAqB,CAAE,CACtBC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,eAAe,EACfO,MAAM,EACNL,KAAK,EACLD,KAAK,EACLI,UAAU,EACVC,QAAQ,CACP,CAAC;AAEH,SAASU,cAAc,QAAQ,cAAc;AAC7C,SAASC,gBAAgB,EAAEC,eAAe,QAAQ,UAAU;AAC5D,SAASC,yBAAyB,EAAEC,cAAc,QAAQ,oBAAoB;AAC9E,SAASC,yBAAyB,EAAEC,cAAc,QAAQ,oBAAoB;AAC9E,SAASC,wBAAwB,EAAEC,aAAa,QAAQ,mBAAmB;AAC3E,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,6BAA6B,QAAQ,wBAAwB;AACtE,SAASC,cAAc,QAAQ,OAAO;AACtC,SAASC,eAAe,QAAQ,qBAAqB"}
@@ -93,10 +93,13 @@ const skipSerializationPathsEdit = {
93
93
  */
94
94
  const skipSerializationPathsSave = {
95
95
  ...skipSerializationPathsEdit,
96
+ [`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: [`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`],
97
+ // Skip serialization of aspect ratio in save mode.
96
98
  [`${BACKGROUND_SUPPORT_KEY}`]: [BACKGROUND_SUPPORT_KEY] // Skip serialization of background support in save mode.
97
99
  };
98
100
 
99
101
  const skipSerializationPathsSaveChecks = {
102
+ [`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: true,
100
103
  [`${BACKGROUND_SUPPORT_KEY}`]: true
101
104
  };
102
105