@wordpress/block-editor 13.0.1 → 13.1.0
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.
- package/CHANGELOG.md +2 -0
- package/build/components/block-actions/index.js +4 -6
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-draggable/index.js +1 -1
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-list/block.js +2 -2
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +2 -2
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/use-block-lock.js +2 -4
- package/build/components/block-lock/use-block-lock.js.map +1 -1
- package/build/components/block-mover/index.js +1 -1
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +1 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +1 -3
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +13 -6
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +6 -10
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +2 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/date-format-picker/index.js +18 -10
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +14 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/link-control/link-preview.js +12 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/list-view/block.js +7 -6
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +3 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/use-clipboard-handler.js +1 -1
- package/build/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -7
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/index.native.js +4 -0
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +6 -4
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +4 -4
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/use-block-commands/index.js +3 -3
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/hooks/block-bindings.js +19 -16
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/block-style-variation.js +2 -2
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +7 -2
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +3 -3
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +1 -36
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +17 -19
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-actions/index.js +4 -6
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +1 -1
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-list/block.js +2 -2
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +2 -2
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/use-block-lock.js +2 -4
- package/build-module/components/block-lock/use-block-lock.js.map +1 -1
- package/build-module/components/block-mover/index.js +1 -1
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +1 -1
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +1 -3
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +15 -8
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +7 -10
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +2 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +19 -11
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +14 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +14 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/list-view/block.js +7 -6
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +3 -1
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -7
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +4 -0
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +6 -4
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +4 -4
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +3 -3
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/hooks/block-bindings.js +20 -17
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +2 -2
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +7 -2
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +3 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +1 -35
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +17 -19
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +7 -15
- package/build-style/style.css +7 -15
- package/package.json +31 -31
- package/src/components/block-actions/index.js +3 -7
- package/src/components/block-draggable/index.js +1 -1
- package/src/components/block-list/block.js +2 -2
- package/src/components/block-list/block.native.js +2 -2
- package/src/components/block-list/use-in-between-inserter.js +3 -1
- package/src/components/block-lock/use-block-lock.js +2 -4
- package/src/components/block-mover/index.js +1 -1
- package/src/components/block-mover/index.native.js +1 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +1 -1
- package/src/components/block-switcher/block-variation-transformations.js +4 -9
- package/src/components/block-switcher/index.js +27 -12
- package/src/components/block-switcher/style.scss +5 -0
- package/src/components/block-toolbar/index.js +7 -9
- package/src/components/block-toolbar/style.scss +9 -6
- package/src/components/block-tools/block-selection-button.js +2 -2
- package/src/components/date-format-picker/index.js +25 -13
- package/src/components/global-styles/hooks.js +1 -4
- package/src/components/global-styles/use-global-styles-output.js +24 -4
- package/src/components/inserter/block-types-tab.native.js +2 -1
- package/src/components/link-control/link-preview.js +18 -1
- package/src/components/list-view/block.js +7 -7
- package/src/components/list-view/branch.js +5 -1
- package/src/components/list-view/use-clipboard-handler.js +1 -6
- package/src/components/provider/use-block-sync.js +0 -6
- package/src/components/rich-text/index.native.js +4 -0
- package/src/components/rich-text/native/index.native.js +3 -1
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +2 -9
- package/src/components/use-block-commands/index.js +3 -4
- package/src/hooks/block-bindings.js +28 -22
- package/src/hooks/block-style-variation.js +2 -2
- package/src/hooks/use-bindings-attributes.js +11 -1
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +3 -9
- package/src/store/private-actions.js +1 -34
- package/src/store/selectors.js +19 -26
- package/src/style.scss +0 -1
- package/build/components/block-bindings-toolbar-indicator/index.js +0 -106
- package/build/components/block-bindings-toolbar-indicator/index.js.map +0 -1
- package/build/store/undo-ignore.js +0 -11
- package/build/store/undo-ignore.js.map +0 -1
- package/build-module/components/block-bindings-toolbar-indicator/index.js +0 -99
- package/build-module/components/block-bindings-toolbar-indicator/index.js.map +0 -1
- package/build-module/store/undo-ignore.js +0 -5
- package/build-module/store/undo-ignore.js.map +0 -1
- package/src/components/block-bindings-toolbar-indicator/index.js +0 -137
- package/src/components/block-bindings-toolbar-indicator/style.scss +0 -12
- package/src/store/undo-ignore.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_element","_styleEngine","_components","_utils","_getBlockCssSelector","_typographyUtils","_context","_hooks","_utils2","_gap","_store","_definitions","_object","_lockUnlock","_themeFileUriUtils","BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS","__experimentalBorder","color","spacing","typography","kebabCase","unlock","componentsPrivateApis","compileStyleValue","uncompiledValue","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","startsWith","variable","slice","length","split","join","getPresetsDeclarations","blockPresets","mergedSettings","PRESET_METADATA","reduce","declarations","path","valueKey","valueFunc","cssVarInfix","presetByOrigin","getValueFromObjectPath","forEach","origin","value","push","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","getDuotoneFilter","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","disableRootPadding","isRoot","ROOT_BLOCK_SELECTOR","output","STYLE_PROPERTY","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","getCSSRules","rule","ruleValue","ref","refPath","getTypographyFontSizeValue","size","settings","getLayoutStyles","layoutDefinitions","LAYOUT_DEFINITIONS","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","getGapCSSValue","blockGap","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","ROOT_CSS_PROPERTIES_SELECTOR","validDisplayModes","displayMode","baseStyles","includes","baseStyle","STYLE_KEYS","pickStyleKeys","treeToPickFrom","pickedEntries","clonedEntries","JSON","parse","stringify","fromEntries","getNodesWithStyles","blockSelectors","_tree$styles$blocks","nodes","ELEMENTS","elements","blocks","blockName","node","_node$elements","variations","variationName","variation","_variation$elements","_variation$blocks","variationSelector","styleVariationSelectors","element","elementStyles","scopeSelector","variationBlockName","variationBlockStyles","_variationBlockStyles","variationBlockSelector","variationDuotoneSelector","duotoneSelector","variationFeatureSelectors","scopeFeatureSelectors","hasLayoutSupport","variationBlockElement","variationBlockElementStyles","elementName","sel","elementSelectors","elementSelector","exports","getNodesWithSettings","_tree$settings$blocks","pickPresets","presets","setImmutably","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","styleOptions","undefined","options","layoutStyles","marginReset","rootPadding","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","layout","hasBodyStyles","featureDeclarations","cssSelector","duotoneStyles","duotoneDeclarations","styleDeclarations","styleVariationName","styleVariations","baseSelector","styleVariationDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getSelectorsConfig","blockType","rootSelector","config","featureKey","featureName","getBlockCSSSelector","getBlockSelectors","blockTypes","getBlockStyles","variationInstanceId","duotoneSupport","getBlockSupport","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","variationSuffix","getBlockStyleVariationSelector","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processCSSNesting","css","processedCSS","parts","part","isRootCss","splittedPart","nestedSelector","appendToSelector","useGlobalStylesOutputWithConfig","mergedConfig","useGlobalSetting","setThemeFileUris","_links","useSelect","select","getSettings","blockEditorStore","blocksStore","useMemo","_updatedConfig$styles","updatedConfig","getBlockTypes","customProperties","globalStyles","svgs","isGlobalStyles","assets","__unstableType","useGlobalStylesOutput","merged","useContext","GlobalStylesContext"],"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\tROOT_CSS_PROPERTIES_SELECTOR,\n\tscopeSelector,\n\tscopeFeatureSelectors,\n\tappendToSelector,\n\tgetBlockStyleVariationSelector,\n} from './utils';\nimport { getBlockCSSSelector } from './get-block-css-selector';\nimport { getTypographyFontSizeValue } 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 { unlock } from '../../lock-unlock';\nimport { setThemeFileUris } from './theme-file-uri-utils';\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};\nconst { kebabCase } = unlock( componentsPrivateApis );\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\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\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\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} disableRootPadding Whether to force disable the root padding styles.\n * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {},\n\tdisableRootPadding = false\n) {\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 || disableRootPadding ) &&\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 = compileStyleValue(\n\t\t\t\tgetValueFromObjectPath( tree, refPath )\n\t\t\t);\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\ttree?.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? `.${ 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 += `${ ROOT_CSS_PROPERTIES_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 = `.${ 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\t'background',\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.entries( node.variations ).forEach(\n\t\t\t\t\t( [ variationName, variation ] ) => {\n\t\t\t\t\t\tvariations[ variationName ] =\n\t\t\t\t\t\t\tpickStyleKeys( variation );\n\n\t\t\t\t\t\tconst variationSelector =\n\t\t\t\t\t\t\tblockSelectors[ blockName ]\n\t\t\t\t\t\t\t\t.styleVariationSelectors?.[ variationName ];\n\n\t\t\t\t\t\t// Process the variation's inner element styles.\n\t\t\t\t\t\t// This comes before the inner block styles so the\n\t\t\t\t\t\t// element styles within the block type styles take\n\t\t\t\t\t\t// precedence over these.\n\t\t\t\t\t\tObject.entries( variation?.elements ?? {} ).forEach(\n\t\t\t\t\t\t\t( [ element, elementStyles ] ) => {\n\t\t\t\t\t\t\t\tif ( elementStyles && ELEMENTS[ element ] ) {\n\t\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\t\tstyles: elementStyles,\n\t\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\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\t// Process the variations inner block type styles.\n\t\t\t\t\t\tObject.entries( variation?.blocks ?? {} ).forEach(\n\t\t\t\t\t\t\t( [\n\t\t\t\t\t\t\t\tvariationBlockName,\n\t\t\t\t\t\t\t\tvariationBlockStyles,\n\t\t\t\t\t\t\t] ) => {\n\t\t\t\t\t\t\t\tconst variationBlockSelector = scopeSelector(\n\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t.selector\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst variationDuotoneSelector = scopeSelector(\n\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t.duotoneSelector\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst variationFeatureSelectors =\n\t\t\t\t\t\t\t\t\tscopeFeatureSelectors(\n\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t.featureSelectors\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\tselector: variationBlockSelector,\n\t\t\t\t\t\t\t\t\tduotoneSelector: variationDuotoneSelector,\n\t\t\t\t\t\t\t\t\tfeatureSelectors: variationFeatureSelectors,\n\t\t\t\t\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t.fallbackGapValue,\n\t\t\t\t\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t.hasLayoutSupport,\n\t\t\t\t\t\t\t\t\tstyles: pickStyleKeys(\n\t\t\t\t\t\t\t\t\t\tvariationBlockStyles\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t// Process element styles for the inner blocks\n\t\t\t\t\t\t\t\t// of the variation.\n\t\t\t\t\t\t\t\tObject.entries(\n\t\t\t\t\t\t\t\t\tvariationBlockStyles.elements ?? {}\n\t\t\t\t\t\t\t\t).forEach(\n\t\t\t\t\t\t\t\t\t( [\n\t\t\t\t\t\t\t\t\t\tvariationBlockElement,\n\t\t\t\t\t\t\t\t\t\tvariationBlockElementStyles,\n\t\t\t\t\t\t\t\t\t] ) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tvariationBlockElementStyles &&\n\t\t\t\t\t\t\t\t\t\t\tELEMENTS[ variationBlockElement ]\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tstyles: variationBlockElementStyles,\n\t\t\t\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\tELEMENTS[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockElement\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\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\tblockStyles.variations = variations;\n\t\t\t}\n\n\t\t\tif ( 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_CSS_PROPERTIES_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\tdisableRootPadding = false,\n\tstyleOptions = undefined\n) => {\n\t// These allow opting out of certain sets of styles.\n\tconst options = {\n\t\tblockGap: true,\n\t\tblockStyles: true,\n\t\tlayoutStyles: true,\n\t\tmarginReset: true,\n\t\tpresets: true,\n\t\trootPadding: true,\n\t\t...styleOptions,\n\t};\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\tconst hasBodyStyles =\n\t\toptions.marginReset || options.rootPadding || options.layoutStyles;\n\n\tlet ruleset = '';\n\n\tif ( options.presets && ( contentSize || wideSize ) ) {\n\t\truleset += `${ ROOT_CSS_PROPERTIES_SELECTOR } {`;\n\t\truleset = contentSize\n\t\t\t? ruleset + ` --wp--style--global--content-size: ${ contentSize };`\n\t\t\t: ruleset;\n\t\truleset = wideSize\n\t\t\t? ruleset + ` --wp--style--global--wide-size: ${ wideSize };`\n\t\t\t: ruleset;\n\t\truleset += '}';\n\t}\n\n\tif ( hasBodyStyles ) {\n\t\t/*\n\t\t * Reset default browser margin on the body element.\n\t\t * This is set on the body selector **before** generating the ruleset\n\t\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t\t * `margin` in its `spacing` declaration for the `body` element then these\n\t\t * user-generated values take precedence in the CSS cascade.\n\t\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t\t */\n\t\truleset += ':where(body) {margin: 0;';\n\n\t\t// Root padding styles should be output for full templates, patterns and template parts.\n\t\tif ( options.rootPadding && useRootPaddingAlign ) {\n\t\t\t/*\n\t\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\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\t */\n\t\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\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\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\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t`;\n\t\t}\n\n\t\truleset += '}';\n\t}\n\n\tif ( options.blockStyles ) {\n\t\tnodesWithStyles.forEach(\n\t\t\t( {\n\t\t\t\tselector,\n\t\t\t\tduotoneSelector,\n\t\t\t\tstyles,\n\t\t\t\tfallbackGapValue,\n\t\t\t\thasLayoutSupport,\n\t\t\t\tfeatureSelectors,\n\t\t\t\tstyleVariationSelectors,\n\t\t\t} ) => {\n\t\t\t\t// Process styles for block support features with custom feature level\n\t\t\t\t// CSS selectors set.\n\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\tconst featureDeclarations = getFeatureDeclarations(\n\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t);\n\n\t\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t\t( [ cssSelector, declarations ] ) => {\n\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\tconst rules = declarations.join( ';' );\n\t\t\t\t\t\t\t\truleset += `:root :where(${ cssSelector }){${ rules };}`;\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\n\t\t\t\t// Process duotone styles.\n\t\t\t\tif ( duotoneSelector ) {\n\t\t\t\t\tconst duotoneStyles = {};\n\t\t\t\t\tif ( styles?.filter ) {\n\t\t\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\t\t\tdelete styles.filter;\n\t\t\t\t\t}\n\t\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\t\tif ( duotoneDeclarations.length ) {\n\t\t\t\t\t\truleset += `${ duotoneSelector }{${ duotoneDeclarations.join(\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\n\t\t\t\t// Process blockGap and layout styles.\n\t\t\t\tif (\n\t\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t\t) {\n\t\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\t\tstyle: styles,\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\t\tfallbackGapValue,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\t\tconst styleDeclarations = getStylesDeclarations(\n\t\t\t\t\tstyles,\n\t\t\t\t\tselector,\n\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\ttree,\n\t\t\t\t\tdisableRootPadding\n\t\t\t\t);\n\t\t\t\tif ( styleDeclarations?.length ) {\n\t\t\t\t\truleset += `:root :where(${ selector }){${ styleDeclarations.join(\n\t\t\t\t\t\t';'\n\t\t\t\t\t) };}`;\n\t\t\t\t}\n\n\t\t\t\tif ( styleVariationSelectors ) {\n\t\t\t\t\tObject.entries( styleVariationSelectors ).forEach(\n\t\t\t\t\t\t( [ styleVariationName, styleVariationSelector ] ) => {\n\t\t\t\t\t\t\tconst styleVariations =\n\t\t\t\t\t\t\t\tstyles?.variations?.[ styleVariationName ];\n\t\t\t\t\t\t\tif ( styleVariations ) {\n\t\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\t\tif ( featureSelectors ) {\n\t\t\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\t\t\tgetFeatureDeclarations(\n\t\t\t\t\t\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\t\t\t\t\t\tstyleVariations\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tObject.entries(\n\t\t\t\t\t\t\t\t\t\tfeatureDeclarations\n\t\t\t\t\t\t\t\t\t).forEach(\n\t\t\t\t\t\t\t\t\t\t( [ baseSelector, declarations ] ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst cssSelector =\n\t\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\t\tbaseSelector,\n\t\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\t);\n\t\t\t\t\t\t\t\t\t\t\t\tconst rules =\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeclarations.join( ';' );\n\t\t\t\t\t\t\t\t\t\t\t\truleset += `:root :where(${ cssSelector }){${ rules };}`;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Otherwise add regular selectors.\n\t\t\t\t\t\t\t\tconst styleVariationDeclarations =\n\t\t\t\t\t\t\t\t\tgetStylesDeclarations(\n\t\t\t\t\t\t\t\t\t\tstyleVariations,\n\t\t\t\t\t\t\t\t\t\tstyleVariationSelector,\n\t\t\t\t\t\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\t\t\t\t\t\ttree\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif ( styleVariationDeclarations.length ) {\n\t\t\t\t\t\t\t\t\truleset += `:root :where(${ styleVariationSelector }){${ styleVariationDeclarations.join(\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\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t\t);\n\n\t\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// `selector` may be provided in a form\n\t\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t\t// string.\n\t\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\t// Split and append pseudo selector to create\n\t\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel ) => sel + pseudoKey )\n\t\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\t\tconst pseudoRule = `${ _selector }{${ pseudoDeclarations.join(\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\truleset += pseudoRule;\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\tif ( options.layoutStyles ) {\n\t\t/* Add alignment / layout styles */\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\t}\n\n\tif ( options.blockGap && 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`:root :where(.wp-site-blocks) > * { margin-block-start: ${ gapValue }; margin-block-end: 0; }`;\n\t\truleset =\n\t\t\truleset +\n\t\t\t':root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t':root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }';\n\t}\n\n\tif ( options.presets ) {\n\t\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\t\tif (\n\t\t\t\tROOT_BLOCK_SELECTOR === selector ||\n\t\t\t\tROOT_CSS_PROPERTIES_SELECTOR === selector\n\t\t\t) {\n\t\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\t\tselector = '';\n\t\t\t}\n\n\t\t\tconst classes = getPresetsClasses( selector, presets );\n\t\t\tif ( classes.length > 0 ) {\n\t\t\t\truleset += classes;\n\t\t\t}\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 = (\n\tblockTypes,\n\tgetBlockStyles,\n\tvariationInstanceId\n) => {\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\tblockStyleVariations?.forEach( ( variation ) => {\n\t\t\tconst variationSuffix = variationInstanceId\n\t\t\t\t? `-${ variationInstanceId }`\n\t\t\t\t: '';\n\t\t\tconst variationName = `${ variation.name }${ variationSuffix }`;\n\t\t\tconst styleVariationSelector = getBlockStyleVariationSelector(\n\t\t\t\tvariationName,\n\t\t\t\tselector\n\t\t\t);\n\n\t\t\tstyleVariationSelectors[ variationName ] = styleVariationSelector;\n\t\t} );\n\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: blockStyleVariations?.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 += `:root :where(${ 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 += `:root :where(${ 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 * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig(\n\tmergedConfig = {},\n\tdisableRootPadding\n) {\n\tconst [ blockGap ] = useGlobalSetting( 'spacing.blockGap' );\n\tmergedConfig = setThemeFileUris(\n\t\tmergedConfig,\n\t\tmergedConfig?._links?.[ 'wp:theme-file' ]\n\t);\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 { getBlockStyles } = useSelect( blocksStore );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst updatedConfig = 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\tupdatedConfig,\n\t\t\tblockSelectors\n\t\t);\n\n\t\tconst globalStyles = toStyles(\n\t\t\tupdatedConfig,\n\t\t\tblockSelectors,\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tdisableRootPadding\n\t\t);\n\t\tconst svgs = toSvgFilters( updatedConfig, 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: updatedConfig.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 ( updatedConfig.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\tupdatedConfig.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, updatedConfig.settings ];\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t\tdisableRootPadding,\n\t\tgetBlockStyles,\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 * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput( disableRootPadding = false ) {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn useGlobalStylesOutputWithConfig( mergedConfig, disableRootPadding );\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AASA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,YAAA,GAAAb,OAAA;AACA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AACA,IAAAgB,kBAAA,GAAAhB,OAAA;AArCA;AACA;AACA;;AAaA;AACA;AACA;;AAsBA;AACA;AACA,MAAMiB,qCAAqC,GAAG;EAC7CC,oBAAoB,EAAE,QAAQ;EAC9BC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE;AACb,CAAC;AACD,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;A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EF,IAAI;MACZG,cAAc,EAAE,KAAK;MACrBF,cAAc,EAAE;IACjB,CAAC,CACD;;IAED;IACA;IACA;IACA,IAAAJ,qBAAa,EAAC,CAAC,CAAC1O,OAAO,CAAI6L,SAAS,IAAM;MACzC,IAAK4C,aAAa,CAAC/L,MAAM,CAAC4E,MAAM,CAAEuE,SAAS,CAAC1H,IAAI,CAAE,EAAEkJ,GAAG,EAAG;QACzD,MAAMxM,QAAQ,GAAGoG,cAAc,CAAE4E,SAAS,CAAC1H,IAAI,CAAE,CAACtD,QAAQ;QAC1D6B,MAAM,CAACvC,IAAI,CAAE;UACZkN,GAAG,EAAED,iBAAiB,CACrBqB,aAAa,CAAC/L,MAAM,CAAC4E,MAAM,CAAEuE,SAAS,CAAC1H,IAAI,CAAE,EAAEkJ,GAAG,EAClDxM,QACD,CAAC;UACDiO,cAAc,EAAE;QACjB,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAO,CAAEpM,MAAM,EAAE+L,aAAa,CAAC3J,QAAQ,CAAE;EAC1C,CAAC,EAAE,CACFK,kBAAkB,EAClBC,qBAAqB,EACrB0I,YAAY,EACZhE,mBAAmB,EACnBtG,kBAAkB,EAClB6I,cAAc,CACb,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS4C,qBAAqBA,CAAEzL,kBAAkB,GAAG,KAAK,EAAG;EACnE,MAAM;IAAE0L,MAAM,EAAEpB;EAAa,CAAC,GAAG,IAAAqB,mBAAU,EAAEC,4BAAoB,CAAC;EAClE,OAAOvB,+BAA+B,CAAEC,YAAY,EAAEtK,kBAAmB,CAAC;AAC3E","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_element","_styleEngine","_components","_utils","_getBlockCssSelector","_typographyUtils","_context","_hooks","_utils2","_gap","_store","_definitions","_object","_lockUnlock","_themeFileUriUtils","BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS","__experimentalBorder","color","spacing","typography","kebabCase","unlock","componentsPrivateApis","compileStyleValue","uncompiledValue","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","startsWith","variable","slice","length","split","join","getPresetsDeclarations","blockPresets","mergedSettings","PRESET_METADATA","reduce","declarations","path","valueKey","valueFunc","cssVarInfix","presetByOrigin","getValueFromObjectPath","forEach","origin","value","push","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","getDuotoneFilter","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","disableRootPadding","isRoot","ROOT_BLOCK_SELECTOR","output","STYLE_PROPERTY","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","getCSSRules","rule","ruleValue","ref","refPath","getTypographyFontSizeValue","size","settings","getLayoutStyles","layoutDefinitions","LAYOUT_DEFINITIONS","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","getGapCSSValue","blockGap","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","ROOT_CSS_PROPERTIES_SELECTOR","validDisplayModes","displayMode","baseStyles","includes","baseStyle","STYLE_KEYS","pickStyleKeys","treeToPickFrom","pickedEntries","clonedEntries","JSON","parse","stringify","fromEntries","getNodesWithStyles","blockSelectors","_tree$styles$blocks","nodes","ELEMENTS","elements","blocks","blockName","node","_node$elements","variations","variationName","variation","_variation$elements","_variation$blocks","css","variationSelector","styleVariationSelectors","element","elementStyles","scopeSelector","variationBlockName","variationBlockStyles","_variationBlockStyles","variationBlockSelector","variationDuotoneSelector","duotoneSelector","variationFeatureSelectors","scopeFeatureSelectors","variationBlockStyleNodes","hasLayoutSupport","variationBlockElement","variationBlockElementStyles","elementName","sel","elementSelectors","elementSelector","exports","getNodesWithSettings","_tree$settings$blocks","pickPresets","presets","setImmutably","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","styleOptions","undefined","options","layoutStyles","marginReset","rootPadding","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","layout","hasBodyStyles","featureDeclarations","cssSelector","duotoneStyles","duotoneDeclarations","styleDeclarations","processCSSNesting","styleVariationName","styleVariations","baseSelector","styleVariationDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getSelectorsConfig","blockType","rootSelector","config","featureKey","featureName","getBlockCSSSelector","getBlockSelectors","blockTypes","getBlockStyles","variationInstanceId","duotoneSupport","getBlockSupport","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","variationSuffix","getBlockStyleVariationSelector","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processedCSS","parts","part","isRootCss","splittedPart","nestedSelector","appendToSelector","useGlobalStylesOutputWithConfig","mergedConfig","useGlobalSetting","setThemeFileUris","_links","useSelect","select","getSettings","blockEditorStore","blocksStore","useMemo","_updatedConfig$styles","updatedConfig","getBlockTypes","customProperties","globalStyles","svgs","isGlobalStyles","assets","__unstableType","useGlobalStylesOutput","merged","useContext","GlobalStylesContext"],"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\tROOT_CSS_PROPERTIES_SELECTOR,\n\tscopeSelector,\n\tscopeFeatureSelectors,\n\tappendToSelector,\n\tgetBlockStyleVariationSelector,\n} from './utils';\nimport { getBlockCSSSelector } from './get-block-css-selector';\nimport { getTypographyFontSizeValue } 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 { unlock } from '../../lock-unlock';\nimport { setThemeFileUris } from './theme-file-uri-utils';\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};\nconst { kebabCase } = unlock( componentsPrivateApis );\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\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\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\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} disableRootPadding Whether to force disable the root padding styles.\n * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {},\n\tdisableRootPadding = false\n) {\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 || disableRootPadding ) &&\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 = compileStyleValue(\n\t\t\t\tgetValueFromObjectPath( tree, refPath )\n\t\t\t);\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\ttree?.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? `.${ 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 += `${ ROOT_CSS_PROPERTIES_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 = `.${ 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\t'background',\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.entries( node.variations ).forEach(\n\t\t\t\t\t( [ variationName, variation ] ) => {\n\t\t\t\t\t\tvariations[ variationName ] =\n\t\t\t\t\t\t\tpickStyleKeys( variation );\n\t\t\t\t\t\tif ( variation?.css ) {\n\t\t\t\t\t\t\tvariations[ variationName ].css = variation.css;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst variationSelector =\n\t\t\t\t\t\t\tblockSelectors[ blockName ]\n\t\t\t\t\t\t\t\t.styleVariationSelectors?.[ variationName ];\n\n\t\t\t\t\t\t// Process the variation's inner element styles.\n\t\t\t\t\t\t// This comes before the inner block styles so the\n\t\t\t\t\t\t// element styles within the block type styles take\n\t\t\t\t\t\t// precedence over these.\n\t\t\t\t\t\tObject.entries( variation?.elements ?? {} ).forEach(\n\t\t\t\t\t\t\t( [ element, elementStyles ] ) => {\n\t\t\t\t\t\t\t\tif ( elementStyles && ELEMENTS[ element ] ) {\n\t\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\t\tstyles: elementStyles,\n\t\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\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\t// Process the variations inner block type styles.\n\t\t\t\t\t\tObject.entries( variation?.blocks ?? {} ).forEach(\n\t\t\t\t\t\t\t( [\n\t\t\t\t\t\t\t\tvariationBlockName,\n\t\t\t\t\t\t\t\tvariationBlockStyles,\n\t\t\t\t\t\t\t] ) => {\n\t\t\t\t\t\t\t\tconst variationBlockSelector = scopeSelector(\n\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t.selector\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst variationDuotoneSelector = scopeSelector(\n\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t.duotoneSelector\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst variationFeatureSelectors =\n\t\t\t\t\t\t\t\t\tscopeFeatureSelectors(\n\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t.featureSelectors\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tconst variationBlockStyleNodes =\n\t\t\t\t\t\t\t\t\tpickStyleKeys( variationBlockStyles );\n\n\t\t\t\t\t\t\t\tif ( variationBlockStyles?.css ) {\n\t\t\t\t\t\t\t\t\tvariationBlockStyleNodes.css =\n\t\t\t\t\t\t\t\t\t\tvariationBlockStyles.css;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\tselector: variationBlockSelector,\n\t\t\t\t\t\t\t\t\tduotoneSelector: variationDuotoneSelector,\n\t\t\t\t\t\t\t\t\tfeatureSelectors: variationFeatureSelectors,\n\t\t\t\t\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t.fallbackGapValue,\n\t\t\t\t\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t.hasLayoutSupport,\n\t\t\t\t\t\t\t\t\tstyles: variationBlockStyleNodes,\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t// Process element styles for the inner blocks\n\t\t\t\t\t\t\t\t// of the variation.\n\t\t\t\t\t\t\t\tObject.entries(\n\t\t\t\t\t\t\t\t\tvariationBlockStyles.elements ?? {}\n\t\t\t\t\t\t\t\t).forEach(\n\t\t\t\t\t\t\t\t\t( [\n\t\t\t\t\t\t\t\t\t\tvariationBlockElement,\n\t\t\t\t\t\t\t\t\t\tvariationBlockElementStyles,\n\t\t\t\t\t\t\t\t\t] ) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tvariationBlockElementStyles &&\n\t\t\t\t\t\t\t\t\t\t\tELEMENTS[ variationBlockElement ]\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tstyles: variationBlockElementStyles,\n\t\t\t\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\tELEMENTS[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockElement\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\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\tblockStyles.variations = variations;\n\t\t\t}\n\n\t\t\tif ( 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_CSS_PROPERTIES_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\tdisableRootPadding = false,\n\tstyleOptions = undefined\n) => {\n\t// These allow opting out of certain sets of styles.\n\tconst options = {\n\t\tblockGap: true,\n\t\tblockStyles: true,\n\t\tlayoutStyles: true,\n\t\tmarginReset: true,\n\t\tpresets: true,\n\t\trootPadding: true,\n\t\t...styleOptions,\n\t};\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\tconst hasBodyStyles =\n\t\toptions.marginReset || options.rootPadding || options.layoutStyles;\n\n\tlet ruleset = '';\n\n\tif ( options.presets && ( contentSize || wideSize ) ) {\n\t\truleset += `${ ROOT_CSS_PROPERTIES_SELECTOR } {`;\n\t\truleset = contentSize\n\t\t\t? ruleset + ` --wp--style--global--content-size: ${ contentSize };`\n\t\t\t: ruleset;\n\t\truleset = wideSize\n\t\t\t? ruleset + ` --wp--style--global--wide-size: ${ wideSize };`\n\t\t\t: ruleset;\n\t\truleset += '}';\n\t}\n\n\tif ( hasBodyStyles ) {\n\t\t/*\n\t\t * Reset default browser margin on the body element.\n\t\t * This is set on the body selector **before** generating the ruleset\n\t\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t\t * `margin` in its `spacing` declaration for the `body` element then these\n\t\t * user-generated values take precedence in the CSS cascade.\n\t\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t\t */\n\t\truleset += ':where(body) {margin: 0;';\n\n\t\t// Root padding styles should be output for full templates, patterns and template parts.\n\t\tif ( options.rootPadding && useRootPaddingAlign ) {\n\t\t\t/*\n\t\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\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\t */\n\t\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\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\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\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t`;\n\t\t}\n\n\t\truleset += '}';\n\t}\n\n\tif ( options.blockStyles ) {\n\t\tnodesWithStyles.forEach(\n\t\t\t( {\n\t\t\t\tselector,\n\t\t\t\tduotoneSelector,\n\t\t\t\tstyles,\n\t\t\t\tfallbackGapValue,\n\t\t\t\thasLayoutSupport,\n\t\t\t\tfeatureSelectors,\n\t\t\t\tstyleVariationSelectors,\n\t\t\t} ) => {\n\t\t\t\t// Process styles for block support features with custom feature level\n\t\t\t\t// CSS selectors set.\n\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\tconst featureDeclarations = getFeatureDeclarations(\n\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t);\n\n\t\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t\t( [ cssSelector, declarations ] ) => {\n\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\tconst rules = declarations.join( ';' );\n\t\t\t\t\t\t\t\truleset += `:root :where(${ cssSelector }){${ rules };}`;\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\n\t\t\t\t// Process duotone styles.\n\t\t\t\tif ( duotoneSelector ) {\n\t\t\t\t\tconst duotoneStyles = {};\n\t\t\t\t\tif ( styles?.filter ) {\n\t\t\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\t\t\tdelete styles.filter;\n\t\t\t\t\t}\n\t\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\t\tif ( duotoneDeclarations.length ) {\n\t\t\t\t\t\truleset += `${ duotoneSelector }{${ duotoneDeclarations.join(\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\n\t\t\t\t// Process blockGap and layout styles.\n\t\t\t\tif (\n\t\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t\t) {\n\t\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\t\tstyle: styles,\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\t\tfallbackGapValue,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\t\tconst styleDeclarations = getStylesDeclarations(\n\t\t\t\t\tstyles,\n\t\t\t\t\tselector,\n\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\ttree,\n\t\t\t\t\tdisableRootPadding\n\t\t\t\t);\n\t\t\t\tif ( styleDeclarations?.length ) {\n\t\t\t\t\truleset += `:root :where(${ selector }){${ styleDeclarations.join(\n\t\t\t\t\t\t';'\n\t\t\t\t\t) };}`;\n\t\t\t\t}\n\t\t\t\tif ( styles?.css ) {\n\t\t\t\t\truleset += processCSSNesting(\n\t\t\t\t\t\tstyles.css,\n\t\t\t\t\t\t`:root :where(${ selector })`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( styleVariationSelectors ) {\n\t\t\t\t\tObject.entries( styleVariationSelectors ).forEach(\n\t\t\t\t\t\t( [ styleVariationName, styleVariationSelector ] ) => {\n\t\t\t\t\t\t\tconst styleVariations =\n\t\t\t\t\t\t\t\tstyles?.variations?.[ styleVariationName ];\n\t\t\t\t\t\t\tif ( styleVariations ) {\n\t\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\t\tif ( featureSelectors ) {\n\t\t\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\t\t\tgetFeatureDeclarations(\n\t\t\t\t\t\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\t\t\t\t\t\tstyleVariations\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tObject.entries(\n\t\t\t\t\t\t\t\t\t\tfeatureDeclarations\n\t\t\t\t\t\t\t\t\t).forEach(\n\t\t\t\t\t\t\t\t\t\t( [ baseSelector, declarations ] ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst cssSelector =\n\t\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\t\tbaseSelector,\n\t\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\t);\n\t\t\t\t\t\t\t\t\t\t\t\tconst rules =\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeclarations.join( ';' );\n\t\t\t\t\t\t\t\t\t\t\t\truleset += `:root :where(${ cssSelector }){${ rules };}`;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Otherwise add regular selectors.\n\t\t\t\t\t\t\t\tconst styleVariationDeclarations =\n\t\t\t\t\t\t\t\t\tgetStylesDeclarations(\n\t\t\t\t\t\t\t\t\t\tstyleVariations,\n\t\t\t\t\t\t\t\t\t\tstyleVariationSelector,\n\t\t\t\t\t\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\t\t\t\t\t\ttree\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif ( styleVariationDeclarations.length ) {\n\t\t\t\t\t\t\t\t\truleset += `:root :where(${ styleVariationSelector }){${ styleVariationDeclarations.join(\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\tif ( styleVariations?.css ) {\n\t\t\t\t\t\t\t\t\truleset += processCSSNesting(\n\t\t\t\t\t\t\t\t\t\tstyleVariations.css,\n\t\t\t\t\t\t\t\t\t\t`:root :where(${ styleVariationSelector })`\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\n\t\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t\t);\n\n\t\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// `selector` may be provided in a form\n\t\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t\t// string.\n\t\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\t// Split and append pseudo selector to create\n\t\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel ) => sel + pseudoKey )\n\t\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\t\tconst pseudoRule = `${ _selector }{${ pseudoDeclarations.join(\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\truleset += pseudoRule;\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\tif ( options.layoutStyles ) {\n\t\t/* Add alignment / layout styles */\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\t}\n\n\tif ( options.blockGap && 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`:root :where(.wp-site-blocks) > * { margin-block-start: ${ gapValue }; margin-block-end: 0; }`;\n\t\truleset =\n\t\t\truleset +\n\t\t\t':root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t':root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }';\n\t}\n\n\tif ( options.presets ) {\n\t\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\t\tif (\n\t\t\t\tROOT_BLOCK_SELECTOR === selector ||\n\t\t\t\tROOT_CSS_PROPERTIES_SELECTOR === selector\n\t\t\t) {\n\t\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\t\tselector = '';\n\t\t\t}\n\n\t\t\tconst classes = getPresetsClasses( selector, presets );\n\t\t\tif ( classes.length > 0 ) {\n\t\t\t\truleset += classes;\n\t\t\t}\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 = (\n\tblockTypes,\n\tgetBlockStyles,\n\tvariationInstanceId\n) => {\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\tblockStyleVariations?.forEach( ( variation ) => {\n\t\t\tconst variationSuffix = variationInstanceId\n\t\t\t\t? `-${ variationInstanceId }`\n\t\t\t\t: '';\n\t\t\tconst variationName = `${ variation.name }${ variationSuffix }`;\n\t\t\tconst styleVariationSelector = getBlockStyleVariationSelector(\n\t\t\t\tvariationName,\n\t\t\t\tselector\n\t\t\t);\n\n\t\t\tstyleVariationSelectors[ variationName ] = styleVariationSelector;\n\t\t} );\n\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: blockStyleVariations?.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 += `:root :where(${ 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 += `:root :where(${ 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 * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig(\n\tmergedConfig = {},\n\tdisableRootPadding\n) {\n\tconst [ blockGap ] = useGlobalSetting( 'spacing.blockGap' );\n\tmergedConfig = setThemeFileUris(\n\t\tmergedConfig,\n\t\tmergedConfig?._links?.[ 'wp:theme-file' ]\n\t);\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 { getBlockStyles } = useSelect( blocksStore );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst updatedConfig = 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\tupdatedConfig,\n\t\t\tblockSelectors\n\t\t);\n\n\t\tconst globalStyles = toStyles(\n\t\t\tupdatedConfig,\n\t\t\tblockSelectors,\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tdisableRootPadding\n\t\t);\n\t\tconst svgs = toSvgFilters( updatedConfig, 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: updatedConfig.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 ( updatedConfig.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\tupdatedConfig.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, updatedConfig.settings ];\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t\tdisableRootPadding,\n\t\tgetBlockStyles,\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 * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput( disableRootPadding = false ) {\n\tconst { merged: mergedConf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ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ function BlockTypesTab({
|
|
|
27
27
|
rootClientId,
|
|
28
28
|
listProps
|
|
29
29
|
}) {
|
|
30
|
-
const [rawBlockTypes,, collections] = (0, _useBlockTypesState.default)(rootClientId, onSelect);
|
|
30
|
+
const [rawBlockTypes,, collections] = (0, _useBlockTypesState.default)(rootClientId, onSelect, true);
|
|
31
31
|
const clipboardBlock = (0, _useClipboardBlock.default)(rootClientId);
|
|
32
32
|
const filteredBlockTypes = (0, _utils.filterInserterItems)(rawBlockTypes);
|
|
33
33
|
const blockTypes = clipboardBlock ? [clipboardBlock, ...filteredBlockTypes] : filteredBlockTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_blockTypesList","_interopRequireDefault","_useClipboardBlock","_useBlockTypeImpressions","_utils","_useBlockTypesState","_jsxRuntime","getBlockNamespace","item","name","split","BlockTypesTab","onSelect","rootClientId","listProps","rawBlockTypes","collections","useBlockTypesState","clipboardBlock","useClipboardBlock","filteredBlockTypes","filterInserterItems","blockTypes","items","trackBlockTypeSelected","useBlockTypeImpressions","handleSelect","args","collectionSections","useMemo","result","Object","keys","forEach","namespace","data","filter","length","push","createInserterSection","key","metadata","icon","title","sections","jsx","default","label","__","_default","exports"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport useClipboardBlock from './hooks/use-clipboard-block';\nimport useBlockTypeImpressions from './hooks/use-block-type-impressions';\nimport { createInserterSection, filterInserterItems } from './utils';\nimport useBlockTypesState from './hooks/use-block-types-state';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nfunction BlockTypesTab( { onSelect, rootClientId, listProps } ) {\n\tconst [ rawBlockTypes, , collections ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonSelect\n\t);\n\tconst clipboardBlock = useClipboardBlock( rootClientId );\n\tconst filteredBlockTypes = filterInserterItems( rawBlockTypes );\n\tconst blockTypes = clipboardBlock\n\t\t? [ clipboardBlock, ...filteredBlockTypes ]\n\t\t: filteredBlockTypes;\n\tconst { items, trackBlockTypeSelected } =\n\t\tuseBlockTypeImpressions( blockTypes );\n\n\tconst handleSelect = ( ...args ) => {\n\t\ttrackBlockTypeSelected( ...args );\n\t\tonSelect( ...args );\n\t};\n\n\tconst collectionSections = useMemo( () => {\n\t\tconst result = [];\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tconst data = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( data.length > 0 ) {\n\t\t\t\tresult.push(\n\t\t\t\t\tcreateInserterSection( {\n\t\t\t\t\t\tkey: `collection-${ namespace }`,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\ticon: collections[ namespace ].icon,\n\t\t\t\t\t\t\ttitle: collections[ namespace ].title,\n\t\t\t\t\t\t},\n\t\t\t\t\t\titems: data,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\tconst sections = [\n\t\tcreateInserterSection( { key: 'default', items } ),\n\t\t...collectionSections,\n\t];\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"Blocks\"\n\t\t\tsections={ sections }\n\t\t\tonSelect={ handleSelect }\n\t\t\tlistProps={ listProps }\n\t\t\tlabel={ __( 'Blocks menu' ) }\n\t\t/>\n\t);\n}\n\nexport default BlockTypesTab;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,wBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAA+D,IAAAQ,WAAA,GAAAR,OAAA;AAb/D;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAMS,iBAAiB,GAAKC,IAAI,IAAMA,IAAI,CAACC,IAAI,CAACC,KAAK,CAAE,GAAI,CAAC,CAAE,CAAC,CAAE;AAEjE,SAASC,aAAaA,CAAE;EAAEC,QAAQ;EAAEC,YAAY;EAAEC;AAAU,CAAC,EAAG;EAC/D,MAAM,CAAEC,aAAa,GAAIC,WAAW,CAAE,GAAG,IAAAC,2BAAkB,EAC1DJ,YAAY,EACZD,
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_blockTypesList","_interopRequireDefault","_useClipboardBlock","_useBlockTypeImpressions","_utils","_useBlockTypesState","_jsxRuntime","getBlockNamespace","item","name","split","BlockTypesTab","onSelect","rootClientId","listProps","rawBlockTypes","collections","useBlockTypesState","clipboardBlock","useClipboardBlock","filteredBlockTypes","filterInserterItems","blockTypes","items","trackBlockTypeSelected","useBlockTypeImpressions","handleSelect","args","collectionSections","useMemo","result","Object","keys","forEach","namespace","data","filter","length","push","createInserterSection","key","metadata","icon","title","sections","jsx","default","label","__","_default","exports"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport useClipboardBlock from './hooks/use-clipboard-block';\nimport useBlockTypeImpressions from './hooks/use-block-type-impressions';\nimport { createInserterSection, filterInserterItems } from './utils';\nimport useBlockTypesState from './hooks/use-block-types-state';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nfunction BlockTypesTab( { onSelect, rootClientId, listProps } ) {\n\tconst [ rawBlockTypes, , collections ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonSelect,\n\t\ttrue\n\t);\n\tconst clipboardBlock = useClipboardBlock( rootClientId );\n\tconst filteredBlockTypes = filterInserterItems( rawBlockTypes );\n\tconst blockTypes = clipboardBlock\n\t\t? [ clipboardBlock, ...filteredBlockTypes ]\n\t\t: filteredBlockTypes;\n\tconst { items, trackBlockTypeSelected } =\n\t\tuseBlockTypeImpressions( blockTypes );\n\n\tconst handleSelect = ( ...args ) => {\n\t\ttrackBlockTypeSelected( ...args );\n\t\tonSelect( ...args );\n\t};\n\n\tconst collectionSections = useMemo( () => {\n\t\tconst result = [];\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tconst data = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( data.length > 0 ) {\n\t\t\t\tresult.push(\n\t\t\t\t\tcreateInserterSection( {\n\t\t\t\t\t\tkey: `collection-${ namespace }`,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\ticon: collections[ namespace ].icon,\n\t\t\t\t\t\t\ttitle: collections[ namespace ].title,\n\t\t\t\t\t\t},\n\t\t\t\t\t\titems: data,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\tconst sections = [\n\t\tcreateInserterSection( { key: 'default', items } ),\n\t\t...collectionSections,\n\t];\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"Blocks\"\n\t\t\tsections={ sections }\n\t\t\tonSelect={ handleSelect }\n\t\t\tlistProps={ listProps }\n\t\t\tlabel={ __( 'Blocks menu' ) }\n\t\t/>\n\t);\n}\n\nexport default BlockTypesTab;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAD,sBAA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C3C,CAAC;MACD,IAAKC,IAAI,CAACE,MAAM,GAAG,CAAC,EAAG;QACtBP,MAAM,CAACQ,IAAI,CACV,IAAAC,4BAAqB,EAAE;UACtBC,GAAG,EAAG,cAAcN,SAAW,EAAC;UAChCO,QAAQ,EAAE;YACTC,IAAI,EAAE1B,WAAW,CAAEkB,SAAS,CAAE,CAACQ,IAAI;YACnCC,KAAK,EAAE3B,WAAW,CAAEkB,SAAS,CAAE,CAACS;UACjC,CAAC;UACDpB,KAAK,EAAEY;QACR,CAAE,CACH,CAAC;MACF;IACD,CAAE,CAAC;IAEH,OAAOL,MAAM;EACd,CAAC,EAAE,CAAEP,KAAK,EAAEP,WAAW,CAAG,CAAC;EAE3B,MAAM4B,QAAQ,GAAG,CAChB,IAAAL,4BAAqB,EAAE;IAAEC,GAAG,EAAE,SAAS;IAAEjB;EAAM,CAAE,CAAC,EAClD,GAAGK,kBAAkB,CACrB;EAED,oBACC,IAAAtB,WAAA,CAAAuC,GAAA,EAAC7C,eAAA,CAAA8C,OAAc;IACdrC,IAAI,EAAC,QAAQ;IACbmC,QAAQ,EAAGA,QAAU;IACrBhC,QAAQ,EAAGc,YAAc;IACzBZ,SAAS,EAAGA,SAAW;IACvBiC,KAAK,EAAG,IAAAC,QAAE,EAAE,aAAc;EAAG,CAC7B,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEcnC,aAAa","ignoreList":[]}
|
|
@@ -30,6 +30,16 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
30
30
|
* Internal dependencies
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Filters the title for display. Removes the protocol and www prefix.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} title The title to be filtered.
|
|
37
|
+
*
|
|
38
|
+
* @return {string} The filtered title.
|
|
39
|
+
*/function filterTitleForDisplay(title) {
|
|
40
|
+
// Derived from `filterURLForDisplay` in `@wordpress/url`.
|
|
41
|
+
return title.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, '').replace(/^www\./i, '');
|
|
42
|
+
}
|
|
33
43
|
function LinkPreview({
|
|
34
44
|
value,
|
|
35
45
|
onEditClick,
|
|
@@ -53,6 +63,7 @@ function LinkPreview({
|
|
|
53
63
|
// url can be undefined if the href attribute is unset
|
|
54
64
|
const isEmptyURL = !value?.url?.length;
|
|
55
65
|
const displayTitle = !isEmptyURL && (0, _dom.__unstableStripHTML)(richData?.title || value?.title || displayURL);
|
|
66
|
+
const isUrlRedundant = !value?.url || filterTitleForDisplay(displayTitle) === displayURL;
|
|
56
67
|
let icon;
|
|
57
68
|
if (richData?.icon) {
|
|
58
69
|
icon = /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
@@ -107,7 +118,7 @@ function LinkPreview({
|
|
|
107
118
|
numberOfLines: 1,
|
|
108
119
|
children: displayTitle
|
|
109
120
|
})
|
|
110
|
-
}),
|
|
121
|
+
}), !isUrlRedundant && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
111
122
|
className: "block-editor-link-control__search-item-info",
|
|
112
123
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalTruncate, {
|
|
113
124
|
numberOfLines: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_compose","_url","_icons","_dom","_data","_notices","_preferences","_viewerSlot","_useRichUrlData","_jsxRuntime","LinkPreview","value","onEditClick","hasRichPreviews","hasUnlinkControl","onRemove","showIconLabels","useSelect","select","preferencesStore","get","showRichPreviews","url","richData","isFetching","useRichUrlData","hasRichData","Object","keys","length","displayURL","filterURLForDisplay","safeDecodeURI","isEmptyURL","displayTitle","stripHTML","title","icon","jsx","src","alt","Icon","info","size","globe","createNotice","useDispatch","noticesStore","ref","useCopyToClipboard","__","isDismissible","type","className","clsx","children","jsxs","Fragment","ExternalLink","href","__experimentalTruncate","numberOfLines","Button","edit","label","onClick","linkOff","copySmall","sprintf","__experimentalIsFocusable","disabled","ViewerSlot","fillProps"],"sources":["@wordpress/block-editor/src/components/link-control/link-preview.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';\nimport { Icon, globe, info, linkOff, edit, copySmall } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { ViewerSlot } from './viewer-slot';\n\nimport useRichUrlData from './use-rich-url-data';\n\nexport default function LinkPreview( {\n\tvalue,\n\tonEditClick,\n\thasRichPreviews = false,\n\thasUnlinkControl = false,\n\tonRemove,\n} ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\t// Avoid fetching if rich previews are not desired.\n\tconst showRichPreviews = hasRichPreviews ? value?.url : null;\n\n\tconst { richData, isFetching } = useRichUrlData( showRichPreviews );\n\n\t// Rich data may be an empty object so test for that.\n\tconst hasRichData = richData && Object.keys( richData ).length;\n\n\tconst displayURL =\n\t\t( value && filterURLForDisplay( safeDecodeURI( value.url ), 24 ) ) ||\n\t\t'';\n\n\t// url can be undefined if the href attribute is unset\n\tconst isEmptyURL = ! value?.url?.length;\n\n\tconst displayTitle =\n\t\t! isEmptyURL &&\n\t\tstripHTML( richData?.title || value?.title || displayURL );\n\n\tlet icon;\n\n\tif ( richData?.icon ) {\n\t\ticon = <img src={ richData?.icon } alt=\"\" />;\n\t} else if ( isEmptyURL ) {\n\t\ticon = <Icon icon={ info } size={ 32 } />;\n\t} else {\n\t\ticon = <Icon icon={ globe } />;\n\t}\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( value.url, () => {\n\t\tcreateNotice( 'info', __( 'Link copied to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\taria-label={ __( 'Currently selected' ) }\n\t\t\tclassName={ clsx( 'block-editor-link-control__search-item', {\n\t\t\t\t'is-current': true,\n\t\t\t\t'is-rich': hasRichData,\n\t\t\t\t'is-fetching': !! isFetching,\n\t\t\t\t'is-preview': true,\n\t\t\t\t'is-error': isEmptyURL,\n\t\t\t\t'is-url-title': displayTitle === displayURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<div className=\"block-editor-link-control__search-item-top\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-link-control__search-item-icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-image': richData?.icon,\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\t\t{ icon }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"block-editor-link-control__search-item-details\">\n\t\t\t\t\t\t{ ! isEmptyURL ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-item-title\"\n\t\t\t\t\t\t\t\t\thref={ value.url }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayTitle }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t{ value?.url && displayTitle !== displayURL && (\n\t\t\t\t\t\t\t\t\t<span className=\"block-editor-link-control__search-item-info\">\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ displayURL }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</span>\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\t\t<span className=\"block-editor-link-control__search-item-error-notice\">\n\t\t\t\t\t\t\t\t{ __( 'Link is empty' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit link' ) }\n\t\t\t\t\tonClick={ onEditClick }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t{ hasUnlinkControl && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Button\n\t\t\t\t\ticon={ copySmall }\n\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t// Translators: %s is a placeholder for the link URL and an optional colon, (if a Link URL is present).\n\t\t\t\t\t\t__( 'Copy link%s' ), // Ends up looking like \"Copy link: https://example.com\".\n\t\t\t\t\t\tisEmptyURL || showIconLabels ? '' : ': ' + value.url\n\t\t\t\t\t) }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\tdisabled={ isEmptyURL }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<ViewerSlot fillProps={ value } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":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,QAAA,EAClE,IAAAL,QAAE,EAAE,eAAgB;UAAC,CAClB;QACN,CACI,CAAC;MAAA,CACF,CAAC,eACP,IAAAzC,WAAA,CAAA6B,GAAA,EAACvC,WAAA,CAAA+D,MAAM;QACNzB,IAAI,EAAG0B,WAAM;QACbC,KAAK,EAAG,IAAAd,QAAE,EAAE,WAAY,CAAG;QAC3Be,OAAO,EAAGrD,WAAa;QACvB+B,IAAI,EAAC;MAAS,CACd,CAAC,EACA7B,gBAAgB,iBACjB,IAAAL,WAAA,CAAA6B,GAAA,EAACvC,WAAA,CAAA+D,MAAM;QACNzB,IAAI,EAAG6B,cAAS;QAChBF,KAAK,EAAG,IAAAd,QAAE,EAAE,aAAc,CAAG;QAC7Be,OAAO,EAAGlD,QAAU;QACpB4B,IAAI,EAAC;MAAS,CACd,CACD,eACD,IAAAlC,WAAA,CAAA6B,GAAA,EAACvC,WAAA,CAAA+D,MAAM;QACNzB,IAAI,EAAG8B,gBAAW;QAClBH,KAAK,EAAG,IAAAI,aAAO;QACd;QACA,IAAAlB,QAAE,EAAE,aAAc,CAAC;QAAE;QACrBjB,UAAU,IAAIjB,cAAc,GAAG,EAAE,GAAG,IAAI,GAAGL,KAAK,CAACW,GAClD,CAAG;QACH0B,GAAG,EAAGA,GAAK;QACXqB,yBAAyB;QACzBC,QAAQ,EAAGrC,UAAY;QACvBU,IAAI,EAAC;MAAS,CACd,CAAC,eACF,IAAAlC,WAAA,CAAA6B,GAAA,EAAC/B,WAAA,CAAAgE,UAAU;QAACC,SAAS,EAAG7D;MAAO,CAAE,CAAC;IAAA,CAC9B;EAAC,CACF,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_compose","_url","_icons","_dom","_data","_notices","_preferences","_viewerSlot","_useRichUrlData","_jsxRuntime","filterTitleForDisplay","title","replace","LinkPreview","value","onEditClick","hasRichPreviews","hasUnlinkControl","onRemove","showIconLabels","useSelect","select","preferencesStore","get","showRichPreviews","url","richData","isFetching","useRichUrlData","hasRichData","Object","keys","length","displayURL","filterURLForDisplay","safeDecodeURI","isEmptyURL","displayTitle","stripHTML","isUrlRedundant","icon","jsx","src","alt","Icon","info","size","globe","createNotice","useDispatch","noticesStore","ref","useCopyToClipboard","__","isDismissible","type","className","clsx","children","jsxs","Fragment","ExternalLink","href","__experimentalTruncate","numberOfLines","Button","edit","label","onClick","linkOff","copySmall","sprintf","__experimentalIsFocusable","disabled","ViewerSlot","fillProps"],"sources":["@wordpress/block-editor/src/components/link-control/link-preview.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';\nimport { Icon, globe, info, linkOff, edit, copySmall } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { ViewerSlot } from './viewer-slot';\n\nimport useRichUrlData from './use-rich-url-data';\n\n/**\n * Filters the title for display. Removes the protocol and www prefix.\n *\n * @param {string} title The title to be filtered.\n *\n * @return {string} The filtered title.\n */\nfunction filterTitleForDisplay( title ) {\n\t// Derived from `filterURLForDisplay` in `@wordpress/url`.\n\treturn title\n\t\t.replace( /^[a-z\\-.\\+]+[0-9]*:(\\/\\/)?/i, '' )\n\t\t.replace( /^www\\./i, '' );\n}\n\nexport default function LinkPreview( {\n\tvalue,\n\tonEditClick,\n\thasRichPreviews = false,\n\thasUnlinkControl = false,\n\tonRemove,\n} ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\t// Avoid fetching if rich previews are not desired.\n\tconst showRichPreviews = hasRichPreviews ? value?.url : null;\n\n\tconst { richData, isFetching } = useRichUrlData( showRichPreviews );\n\n\t// Rich data may be an empty object so test for that.\n\tconst hasRichData = richData && Object.keys( richData ).length;\n\n\tconst displayURL =\n\t\t( value && filterURLForDisplay( safeDecodeURI( value.url ), 24 ) ) ||\n\t\t'';\n\n\t// url can be undefined if the href attribute is unset\n\tconst isEmptyURL = ! value?.url?.length;\n\n\tconst displayTitle =\n\t\t! isEmptyURL &&\n\t\tstripHTML( richData?.title || value?.title || displayURL );\n\n\tconst isUrlRedundant =\n\t\t! value?.url || filterTitleForDisplay( displayTitle ) === displayURL;\n\n\tlet icon;\n\n\tif ( richData?.icon ) {\n\t\ticon = <img src={ richData?.icon } alt=\"\" />;\n\t} else if ( isEmptyURL ) {\n\t\ticon = <Icon icon={ info } size={ 32 } />;\n\t} else {\n\t\ticon = <Icon icon={ globe } />;\n\t}\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( value.url, () => {\n\t\tcreateNotice( 'info', __( 'Link copied to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\taria-label={ __( 'Currently selected' ) }\n\t\t\tclassName={ clsx( 'block-editor-link-control__search-item', {\n\t\t\t\t'is-current': true,\n\t\t\t\t'is-rich': hasRichData,\n\t\t\t\t'is-fetching': !! isFetching,\n\t\t\t\t'is-preview': true,\n\t\t\t\t'is-error': isEmptyURL,\n\t\t\t\t'is-url-title': displayTitle === displayURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<div className=\"block-editor-link-control__search-item-top\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-link-control__search-item-icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-image': richData?.icon,\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\t\t{ icon }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"block-editor-link-control__search-item-details\">\n\t\t\t\t\t\t{ ! isEmptyURL ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-item-title\"\n\t\t\t\t\t\t\t\t\thref={ value.url }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayTitle }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t{ ! isUrlRedundant && (\n\t\t\t\t\t\t\t\t\t<span className=\"block-editor-link-control__search-item-info\">\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ displayURL }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</span>\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\t\t<span className=\"block-editor-link-control__search-item-error-notice\">\n\t\t\t\t\t\t\t\t{ __( 'Link is empty' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit link' ) }\n\t\t\t\t\tonClick={ onEditClick }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t{ hasUnlinkControl && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Button\n\t\t\t\t\ticon={ copySmall }\n\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t// Translators: %s is a placeholder for the link URL and an optional colon, (if a Link URL is present).\n\t\t\t\t\t\t__( 'Copy link%s' ), // Ends up looking like \"Copy link: https://example.com\".\n\t\t\t\t\t\tisEmptyURL || showIconLabels ? '' : ': ' + value.url\n\t\t\t\t\t) }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\tdisabled={ isEmptyURL }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<ViewerSlot fillProps={ value } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AAEA,IAAAW,eAAA,GAAAZ,sBAAA,CAAAC,OAAA;AAAiD,IAAAY,WAAA,GAAAZ,OAAA;AA3BjD;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASa,qBAAqBA,CAAEC,KAAK,EAAG;EACvC;EACA,OAAOA,KAAK,CACVC,OAAO,CAAE,6BAA6B,EAAE,EAAG,CAAC,CAC5CA,OAAO,CAAE,SAAS,EAAE,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Ad,QAAE,EAAE,aAAc,CAAG;QAC7Be,OAAO,EAAGlD,QAAU;QACpB4B,IAAI,EAAC;MAAS,CACd,CACD,eACD,IAAArC,WAAA,CAAAgC,GAAA,EAAC1C,WAAA,CAAAkE,MAAM;QACNzB,IAAI,EAAG8B,gBAAW;QAClBH,KAAK,EAAG,IAAAI,aAAO;QACd;QACA,IAAAlB,QAAE,EAAE,aAAc,CAAC;QAAE;QACrBjB,UAAU,IAAIjB,cAAc,GAAG,EAAE,GAAG,IAAI,GAAGL,KAAK,CAACW,GAClD,CAAG;QACH0B,GAAG,EAAGA,GAAK;QACXqB,yBAAyB;QACzBC,QAAQ,EAAGrC,UAAY;QACvBU,IAAI,EAAC;MAAS,CACd,CAAC,eACF,IAAArC,WAAA,CAAAgC,GAAA,EAAClC,WAAA,CAAAmE,UAAU;QAACC,SAAS,EAAG7D;MAAO,CAAE,CAAC;IAAA,CAC9B;EAAC,CACF,CAAC;AAER","ignoreList":[]}
|
|
@@ -159,6 +159,12 @@ function ListViewBlock({
|
|
|
159
159
|
if (event.defaultPrevented) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
+
|
|
163
|
+
// Do not handle events if it comes from modals;
|
|
164
|
+
// retain the default behavior for these keys.
|
|
165
|
+
if (event.target.closest('[role=dialog]')) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
162
168
|
const isDeleteKey = [_keycodes.BACKSPACE, _keycodes.DELETE].includes(event.keyCode);
|
|
163
169
|
|
|
164
170
|
// If multiple blocks are selected, deselect all blocks when the user
|
|
@@ -169,11 +175,6 @@ function ListViewBlock({
|
|
|
169
175
|
selectBlock(event, undefined);
|
|
170
176
|
} else if (isDeleteKey || isMatch('core/block-editor/remove', event)) {
|
|
171
177
|
var _getPreviousBlockClie;
|
|
172
|
-
// Do not handle single-key block deletion shortcuts when events come from modals;
|
|
173
|
-
// retain the default behavior for these keys.
|
|
174
|
-
if (isDeleteKey && event.target.closest('[role=dialog]')) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
178
|
const {
|
|
178
179
|
blocksToUpdate: blocksToDelete,
|
|
179
180
|
firstBlockClientId,
|
|
@@ -182,7 +183,7 @@ function ListViewBlock({
|
|
|
182
183
|
} = getBlocksToUpdate();
|
|
183
184
|
|
|
184
185
|
// Don't update the selection if the blocks cannot be deleted.
|
|
185
|
-
if (!canRemoveBlocks(blocksToDelete
|
|
186
|
+
if (!canRemoveBlocks(blocksToDelete)) {
|
|
186
187
|
return;
|
|
187
188
|
}
|
|
188
189
|
let blockToFocus = (_getPreviousBlockClie = getPreviousBlockClientId(firstBlockClientId)) !== null && _getPreviousBlockClie !== void 0 ? _getPreviousBlockClie :
|