@wordpress/global-styles-engine 1.3.0 → 1.3.1-next.738bb1424.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.
Files changed (85) hide show
  1. package/README.md +1 -1
  2. package/build/core/{equal.js → equal.cjs} +2 -2
  3. package/build/core/{merge.js → merge.cjs} +2 -2
  4. package/build/core/{render.js → render.cjs} +41 -13
  5. package/build/core/render.cjs.map +7 -0
  6. package/build/core/{selectors.js → selectors.cjs} +3 -3
  7. package/build/{index.js → index.cjs} +17 -14
  8. package/build/{index.js.map → index.cjs.map} +2 -2
  9. package/build/settings/{get-palette.js → get-palette.cjs} +2 -2
  10. package/build/settings/{get-setting.js → get-setting.cjs} +4 -2
  11. package/build/settings/get-setting.cjs.map +7 -0
  12. package/build/settings/{get-style.js → get-style.cjs} +3 -3
  13. package/build/settings/{set-setting.js → set-setting.cjs} +2 -2
  14. package/build/settings/{set-style.js → set-style.cjs} +2 -2
  15. package/build/{types.js → types.cjs} +1 -1
  16. package/build/{types.js.map → types.cjs.map} +1 -1
  17. package/build/utils/{background.js → background.cjs} +1 -1
  18. package/build/utils/{common.js → common.cjs} +9 -3
  19. package/build/utils/common.cjs.map +7 -0
  20. package/build/utils/dimensions.cjs +40 -0
  21. package/build/utils/dimensions.cjs.map +7 -0
  22. package/build/utils/{duotone.js → duotone.cjs} +1 -1
  23. package/build/utils/{fluid.js → fluid.cjs} +1 -1
  24. package/build/utils/{gap.js → gap.cjs} +2 -2
  25. package/build/utils/{get-global-styles-changes.js → get-global-styles-changes.cjs} +2 -2
  26. package/build/utils/{layout.js → layout.cjs} +1 -1
  27. package/build/utils/{object.js → object.cjs} +1 -1
  28. package/build/utils/{spacing.js → spacing.cjs} +1 -1
  29. package/build/utils/{string.js → string.cjs} +1 -1
  30. package/build/utils/{typography.js → typography.cjs} +2 -2
  31. package/build-module/core/render.js +40 -12
  32. package/build-module/core/render.js.map +2 -2
  33. package/build-module/core/selectors.js +2 -2
  34. package/build-module/index.js +15 -13
  35. package/build-module/index.js.map +2 -2
  36. package/build-module/settings/get-palette.js +1 -1
  37. package/build-module/settings/get-setting.js +3 -1
  38. package/build-module/settings/get-setting.js.map +2 -2
  39. package/build-module/settings/get-style.js +2 -2
  40. package/build-module/settings/set-setting.js +1 -1
  41. package/build-module/settings/set-style.js +1 -1
  42. package/build-module/utils/common.js +8 -2
  43. package/build-module/utils/common.js.map +2 -2
  44. package/build-module/utils/dimensions.js +15 -0
  45. package/build-module/utils/dimensions.js.map +7 -0
  46. package/build-module/utils/gap.js +1 -1
  47. package/build-module/utils/typography.js +1 -1
  48. package/build-types/core/render.d.ts.map +1 -1
  49. package/build-types/index.d.ts +1 -0
  50. package/build-types/index.d.ts.map +1 -1
  51. package/build-types/settings/get-setting.d.ts.map +1 -1
  52. package/build-types/types.d.ts +1 -0
  53. package/build-types/types.d.ts.map +1 -1
  54. package/build-types/utils/common.d.ts.map +1 -1
  55. package/build-types/utils/dimensions.d.ts +2 -0
  56. package/build-types/utils/dimensions.d.ts.map +1 -0
  57. package/package.json +16 -8
  58. package/src/core/render.tsx +41 -2
  59. package/src/index.ts +1 -0
  60. package/src/settings/get-setting.ts +2 -0
  61. package/src/types.ts +1 -0
  62. package/src/utils/common.ts +6 -0
  63. package/src/utils/dimensions.ts +13 -0
  64. package/build/core/render.js.map +0 -7
  65. package/build/settings/get-setting.js.map +0 -7
  66. package/build/utils/common.js.map +0 -7
  67. package/tsconfig.json +0 -18
  68. package/tsconfig.tsbuildinfo +0 -1
  69. /package/build/core/{equal.js.map → equal.cjs.map} +0 -0
  70. /package/build/core/{merge.js.map → merge.cjs.map} +0 -0
  71. /package/build/core/{selectors.js.map → selectors.cjs.map} +0 -0
  72. /package/build/settings/{get-palette.js.map → get-palette.cjs.map} +0 -0
  73. /package/build/settings/{get-style.js.map → get-style.cjs.map} +0 -0
  74. /package/build/settings/{set-setting.js.map → set-setting.cjs.map} +0 -0
  75. /package/build/settings/{set-style.js.map → set-style.cjs.map} +0 -0
  76. /package/build/utils/{background.js.map → background.cjs.map} +0 -0
  77. /package/build/utils/{duotone.js.map → duotone.cjs.map} +0 -0
  78. /package/build/utils/{fluid.js.map → fluid.cjs.map} +0 -0
  79. /package/build/utils/{gap.js.map → gap.cjs.map} +0 -0
  80. /package/build/utils/{get-global-styles-changes.js.map → get-global-styles-changes.cjs.map} +0 -0
  81. /package/build/utils/{layout.js.map → layout.cjs.map} +0 -0
  82. /package/build/utils/{object.js.map → object.cjs.map} +0 -0
  83. /package/build/utils/{spacing.js.map → spacing.cjs.map} +0 -0
  84. /package/build/utils/{string.js.map → string.cjs.map} +0 -0
  85. /package/build/utils/{typography.js.map → typography.cjs.map} +0 -0
package/README.md CHANGED
@@ -101,7 +101,7 @@ The global styles object follows the theme.json schema:
101
101
  color: { text: '#000', background: '#fff' },
102
102
  typography: { fontSize: '16px' },
103
103
  elements: {
104
- button: { color: { background: '#blue' } }
104
+ button: { color: { background: 'blue' } }
105
105
  },
106
106
  blocks: {
107
107
  'core/paragraph': { color: { text: '#333' } }
@@ -33,7 +33,7 @@ __export(equal_exports, {
33
33
  areGlobalStylesEqual: () => areGlobalStylesEqual
34
34
  });
35
35
  module.exports = __toCommonJS(equal_exports);
36
- var import_es6 = __toESM(require("fast-deep-equal/es6"));
36
+ var import_es6 = __toESM(require("fast-deep-equal/es6"), 1);
37
37
  function areGlobalStylesEqual(original, variation) {
38
38
  if (typeof original !== "object" || typeof variation !== "object") {
39
39
  return original === variation;
@@ -44,4 +44,4 @@ function areGlobalStylesEqual(original, variation) {
44
44
  0 && (module.exports = {
45
45
  areGlobalStylesEqual
46
46
  });
47
- //# sourceMappingURL=equal.js.map
47
+ //# sourceMappingURL=equal.cjs.map
@@ -33,7 +33,7 @@ __export(merge_exports, {
33
33
  mergeGlobalStyles: () => mergeGlobalStyles
34
34
  });
35
35
  module.exports = __toCommonJS(merge_exports);
36
- var import_deepmerge = __toESM(require("deepmerge"));
36
+ var import_deepmerge = __toESM(require("deepmerge"), 1);
37
37
  var import_is_plain_object = require("is-plain-object");
38
38
  function mergeGlobalStyles(base, user) {
39
39
  return (0, import_deepmerge.default)(base, user, {
@@ -60,4 +60,4 @@ function mergeGlobalStyles(base, user) {
60
60
  0 && (module.exports = {
61
61
  mergeGlobalStyles
62
62
  });
63
- //# sourceMappingURL=merge.js.map
63
+ //# sourceMappingURL=merge.cjs.map
@@ -35,16 +35,16 @@ module.exports = __toCommonJS(render_exports);
35
35
  var import_blocks = require("@wordpress/blocks");
36
36
  var import_style_engine = require("@wordpress/style-engine");
37
37
  var import_data = require("@wordpress/data");
38
- var import_common = require("../utils/common");
39
- var import_selectors = require("./selectors");
40
- var import_typography = require("../utils/typography");
41
- var import_duotone = require("../utils/duotone");
42
- var import_string = require("../utils/string");
43
- var import_gap = require("../utils/gap");
44
- var import_background = require("../utils/background");
45
- var import_layout = require("../utils/layout");
46
- var import_object = require("../utils/object");
47
- var import_get_setting = require("../settings/get-setting");
38
+ var import_common = require("../utils/common.cjs");
39
+ var import_selectors = require("./selectors.cjs");
40
+ var import_typography = require("../utils/typography.cjs");
41
+ var import_duotone = require("../utils/duotone.cjs");
42
+ var import_string = require("../utils/string.cjs");
43
+ var import_gap = require("../utils/gap.cjs");
44
+ var import_background = require("../utils/background.cjs");
45
+ var import_layout = require("../utils/layout.cjs");
46
+ var import_object = require("../utils/object.cjs");
47
+ var import_get_setting = require("../settings/get-setting.cjs");
48
48
  var ELEMENT_CLASS_NAMES = {
49
49
  button: "wp-element-button",
50
50
  caption: "wp-element-caption"
@@ -423,9 +423,37 @@ var getNodesWithStyles = (tree, blockSelectors) => {
423
423
  }
424
424
  Object.entries(import_blocks.__EXPERIMENTAL_ELEMENTS).forEach(([name, selector]) => {
425
425
  if (tree.styles?.elements?.[name]) {
426
+ const elementStyles = tree.styles?.elements?.[name] ?? {};
427
+ const finalSelector = selector;
428
+ let textIndentStyles = null;
429
+ if (name === "text" && elementStyles?.typography?.textIndent) {
430
+ textIndentStyles = {
431
+ typography: {
432
+ textIndent: elementStyles.typography.textIndent
433
+ }
434
+ };
435
+ const stylesWithoutTextIndent = { ...elementStyles };
436
+ if (stylesWithoutTextIndent.typography) {
437
+ const { textIndent, ...restTypography } = stylesWithoutTextIndent.typography;
438
+ stylesWithoutTextIndent.typography = restTypography;
439
+ }
440
+ if (Object.keys(stylesWithoutTextIndent).length > 0) {
441
+ nodes.push({
442
+ styles: stylesWithoutTextIndent,
443
+ selector: finalSelector,
444
+ skipSelectorWrapper: !ELEMENT_CLASS_NAMES[name]
445
+ });
446
+ }
447
+ nodes.push({
448
+ styles: textIndentStyles,
449
+ selector: "p + p",
450
+ skipSelectorWrapper: true
451
+ });
452
+ return;
453
+ }
426
454
  nodes.push({
427
- styles: tree.styles?.elements?.[name] ?? {},
428
- selector,
455
+ styles: elementStyles,
456
+ selector: finalSelector,
429
457
  // Top level elements that don't use a class name should not receive the
430
458
  // `:root :where()` wrapper to maintain backwards compatibility.
431
459
  skipSelectorWrapper: !ELEMENT_CLASS_NAMES[name]
@@ -999,4 +1027,4 @@ function generateGlobalStyles(config = {}, blockTypes = [], options = {}) {
999
1027
  processCSSNesting,
1000
1028
  transformToStyles
1001
1029
  });
1002
- //# sourceMappingURL=render.js.map
1030
+ //# sourceMappingURL=render.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/core/render.tsx"],
4
+ "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\t// @ts-expect-error - @wordpress/blocks module doesn't have TypeScript declarations\n} from '@wordpress/blocks';\nimport { getCSSRules, getCSSValueFromRawStyle } from '@wordpress/style-engine';\nimport { select } from '@wordpress/data';\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\tgetResolvedValue,\n} from '../utils/common';\nimport { getBlockSelector } from './selectors';\nimport { getTypographyFontSizeValue } from '../utils/typography';\nimport { getDuotoneFilter } from '../utils/duotone';\nimport { kebabCase } from '../utils/string';\nimport { getGapCSSValue } from '../utils/gap';\nimport { setBackgroundStyleDefaults } from '../utils/background';\nimport { LAYOUT_DEFINITIONS } from '../utils/layout';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { getSetting } from '../settings/get-setting';\nimport type {\n\tBlockStyleVariation,\n\tBlockType,\n\tGlobalStylesConfig,\n\tGlobalStylesSettings,\n\tGlobalStylesStyles,\n} from '../types';\n\n// =============================================================================\n// LOCAL TYPE DEFINITIONS\n// =============================================================================\n\n/**\n * Preset metadata for CSS variable generation\n */\ninterface PresetMetadata {\n\tpath: string[];\n\tvalueKey?: string;\n\tvalueFunc?: ( preset: any, settings: any ) => string | number | null;\n\tcssVarInfix: string;\n\tclasses?: Array< {\n\t\tclassSuffix: string;\n\t\tpropertyName: string;\n\t} >;\n}\n\n/**\n * Preset collection by origin\n */\ninterface PresetsByOrigin {\n\t[ origin: string ]: any[];\n}\n\n/**\n * CSS class configuration\n */\ninterface CSSClassConfig {\n\tclassSuffix: string;\n\tpropertyName: string;\n}\n\n/**\n * Style property configuration from WordPress\n */\ninterface StylePropertyConfig {\n\tvalue: string[];\n\tproperties?: Record< string, string >;\n\tuseEngine?: boolean;\n\trootOnly?: boolean;\n}\n\n/**\n * Layout definition structure\n */\ninterface LayoutDefinition {\n\tclassName: string;\n\tname: string;\n\tdisplayMode?: string;\n\tspacingStyles?: Array< {\n\t\tselector?: string;\n\t\trules?: Record< string, any >;\n\t} >;\n\tbaseStyles?: Array< {\n\t\tselector?: string;\n\t\trules?: Record< string, any >;\n\t} >;\n}\n\n/**\n * CSS rule from style engine\n */\ninterface CSSRule {\n\tkey: string;\n\tvalue: any;\n}\n\n/**\n * Block variation in theme.json (different from BlockStyleVariation)\n */\ninterface BlockVariation {\n\tcss?: string;\n\telements?: Record< string, any >;\n\tblocks?: Record< string, any >;\n\t[ key: string ]: any; // For additional style properties\n}\n\n/**\n * Block node in theme.json\n */\ninterface BlockNode {\n\tvariations?: Record< string, BlockVariation >;\n\telements?: Record< string, any >;\n\t[ key: string ]: any; // For additional style properties\n}\n\nexport type BlockSelectors = Record<\n\tstring,\n\t{\n\t\tduotoneSelector?: string;\n\t\tselector: string;\n\t\tfallbackGapValue?: string;\n\t\thasLayoutSupport?: boolean;\n\t\tfeatureSelectors?:\n\t\t\t| string\n\t\t\t| Record< string, string | Record< string, string > >;\n\t\tname?: string;\n\t\tstyleVariationSelectors?: Record< string, string >;\n\t}\n>;\n\n// Elements that rely on class names in their selectors.\nconst ELEMENT_CLASS_NAMES = {\n\tbutton: 'wp-element-button',\n\tcaption: 'wp-element-caption',\n};\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\tdimensions: 'dimensions',\n\tspacing: 'spacing',\n\ttypography: 'typography',\n};\n\n/**\n * Transform given preset tree into a set of style declarations.\n *\n * @param blockPresets Block presets object\n * @param mergedSettings Merged theme.json settings\n * @return An array of style declarations\n */\nfunction getPresetsDeclarations(\n\tblockPresets: Record< string, any > = {},\n\tmergedSettings: GlobalStylesSettings\n): string[] {\n\treturn PRESET_METADATA.reduce(\n\t\t(\n\t\t\tdeclarations: string[],\n\t\t\t{ path, valueKey, valueFunc, cssVarInfix }: PresetMetadata\n\t\t) => {\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) as PresetsByOrigin;\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: any ) => {\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[] as string[]\n\t);\n}\n\n/**\n * Transform given preset tree into a set of preset class declarations.\n *\n * @param blockSelector Block selector string\n * @param blockPresets Block presets object\n * @return CSS declarations for the preset classes\n */\nfunction getPresetsClasses(\n\tblockSelector: string = '*',\n\tblockPresets: Record< string, any > = {}\n): string {\n\treturn PRESET_METADATA.reduce(\n\t\t(\n\t\t\tdeclarations: string,\n\t\t\t{ path, cssVarInfix, classes }: PresetMetadata\n\t\t) => {\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) as PresetsByOrigin;\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach(\n\t\t\t\t\t\t( { slug }: { slug: string } ) => {\n\t\t\t\t\t\t\tclasses!.forEach(\n\t\t\t\t\t\t\t\t( {\n\t\t\t\t\t\t\t\t\tclassSuffix,\n\t\t\t\t\t\t\t\t\tpropertyName,\n\t\t\t\t\t\t\t\t}: CSSClassConfig ) => {\n\t\t\t\t\t\t\t\t\tconst classSelectorToUse = `.has-${ kebabCase(\n\t\t\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t\t\t) }-${ classSuffix }`;\n\t\t\t\t\t\t\t\t\tconst selectorToUse = blockSelector\n\t\t\t\t\t\t\t\t\t\t.split( ',' ) // Selector can be \"h1, h2, h3\"\n\t\t\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t\t\t( selector ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t`${ selector }${ classSelectorToUse }`\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t\t\t\t\tconst value = `var(--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t\t\t) })`;\n\t\t\t\t\t\t\t\t\tdeclarations += `${ selectorToUse }{${ propertyName }: ${ value } !important;}`;\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\treturn declarations;\n\t\t},\n\t\t''\n\t);\n}\n\nfunction getPresetsSvgFilters(\n\tblockPresets: Record< string, any > = {}\n): string[] {\n\treturn PRESET_METADATA.filter(\n\t\t// Duotone are the only type of filters for now.\n\t\t( metadata: PresetMetadata ) => metadata.path.at( -1 ) === 'duotone'\n\t).flatMap( ( metadata: PresetMetadata ) => {\n\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\tblockPresets,\n\t\t\tmetadata.path,\n\t\t\t{}\n\t\t) as PresetsByOrigin;\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: any ) =>\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(\n\tinput: any = {},\n\tprefix: string,\n\ttoken: string\n): string[] {\n\tlet result: string[] = [];\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 featureSelector The feature selector\n * @param styleVariationSelector The style variation selector\n * @return Combined selector string\n */\nfunction concatFeatureVariationSelectorString(\n\tfeatureSelector: string,\n\tstyleVariationSelector: string\n): string {\n\tconst featureSelectors = featureSelector.split( ',' );\n\tconst combinedSelectors: string[] = [];\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 selectors Custom selectors object for a block\n * @param styles A block's styles object\n * @return Style declarations\n */\nconst getFeatureDeclarations = (\n\tselectors: Record< string, any >,\n\tstyles: Record< string, any >\n): Record< string, string[] > => {\n\tconst declarations: Record< string, string[] > = {};\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 (\n\t\t\t! isShorthand &&\n\t\t\ttypeof selector === 'object' &&\n\t\t\tselector !== null\n\t\t) {\n\t\t\tObject.entries( selector as Record< string, string > ).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 (\n\t\t\tisShorthand ||\n\t\t\t( typeof selector === 'object' &&\n\t\t\t\tselector !== null &&\n\t\t\t\t'root' in selector )\n\t\t) {\n\t\t\tconst featureSelector = isShorthand\n\t\t\t\t? ( selector as string )\n\t\t\t\t: ( selector as any ).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 blockStyles Block styles\n * @param selector The selector these declarations should attach to\n * @param useRootPaddingAlign Whether to use CSS custom properties in root selector\n * @param tree A theme.json tree containing layout definitions\n * @param disableRootPadding Whether to force disable the root padding styles\n * @return An array of style declarations\n */\nexport function getStylesDeclarations(\n\tblockStyles: any = {},\n\tselector: string = '',\n\tuseRootPaddingAlign?: boolean,\n\ttree: any = {},\n\tdisableRootPadding: boolean = false\n): string[] {\n\tconst isRoot = ROOT_BLOCK_SELECTOR === selector;\n\tconst output = Object.entries(\n\t\tSTYLE_PROPERTY as Record< string, StylePropertyConfig >\n\t).reduce(\n\t\t(\n\t\t\tdeclarations: string[],\n\t\t\t[ key, { value, properties, useEngine, rootOnly } ]: [\n\t\t\t\tstring,\n\t\t\t\tStylePropertyConfig,\n\t\t\t]\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 }: ${ getCSSValueFromRawStyle(\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 }: ${ getCSSValueFromRawStyle(\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[] as string[]\n\t);\n\n\t/*\n\t * Preprocess background image values.\n\t *\n\t * Note: As we absorb more and more styles into the engine, we could simplify this function.\n\t * A refactor is for the style engine to handle ref resolution (and possibly defaults)\n\t * via a public util used internally and externally. Theme.json tree and defaults could be passed\n\t * as options.\n\t */\n\tif ( !! blockStyles.background ) {\n\t\t/*\n\t\t * Resolve dynamic values before they are compiled by the style engine,\n\t\t * which doesn't (yet) resolve dynamic values.\n\t\t */\n\t\tif ( blockStyles.background?.backgroundImage ) {\n\t\t\tblockStyles.background.backgroundImage = getResolvedValue(\n\t\t\t\tblockStyles.background.backgroundImage,\n\t\t\t\ttree\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\t * Set default values for block background styles.\n\t\t * Top-level styles are an exception as they are applied to the body.\n\t\t */\n\t\tif ( ! isRoot && !! blockStyles.background?.backgroundImage?.id ) {\n\t\t\tblockStyles = {\n\t\t\t\t...blockStyles,\n\t\t\t\tbackground: {\n\t\t\t\t\t...blockStyles.background,\n\t\t\t\t\t...setBackgroundStyleDefaults( blockStyles.background ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\tconst extraRules = getCSSRules( blockStyles );\n\textraRules.forEach( ( rule: CSSRule ) => {\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 = getResolvedValue( rule.value, tree );\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{ name: '', slug: '', size: ruleValue as string },\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 props Layout styles configuration\n * @param props.layoutDefinitions Layout definitions from theme.json\n * @param props.style Style object for the block\n * @param props.selector Selector to apply the styles to\n * @param props.hasBlockGapSupport Whether the block supports block gap styles\n * @param props.hasFallbackGapSupport Whether the block supports fallback gap styles\n * @param props.fallbackGapValue Fallback gap value to use if block gap support is\n *\n * @return 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\tlayoutDefinitions?: Record< string, LayoutDefinition >;\n\tstyle?: GlobalStylesStyles;\n\tselector?: string;\n\thasBlockGapSupport?: boolean;\n\thasFallbackGapSupport?: boolean;\n\tfallbackGapValue?: string;\n} ): string {\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: any ) => {\n\t\t\t\t\t\tconst declarations: string[] = [];\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? `:root :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: `:root :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}\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 }: LayoutDefinition ) => {\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: any ) => {\n\t\t\t\t\t\tconst declarations: string[] = [];\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: any ): any {\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 = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: string | BlockSelectors\n): any[] => {\n\tconst nodes: {\n\t\tstyles: Partial< Omit< GlobalStylesStyles, 'elements' | 'blocks' > >;\n\t\tselector: string;\n\t\tskipSelectorWrapper?: boolean;\n\t\tduotoneSelector?: string;\n\t\tfeatureSelectors?:\n\t\t\t| string\n\t\t\t| Record< string, string | Record< string, string > >;\n\t\tfallbackGapValue?: string;\n\t\thasLayoutSupport?: boolean;\n\t\tstyleVariationSelectors?: Record< string, string >;\n\t}[] = [];\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\t// Root selector (body) styles should not be wrapped in `:root where()` to keep\n\t\t\t// specificity at (0,0,1) and maintain backwards compatibility.\n\t\t\tskipSelectorWrapper: true,\n\t\t} );\n\t}\n\n\tObject.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {\n\t\tif ( tree.styles?.elements?.[ name ] ) {\n\t\t\tconst elementStyles = tree.styles?.elements?.[ name ] ?? {};\n\n\t\t\t// Special handling for text element with textIndent - use p + p selector\n\t\t\tconst finalSelector = selector as string;\n\t\t\tlet textIndentStyles = null;\n\t\t\tif ( name === 'text' && elementStyles?.typography?.textIndent ) {\n\t\t\t\ttextIndentStyles = {\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\ttextIndent: elementStyles.typography.textIndent,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t// Remove textIndent from the main styles to avoid duplication\n\t\t\t\tconst stylesWithoutTextIndent = { ...elementStyles };\n\t\t\t\tif ( stylesWithoutTextIndent.typography ) {\n\t\t\t\t\tconst { textIndent, ...restTypography } =\n\t\t\t\t\t\tstylesWithoutTextIndent.typography;\n\t\t\t\t\tstylesWithoutTextIndent.typography = restTypography;\n\t\t\t\t}\n\n\t\t\t\t// Push the main styles with p selector (if there are any other styles)\n\t\t\t\tif ( Object.keys( stylesWithoutTextIndent ).length > 0 ) {\n\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\tstyles: stylesWithoutTextIndent,\n\t\t\t\t\t\tselector: finalSelector,\n\t\t\t\t\t\tskipSelectorWrapper: ! (\n\t\t\t\t\t\t\tELEMENT_CLASS_NAMES as Record< string, string >\n\t\t\t\t\t\t )[ name ],\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t// Push textIndent with p + p selector\n\t\t\t\tnodes.push( {\n\t\t\t\t\tstyles: textIndentStyles,\n\t\t\t\t\tselector: 'p + p',\n\t\t\t\t\tskipSelectorWrapper: true,\n\t\t\t\t} );\n\t\t\t\treturn; // Skip the normal push below\n\t\t\t}\n\n\t\t\tnodes.push( {\n\t\t\t\tstyles: elementStyles,\n\t\t\t\tselector: finalSelector,\n\t\t\t\t// Top level elements that don't use a class name should not receive the\n\t\t\t\t// `:root :where()` wrapper to maintain backwards compatibility.\n\t\t\t\tskipSelectorWrapper: ! (\n\t\t\t\t\tELEMENT_CLASS_NAMES as Record< string, string >\n\t\t\t\t )[ name ],\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\t\t\tconst typedNode = node as BlockNode;\n\n\t\t\tif ( typedNode?.variations ) {\n\t\t\t\tconst variations: Record< string, any > = {};\n\t\t\t\tObject.entries( typedNode.variations ).forEach(\n\t\t\t\t\t( [ variationName, variation ] ) => {\n\t\t\t\t\t\tconst typedVariation = variation as BlockVariation;\n\t\t\t\t\t\tvariations[ variationName ] =\n\t\t\t\t\t\t\tpickStyleKeys( typedVariation );\n\t\t\t\t\t\tif ( typedVariation?.css ) {\n\t\t\t\t\t\t\tvariations[ variationName ].css =\n\t\t\t\t\t\t\t\ttypedVariation.css;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst variationSelector =\n\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t? blockSelectors[ blockName ]\n\t\t\t\t\t\t\t\t\t\t?.styleVariationSelectors?.[\n\t\t\t\t\t\t\t\t\t\tvariationName\n\t\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t\t: undefined;\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(\n\t\t\t\t\t\t\ttypedVariation?.elements ?? {}\n\t\t\t\t\t\t).forEach( ( [ element, elementStyles ] ) => {\n\t\t\t\t\t\t\tif ( elementStyles && ELEMENTS[ element ] ) {\n\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\tstyles: elementStyles,\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\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( typedVariation?.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 =\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t\t\t? scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\t\tblockSelectors[\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockName\n\t\t\t\t\t\t\t\t\t\t\t\t]?.selector\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\tconst variationDuotoneSelector =\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t\t\t? scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\t\tblockSelectors[\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockName\n\t\t\t\t\t\t\t\t\t\t\t\t]?.duotoneSelector as string\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\tconst variationFeatureSelectors =\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t\t\t? scopeFeatureSelectors(\n\t\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\t\tblockSelectors[\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockName\n\t\t\t\t\t\t\t\t\t\t\t\t]?.featureSelectors ?? {}\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: undefined;\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\tif (\n\t\t\t\t\t\t\t\t\t! variationBlockSelector ||\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors === 'string'\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\treturn;\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 (\n\t\t\t\ttypeof blockSelectors !== 'string' &&\n\t\t\t\tblockSelectors?.[ blockName ]?.selector\n\t\t\t) {\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( typedNode?.elements ?? {} ).forEach(\n\t\t\t\t( [ elementName, value ] ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof blockSelectors !== 'string' &&\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: string ) => {\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: string ) =>\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 = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: string | BlockSelectors\n): any[] => {\n\tconst nodes: {\n\t\tpresets: Record< string, any >;\n\t\tcustom?: Record< string, any >;\n\t\tselector?: string;\n\t\tduotoneSelector?: string;\n\t\tfallbackGapValue?: string;\n\t\thasLayoutSupport?: boolean;\n\t\tfeatureSelectors?: Record< string, string >;\n\t\tstyleVariationSelectors?: Record< string, string >;\n\t}[] = [];\n\n\tif ( ! tree?.settings ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickPresets = ( treeToPickFrom: any ): any => {\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 blockCustom = node.custom;\n\t\t\tif (\n\t\t\t\ttypeof blockSelectors === 'string' ||\n\t\t\t\t! blockSelectors[ blockName ]\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst blockPresets = pickPresets( node );\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 generateCustomProperties = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: BlockSelectors\n): string => {\n\tconst settings = getNodesWithSettings( tree, blockSelectors );\n\tlet ruleset = '';\n\tsettings.forEach( ( { presets, custom, selector } ) => {\n\t\tconst declarations = tree?.settings\n\t\t\t? getPresetsDeclarations( presets, tree?.settings )\n\t\t\t: [];\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 transformToStyles = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: string | BlockSelectors,\n\thasBlockGapSupport?: boolean,\n\thasFallbackGapSupport?: boolean,\n\tdisableLayoutStyles: boolean = false,\n\tdisableRootPadding: boolean = false,\n\tstyleOptions: Record< string, boolean > = {}\n): string => {\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\tvariationStyles: false,\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(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .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\tskipSelectorWrapper,\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: any = {};\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\tconst generalSelector = skipSelectorWrapper\n\t\t\t\t\t\t? selector\n\t\t\t\t\t\t: `:root :where(${ selector })`;\n\t\t\t\t\truleset += `${ generalSelector }{${ 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 ( options.variationStyles && 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\tstring,\n\t\t\t\t\t\t\t\t\t\t\tstring[],\n\t\t\t\t\t\t\t\t\t\t] ) => {\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 as string\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 as string,\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: string ) => sel + pseudoKey )\n\t\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\t\t// As pseudo classes such as :hover, :focus etc. have class-level\n\t\t\t\t\t\t\t// specificity, they must use the `:root :where()` wrapper. This.\n\t\t\t\t\t\t\t// caps the specificity at `0-1-0` to allow proper nesting of variations\n\t\t\t\t\t\t\t// and block type element styles.\n\t\t\t\t\t\t\tconst pseudoRule = `:root :where(${ _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 generateSvgFilters(\n\ttree: GlobalStylesConfig,\n\tblockSelectors: BlockSelectors\n): string[] {\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\treturn nodesWithSettings.flatMap( ( { presets } ) => {\n\t\treturn getPresetsSvgFilters( presets );\n\t} );\n}\n\nconst getSelectorsConfig = ( blockType: BlockType, rootSelector: string ) => {\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: Record< string, string > = {\n\t\troot: rootSelector,\n\t};\n\tObject.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(\n\t\t( [ featureKey, featureName ] ) => {\n\t\t\tconst featureSelector = getBlockSelector( blockType, featureKey );\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: BlockType[],\n\tvariationInstanceId?: string\n) => {\n\tconst { getBlockStyles } = select( blocksStore );\n\tconst result: BlockSelectors = {};\n\tblockTypes.forEach( ( blockType ) => {\n\t\tconst name = blockType.name;\n\t\tconst selector = getBlockSelector( blockType );\n\n\t\tif ( ! selector ) {\n\t\t\treturn; // Skip blocks without valid selectors\n\t\t}\n\t\tlet duotoneSelector = getBlockSelector( blockType, 'filter.duotone' );\n\t\t// Keep backwards compatibility for support.color.__experimentalDuotone.\n\t\tif ( ! duotoneSelector ) {\n\t\t\tconst rootSelector = getBlockSelector( 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 &&\n\t\t\t\trootSelector &&\n\t\t\t\tscopeSelector( 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\t// @ts-expect-error\n\t\t\tblockType?.supports?.spacing?.blockGap?.__experimentalDefault;\n\n\t\tconst blockStyleVariations = getBlockStyles( name );\n\t\tconst styleVariationSelectors: Record< string, string > = {};\n\t\tblockStyleVariations?.forEach( ( variation: BlockStyleVariation ) => {\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: duotoneSelector ?? undefined,\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 config Theme.json configuration file object\n * @return Theme.json configuration file object updated\n */\nfunction updateConfigWithSeparator(\n\tconfig: GlobalStylesConfig\n): GlobalStylesConfig {\n\tconst blocks = config.styles?.blocks;\n\tconst separatorBlock = blocks?.[ 'core/separator' ];\n\tconst needsSeparatorStyleUpdate =\n\t\tseparatorBlock &&\n\t\tseparatorBlock.color?.background &&\n\t\t! separatorBlock.color?.text &&\n\t\t! separatorBlock.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...blocks,\n\t\t\t\t\t'core/separator': {\n\t\t\t\t\t\t...separatorBlock,\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...separatorBlock.color,\n\t\t\t\t\t\t\ttext: separatorBlock.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: string, blockSelector: string ) {\n\tlet processedCSS = '';\n\n\tif ( ! css || css.trim() === '' ) {\n\t\treturn processedCSS;\n\t}\n\n\t// Split CSS nested rules.\n\tconst parts = css.split( '&' );\n\tparts.forEach( ( part: string ) => {\n\t\tif ( ! part || part.trim() === '' ) {\n\t\t\treturn;\n\t\t}\n\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 splitPart = part.replace( '}', '' ).split( '{' );\n\t\t\tif ( splitPart.length !== 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst [ nestedSelector, cssValue ] = splitPart;\n\n\t\t\t// Handle pseudo elements such as ::before, ::after, etc. Regex will also\n\t\t\t// capture any leading combinator such as >, +, or ~, as well as spaces.\n\t\t\t// This allows pseudo elements as descendants e.g. `.parent ::before`.\n\t\t\tconst matches = nestedSelector.match( /([>+~\\s]*::[a-zA-Z-]+)/ );\n\t\t\tconst pseudoPart = matches ? matches[ 1 ] : '';\n\t\t\tconst withoutPseudoElement = matches\n\t\t\t\t? nestedSelector.replace( pseudoPart, '' ).trim()\n\t\t\t\t: nestedSelector.trim();\n\n\t\t\tlet combinedSelector;\n\t\t\tif ( withoutPseudoElement === '' ) {\n\t\t\t\t// Only contained a pseudo element to use the block selector to form\n\t\t\t\t// the final `:root :where()` selector.\n\t\t\t\tcombinedSelector = blockSelector;\n\t\t\t} else {\n\t\t\t\t// If the nested selector is a descendant of the block scope it with the\n\t\t\t\t// block selector. Otherwise append it to the block selector.\n\t\t\t\tcombinedSelector = nestedSelector.startsWith( ' ' )\n\t\t\t\t\t? scopeSelector( blockSelector, withoutPseudoElement )\n\t\t\t\t\t: appendToSelector( blockSelector, withoutPseudoElement );\n\t\t\t}\n\n\t\t\t// Build final rule, re-adding any pseudo element outside the `:where()`\n\t\t\t// to maintain valid CSS selector.\n\t\t\tprocessedCSS += `:root :where(${ combinedSelector })${ pseudoPart }{${ cssValue.trim() }}`;\n\t\t}\n\t} );\n\treturn processedCSS;\n}\n\nexport interface GlobalStylesRenderOptions {\n\thasBlockGapSupport?: boolean;\n\thasFallbackGapSupport?: boolean;\n\tdisableLayoutStyles?: boolean;\n\tdisableRootPadding?: boolean;\n\tgetBlockStyles?: ( blockName: string ) => any[];\n\tstyleOptions?: Record< string, boolean >;\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 config Global styles configuration\n * @param blockTypes Array of block types from WordPress blocks store\n * @param options Options for rendering global styles\n * @return Array of stylesheets and settings\n */\nexport function generateGlobalStyles(\n\tconfig: GlobalStylesConfig | undefined = {},\n\tblockTypes: any[] = [],\n\toptions: GlobalStylesRenderOptions = {}\n): [ any[], any ] {\n\tconst {\n\t\thasBlockGapSupport: hasBlockGapSupportOption,\n\t\thasFallbackGapSupport: hasFallbackGapSupportOption,\n\t\tdisableLayoutStyles = false,\n\t\tdisableRootPadding = false,\n\t\tstyleOptions = {},\n\t} = options;\n\n\t// Use provided block types or fall back to getBlockTypes()\n\tconst blocks = blockTypes.length > 0 ? blockTypes : getBlockTypes();\n\n\tconst blockGap = getSetting( config, 'spacing.blockGap' );\n\tconst hasBlockGapSupport = hasBlockGapSupportOption ?? blockGap !== null;\n\tconst hasFallbackGapSupport =\n\t\thasFallbackGapSupportOption ?? ! hasBlockGapSupport;\n\n\tif ( ! config?.styles || ! config?.settings ) {\n\t\treturn [ [], {} ];\n\t}\n\tconst updatedConfig = updateConfigWithSeparator( config );\n\tconst blockSelectors = getBlockSelectors( blocks );\n\tconst customProperties = generateCustomProperties(\n\t\tupdatedConfig,\n\t\tblockSelectors\n\t);\n\tconst globalStyles = transformToStyles(\n\t\tupdatedConfig,\n\t\tblockSelectors,\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tdisableLayoutStyles,\n\t\tdisableRootPadding,\n\t\tstyleOptions\n\t);\n\tconst svgs = generateSvgFilters( updatedConfig, blockSelectors );\n\tconst styles = [\n\t\t{\n\t\t\tcss: customProperties,\n\t\t\tisGlobalStyles: true,\n\t\t},\n\t\t{\n\t\t\tcss: globalStyles,\n\t\t\tisGlobalStyles: true,\n\t\t},\n\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{\n\t\t\tcss: updatedConfig?.styles?.css ?? '',\n\t\t\tisGlobalStyles: true,\n\t\t},\n\t\t{\n\t\t\tassets: svgs,\n\t\t\t__unstableType: 'svg',\n\t\t\tisGlobalStyles: true,\n\t\t},\n\t];\n\n\t// Loop through the blocks to check if there are custom CSS values.\n\t// If there are, get the block selector and push the selector together with\n\t// the CSS value to the 'stylesheets' array.\n\tblocks.forEach( ( blockType: BlockType ) => {\n\t\tconst blockStyles = updatedConfig?.styles?.blocks?.[ blockType.name ];\n\t\tif ( blockStyles?.css ) {\n\t\t\tconst selector = blockSelectors[ blockType.name ].selector;\n\t\t\tstyles.push( {\n\t\t\t\tcss: processCSSNesting( blockStyles.css, selector ),\n\t\t\t\tisGlobalStyles: true,\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn [ styles, updatedConfig.settings ];\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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,CAAE;AAEF,SAAO,CAAE,QAAQ,cAAc,QAAS;AACzC;",
6
+ "names": ["STYLE_PROPERTY", "ELEMENTS", "presets", "blocksStore"]
7
+ }
@@ -23,8 +23,8 @@ __export(selectors_exports, {
23
23
  getBlockSelector: () => getBlockSelector
24
24
  });
25
25
  module.exports = __toCommonJS(selectors_exports);
26
- var import_common = require("../utils/common");
27
- var import_object = require("../utils/object");
26
+ var import_common = require("../utils/common.cjs");
27
+ var import_object = require("../utils/object.cjs");
28
28
  function getBlockSelector(blockType, target = "root", options = {}) {
29
29
  if (!target) {
30
30
  return null;
@@ -81,4 +81,4 @@ function getBlockSelector(blockType, target = "root", options = {}) {
81
81
  0 && (module.exports = {
82
82
  getBlockSelector
83
83
  });
84
- //# sourceMappingURL=selectors.js.map
84
+ //# sourceMappingURL=selectors.cjs.map
@@ -34,6 +34,7 @@ __export(index_exports, {
34
34
  generateGlobalStyles: () => import_render.generateGlobalStyles,
35
35
  getBlockSelector: () => import_selectors.getBlockSelector,
36
36
  getBlockSelectors: () => import_render2.getBlockSelectors,
37
+ getDimensionPresetCssVar: () => import_dimensions.getDimensionPresetCssVar,
37
38
  getGlobalStylesChanges: () => import_get_global_styles_changes.default,
38
39
  getLayoutStyles: () => import_render2.getLayoutStyles,
39
40
  getPalettes: () => import_get_palette.default,
@@ -49,25 +50,27 @@ __export(index_exports, {
49
50
  toStyles: () => import_render2.transformToStyles
50
51
  });
51
52
  module.exports = __toCommonJS(index_exports);
52
- var import_get_setting = require("./settings/get-setting");
53
- var import_set_setting = require("./settings/set-setting");
54
- var import_get_style = require("./settings/get-style");
55
- var import_set_style = require("./settings/set-style");
56
- var import_get_palette = __toESM(require("./settings/get-palette"));
57
- var import_equal = require("./core/equal");
58
- var import_merge = require("./core/merge");
59
- var import_get_global_styles_changes = __toESM(require("./utils/get-global-styles-changes"));
60
- var import_render = require("./core/render");
61
- var import_render2 = require("./core/render");
62
- var import_selectors = require("./core/selectors");
63
- var import_typography = require("./utils/typography");
64
- var import_common = require("./utils/common");
53
+ var import_get_setting = require("./settings/get-setting.cjs");
54
+ var import_set_setting = require("./settings/set-setting.cjs");
55
+ var import_get_style = require("./settings/get-style.cjs");
56
+ var import_set_style = require("./settings/set-style.cjs");
57
+ var import_get_palette = __toESM(require("./settings/get-palette.cjs"), 1);
58
+ var import_equal = require("./core/equal.cjs");
59
+ var import_merge = require("./core/merge.cjs");
60
+ var import_get_global_styles_changes = __toESM(require("./utils/get-global-styles-changes.cjs"), 1);
61
+ var import_render = require("./core/render.cjs");
62
+ var import_render2 = require("./core/render.cjs");
63
+ var import_selectors = require("./core/selectors.cjs");
64
+ var import_typography = require("./utils/typography.cjs");
65
+ var import_dimensions = require("./utils/dimensions.cjs");
66
+ var import_common = require("./utils/common.cjs");
65
67
  // Annotate the CommonJS export names for ESM import in node:
66
68
  0 && (module.exports = {
67
69
  areGlobalStylesEqual,
68
70
  generateGlobalStyles,
69
71
  getBlockSelector,
70
72
  getBlockSelectors,
73
+ getDimensionPresetCssVar,
71
74
  getGlobalStylesChanges,
72
75
  getLayoutStyles,
73
76
  getPalettes,
@@ -82,4 +85,4 @@ var import_common = require("./utils/common");
82
85
  setStyle,
83
86
  toStyles
84
87
  });
85
- //# sourceMappingURL=index.js.map
88
+ //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["// High-level Settings API\nexport { getSetting } from './settings/get-setting';\nexport { setSetting } from './settings/set-setting';\nexport { getStyle } from './settings/get-style';\nexport { setStyle } from './settings/set-style';\nexport { default as getPalettes } from './settings/get-palette';\n\n// Utilities\nexport { areGlobalStylesEqual } from './core/equal';\nexport { mergeGlobalStyles } from './core/merge';\nexport { default as getGlobalStylesChanges } from './utils/get-global-styles-changes';\n\n// Core rendering\nexport { generateGlobalStyles } from './core/render';\nexport {\n\ttransformToStyles as toStyles,\n\tgetBlockSelectors,\n\tgetLayoutStyles,\n} from './core/render';\nexport { getBlockSelector } from './core/selectors';\n\n// Utilities (Ideally these shouldn't be exposed)\nexport { getTypographyFontSizeValue } from './utils/typography';\nexport {\n\tgetValueFromVariable,\n\tgetPresetVariableFromValue,\n\tgetResolvedValue,\n} from './utils/common';\n\n// Types\nexport type * from './types';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAA2B;AAC3B,yBAA2B;AAC3B,uBAAyB;AACzB,uBAAyB;AACzB,yBAAuC;AAGvC,mBAAqC;AACrC,mBAAkC;AAClC,uCAAkD;AAGlD,oBAAqC;AACrC,IAAAA,iBAIO;AACP,uBAAiC;AAGjC,wBAA2C;AAC3C,oBAIO;",
4
+ "sourcesContent": ["// High-level Settings API\nexport { getSetting } from './settings/get-setting';\nexport { setSetting } from './settings/set-setting';\nexport { getStyle } from './settings/get-style';\nexport { setStyle } from './settings/set-style';\nexport { default as getPalettes } from './settings/get-palette';\n\n// Utilities\nexport { areGlobalStylesEqual } from './core/equal';\nexport { mergeGlobalStyles } from './core/merge';\nexport { default as getGlobalStylesChanges } from './utils/get-global-styles-changes';\n\n// Core rendering\nexport { generateGlobalStyles } from './core/render';\nexport {\n\ttransformToStyles as toStyles,\n\tgetBlockSelectors,\n\tgetLayoutStyles,\n} from './core/render';\nexport { getBlockSelector } from './core/selectors';\n\n// Utilities (Ideally these shouldn't be exposed)\nexport { getTypographyFontSizeValue } from './utils/typography';\nexport { getDimensionPresetCssVar } from './utils/dimensions';\nexport {\n\tgetValueFromVariable,\n\tgetPresetVariableFromValue,\n\tgetResolvedValue,\n} from './utils/common';\n\n// Types\nexport type * from './types';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAA2B;AAC3B,yBAA2B;AAC3B,uBAAyB;AACzB,uBAAyB;AACzB,yBAAuC;AAGvC,mBAAqC;AACrC,mBAAkC;AAClC,uCAAkD;AAGlD,oBAAqC;AACrC,IAAAA,iBAIO;AACP,uBAAiC;AAGjC,wBAA2C;AAC3C,wBAAyC;AACzC,oBAIO;",
6
6
  "names": ["import_render"]
7
7
  }
@@ -24,7 +24,7 @@ __export(get_palette_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(get_palette_exports);
26
26
  var import_i18n = require("@wordpress/i18n");
27
- var import_get_setting = require("./get-setting");
27
+ var import_get_setting = require("./get-setting.cjs");
28
28
  function getPalettes(settings) {
29
29
  if (!settings) {
30
30
  return {
@@ -162,4 +162,4 @@ function getPalettes(settings) {
162
162
  palettes.hasColorsOrGradients = !!palettes.colors?.length || !!palettes.gradients?.length;
163
163
  return palettes;
164
164
  }
165
- //# sourceMappingURL=get-palette.js.map
165
+ //# sourceMappingURL=get-palette.cjs.map
@@ -23,7 +23,7 @@ __export(get_setting_exports, {
23
23
  getSetting: () => getSetting
24
24
  });
25
25
  module.exports = __toCommonJS(get_setting_exports);
26
- var import_object = require("../utils/object");
26
+ var import_object = require("../utils/object.cjs");
27
27
  var VALID_SETTINGS = [
28
28
  "appearanceTools",
29
29
  "useRootPaddingAwareAlignments",
@@ -55,8 +55,10 @@ var VALID_SETTINGS = [
55
55
  "color.text",
56
56
  "custom",
57
57
  "dimensions.aspectRatio",
58
+ "dimensions.height",
58
59
  "dimensions.minHeight",
59
60
  "dimensions.width",
61
+ "dimensions.dimensionSizes",
60
62
  "layout.contentSize",
61
63
  "layout.definitions",
62
64
  "layout.wideSize",
@@ -112,4 +114,4 @@ function getSetting(globalStyles, path, blockName) {
112
114
  0 && (module.exports = {
113
115
  getSetting
114
116
  });
115
- //# sourceMappingURL=get-setting.js.map
117
+ //# sourceMappingURL=get-setting.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/settings/get-setting.ts"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport type { GlobalStylesConfig } from '../types';\n\nconst VALID_SETTINGS = [\n\t'appearanceTools',\n\t'useRootPaddingAwareAlignments',\n\t'background.backgroundImage',\n\t'background.backgroundRepeat',\n\t'background.backgroundSize',\n\t'background.backgroundPosition',\n\t'border.color',\n\t'border.radius',\n\t'border.radiusSizes',\n\t'border.style',\n\t'border.width',\n\t'shadow.presets',\n\t'shadow.defaultPresets',\n\t'color.background',\n\t'color.button',\n\t'color.caption',\n\t'color.custom',\n\t'color.customDuotone',\n\t'color.customGradient',\n\t'color.defaultDuotone',\n\t'color.defaultGradients',\n\t'color.defaultPalette',\n\t'color.duotone',\n\t'color.gradients',\n\t'color.heading',\n\t'color.link',\n\t'color.palette',\n\t'color.text',\n\t'custom',\n\t'dimensions.aspectRatio',\n\t'dimensions.height',\n\t'dimensions.minHeight',\n\t'dimensions.width',\n\t'dimensions.dimensionSizes',\n\t'layout.contentSize',\n\t'layout.definitions',\n\t'layout.wideSize',\n\t'lightbox.enabled',\n\t'lightbox.allowEditing',\n\t'position.fixed',\n\t'position.sticky',\n\t'spacing.customSpacingSize',\n\t'spacing.defaultSpacingSizes',\n\t'spacing.spacingSizes',\n\t'spacing.spacingScale',\n\t'spacing.blockGap',\n\t'spacing.margin',\n\t'spacing.padding',\n\t'spacing.units',\n\t'typography.fluid',\n\t'typography.customFontSize',\n\t'typography.defaultFontSizes',\n\t'typography.dropCap',\n\t'typography.fontFamilies',\n\t'typography.fontSizes',\n\t'typography.fontStyle',\n\t'typography.fontWeight',\n\t'typography.letterSpacing',\n\t'typography.lineHeight',\n\t'typography.textAlign',\n\t'typography.textColumns',\n\t'typography.textDecoration',\n\t'typography.textTransform',\n\t'typography.writingMode',\n];\n\nexport function getSetting< T = any >(\n\tglobalStyles: GlobalStylesConfig,\n\tpath: string,\n\tblockName?: string\n): T {\n\tconst appendedBlockPath = blockName ? '.blocks.' + blockName : '';\n\tconst appendedPropertyPath = path ? '.' + path : '';\n\tconst contextualPath = `settings${ appendedBlockPath }${ appendedPropertyPath }`;\n\tconst globalPath = `settings${ appendedPropertyPath }`;\n\n\tif ( path ) {\n\t\treturn ( getValueFromObjectPath( globalStyles, contextualPath ) ??\n\t\t\tgetValueFromObjectPath( globalStyles, globalPath ) ) as T;\n\t}\n\n\tlet result = {};\n\tVALID_SETTINGS.forEach( ( setting ) => {\n\t\tconst value =\n\t\t\tgetValueFromObjectPath(\n\t\t\t\tglobalStyles,\n\t\t\t\t`settings${ appendedBlockPath }.${ setting }`\n\t\t\t) ??\n\t\t\tgetValueFromObjectPath( globalStyles, `settings.${ setting }` );\n\t\tif ( value !== undefined ) {\n\t\t\tresult = setImmutably( result, setting.split( '.' ), value );\n\t\t}\n\t} );\n\treturn result as T;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqD;AAGrD,IAAM,iBAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,SAAS,WACf,cACA,MACA,WACI;AACJ,QAAM,oBAAoB,YAAY,aAAa,YAAY;AAC/D,QAAM,uBAAuB,OAAO,MAAM,OAAO;AACjD,QAAM,iBAAiB,WAAY,iBAAkB,GAAI,oBAAqB;AAC9E,QAAM,aAAa,WAAY,oBAAqB;AAEpD,MAAK,MAAO;AACX,eAAS,sCAAwB,cAAc,cAAe,SAC7D,sCAAwB,cAAc,UAAW;AAAA,EACnD;AAEA,MAAI,SAAS,CAAC;AACd,iBAAe,QAAS,CAAE,YAAa;AACtC,UAAM,YACL;AAAA,MACC;AAAA,MACA,WAAY,iBAAkB,IAAK,OAAQ;AAAA,IAC5C,SACA,sCAAwB,cAAc,YAAa,OAAQ,EAAG;AAC/D,QAAK,UAAU,QAAY;AAC1B,mBAAS,4BAAc,QAAQ,QAAQ,MAAO,GAAI,GAAG,KAAM;AAAA,IAC5D;AAAA,EACD,CAAE;AACF,SAAO;AACR;",
6
+ "names": []
7
+ }
@@ -23,8 +23,8 @@ __export(get_style_exports, {
23
23
  getStyle: () => getStyle
24
24
  });
25
25
  module.exports = __toCommonJS(get_style_exports);
26
- var import_object = require("../utils/object");
27
- var import_common = require("../utils/common");
26
+ var import_object = require("../utils/object.cjs");
27
+ var import_common = require("../utils/common.cjs");
28
28
  function getStyle(globalStyles, path, blockName, shouldDecodeEncode = true) {
29
29
  const appendedPath = path ? "." + path : "";
30
30
  const finalPath = !blockName ? `styles${appendedPath}` : `styles.blocks.${blockName}${appendedPath}`;
@@ -39,4 +39,4 @@ function getStyle(globalStyles, path, blockName, shouldDecodeEncode = true) {
39
39
  0 && (module.exports = {
40
40
  getStyle
41
41
  });
42
- //# sourceMappingURL=get-style.js.map
42
+ //# sourceMappingURL=get-style.cjs.map
@@ -23,7 +23,7 @@ __export(set_setting_exports, {
23
23
  setSetting: () => setSetting
24
24
  });
25
25
  module.exports = __toCommonJS(set_setting_exports);
26
- var import_object = require("../utils/object");
26
+ var import_object = require("../utils/object.cjs");
27
27
  function setSetting(globalStyles, path, newValue, blockName) {
28
28
  const appendedBlockPath = blockName ? ".blocks." + blockName : "";
29
29
  const appendedPropertyPath = path ? "." + path : "";
@@ -38,4 +38,4 @@ function setSetting(globalStyles, path, newValue, blockName) {
38
38
  0 && (module.exports = {
39
39
  setSetting
40
40
  });
41
- //# sourceMappingURL=set-setting.js.map
41
+ //# sourceMappingURL=set-setting.cjs.map
@@ -23,7 +23,7 @@ __export(set_style_exports, {
23
23
  setStyle: () => setStyle
24
24
  });
25
25
  module.exports = __toCommonJS(set_style_exports);
26
- var import_object = require("../utils/object");
26
+ var import_object = require("../utils/object.cjs");
27
27
  function setStyle(globalStyles, path, newValue, blockName) {
28
28
  const appendedPath = path ? "." + path : "";
29
29
  const finalPath = !blockName ? `styles${appendedPath}` : `styles.blocks.${blockName}${appendedPath}`;
@@ -37,4 +37,4 @@ function setStyle(globalStyles, path, newValue, blockName) {
37
37
  0 && (module.exports = {
38
38
  setStyle
39
39
  });
40
- //# sourceMappingURL=set-style.js.map
40
+ //# sourceMappingURL=set-style.cjs.map
@@ -16,4 +16,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  // packages/global-styles-engine/src/types.ts
17
17
  var types_exports = {};
18
18
  module.exports = __toCommonJS(types_exports);
19
- //# sourceMappingURL=types.js.map
19
+ //# sourceMappingURL=types.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/types.ts"],
4
- "sourcesContent": ["// =============================================================================\n// CORE PRIMITIVE TYPES\n// =============================================================================\n\n/**\n * Value that can be resolved from various sources (direct value, reference, or URL)\n */\nexport type UnresolvedValue =\n\t| string\n\t| number\n\t| { ref: string }\n\t| { url: string }\n\t| undefined\n\t| null;\n\n/**\n * Origin of a preset (theme, user customizations, or WordPress defaults)\n */\nexport type PresetOrigin = 'theme' | 'custom' | 'default';\n\n/**\n * Common properties for all preset types\n */\nexport interface BasePreset {\n\tname: string;\n\tslug: string;\n}\n\n// =============================================================================\n// COLOR SYSTEM TYPES\n// =============================================================================\n\n/**\n * Color preset definition\n */\nexport interface Color extends BasePreset {\n\tcolor: string;\n}\n\n/**\n * Gradient preset definition\n */\nexport interface Gradient extends BasePreset {\n\tgradient: string;\n}\n\n/**\n * Duotone filter preset definition\n */\nexport interface Duotone extends BasePreset {\n\tcolors: string[];\n}\n\n/**\n * Palette collection for a specific origin (theme, custom, default)\n */\nexport interface Palette {\n\tname: string;\n\tslug: PresetOrigin;\n\tcolors?: Color[];\n\tgradients?: Gradient[];\n\tduotones?: Duotone[];\n}\n\n/**\n * Multi-origin palette structure used by StyleBook\n */\nexport interface MultiOriginPalettes {\n\tcolors?: Palette[];\n\tgradients?: Palette[];\n\tduotones?: Palette[];\n\tdisableCustomColors?: boolean;\n\tdisableCustomGradients?: boolean;\n\thasColorsOrGradients?: boolean;\n}\n\n/**\n * Background style properties\n */\nexport interface BackgroundStyle {\n\tbackgroundColor?: UnresolvedValue;\n\tbackgroundImage?:\n\t\t| {\n\t\t\t\turl: string;\n\t\t\t\tid?: number;\n\t\t }\n\t\t| UnresolvedValue;\n\tbackgroundSize?: UnresolvedValue;\n\tbackgroundPosition?: UnresolvedValue;\n\tbackgroundRepeat?: UnresolvedValue;\n\tbackgroundAttachment?: UnresolvedValue;\n\tbackgroundBlendMode?: UnresolvedValue;\n\tbackgroundOpacity?: UnresolvedValue;\n}\n\n// =============================================================================\n// TYPOGRAPHY SYSTEM TYPES\n// =============================================================================\n\n/**\n * Fluid typography settings for responsive font sizes\n */\nexport interface FluidTypographyConfig {\n\tmin?: string;\n\tmax?: string;\n}\n\n/**\n * Typography preset (font size) definition\n */\nexport interface TypographyPreset extends BasePreset {\n\tsize: string | number | null;\n\tpreviewFontSize?: string;\n\tfluid?: boolean | FluidTypographyConfig;\n}\n\n/**\n * Font size preset definition (alias for TypographyPreset for clarity)\n */\nexport interface FontSizePreset extends TypographyPreset {}\n\n/**\n * Convenience type alias for font size data\n */\nexport type FontSize = FontSizePreset;\n\n/**\n * Font face definition as found in theme.json\n */\nexport interface FontFace {\n\tfontFamily: string;\n\tfontWeight?: string | number;\n\tfontStyle?: string;\n\tfontStretch?: string;\n\tfontDisplay?: string;\n\tsrc?: string | string[];\n}\n\n/**\n * Font family preset definition as found in theme.json\n */\nexport interface FontFamilyPreset extends BasePreset {\n\tfontFamily: string;\n\tfontFace?: FontFace[];\n}\n\n/**\n * Global fluid typography settings\n */\nexport interface FluidTypographySettings {\n\tmaxViewportWidth?: string;\n\tminFontSize?: string;\n\tminViewportWidth?: string;\n}\n\n/**\n * Typography settings collection\n */\nexport interface TypographySettings {\n\tfluid?: boolean | FluidTypographySettings;\n\tfontSizes?: TypographyPreset[] | Record< string, TypographyPreset[] >;\n\tfontFamilies?: Record< string, FontFamilyPreset[] >;\n\tdefaultFontSizes?: boolean;\n}\n\n// =============================================================================\n// LAYOUT SYSTEM TYPES\n// =============================================================================\n\n/**\n * Layout constraint settings\n */\nexport interface LayoutSettings {\n\twideSize?: string;\n\tcontentSize?: string;\n}\n\n/**\n * Spacing settings\n */\nexport interface SpacingSettings {\n\tpadding?: string | Record< string, string >;\n\tmargin?: string | Record< string, string >;\n\tblockGap?: string;\n}\n\n// =============================================================================\n// BLOCK SYSTEM TYPES (need to move to the blocks package eventually)\n// =============================================================================\n\n/**\n * Block type definition with global styles support\n */\nexport interface BlockType {\n\tname: string;\n\ttitle: string;\n\tcategory: string;\n\texample?: any;\n\tattributes?: Record< string, unknown >;\n\tsupports?: {\n\t\t__experimentalSelector?: string;\n\t\tinserter?: boolean;\n\t\tspacing?:\n\t\t\t| boolean\n\t\t\t| {\n\t\t\t\t\tblockGap?:\n\t\t\t\t\t\t| boolean\n\t\t\t\t\t\t| string[]\n\t\t\t\t\t\t| {\n\t\t\t\t\t\t\t\t__experimentalDefault?: string;\n\t\t\t\t\t\t\t\tsides: string[];\n\t\t\t\t\t\t };\n\t\t\t };\n\t\t[ key: string ]: unknown;\n\t};\n\tselectors?: Record< string, string | Record< string, string > >;\n}\n\n/**\n * Block style variation\n */\nexport interface BlockStyleVariation {\n\tname: string;\n\tlabel: string;\n\tstyles?: Record< string, any >;\n}\n\n// =============================================================================\n// GLOBAL STYLES STRUCTURE TYPES\n// =============================================================================\n\n/**\n * Global styles settings node\n */\nexport interface GlobalStylesSettings {\n\tuseRootPaddingAwareAlignments?: boolean;\n\ttypography?: TypographySettings;\n\tlayout?: LayoutSettings;\n\tspacing?: SpacingSettings;\n\tcolor?: {\n\t\tpalette?:\n\t\t\t| Color[]\n\t\t\t| {\n\t\t\t\t\ttheme?: Color[];\n\t\t\t\t\tcustom?: Color[];\n\t\t\t\t\tdefault?: Color[];\n\t\t\t };\n\t\tgradients?: {\n\t\t\ttheme?: Gradient[];\n\t\t\tcustom?: Gradient[];\n\t\t\tdefault?: Gradient[];\n\t\t};\n\t\tduotone?: {\n\t\t\ttheme?: Duotone[];\n\t\t\tcustom?: Duotone[];\n\t\t\tdefault?: Duotone[];\n\t\t};\n\t\tlink?: boolean;\n\t\tcustom?: boolean;\n\t\tcustomGradient?: boolean;\n\t\tcustomDuotone?: boolean;\n\t\tdefaultPalette?: boolean;\n\t\tdefaultGradients?: boolean;\n\t\tdefaultDuotone?: boolean;\n\t};\n\tcustom?: Record<\n\t\tstring,\n\t\tstring | number | Record< string, string | number >\n\t>;\n\tblocks?: Record< string, Omit< GlobalStylesSettings, 'blocks' > >;\n}\n\n/**\n * Global styles values node\n */\nexport interface GlobalStylesStyles {\n\tcolor?: {\n\t\tbackground?: UnresolvedValue;\n\t\ttext?: UnresolvedValue;\n\t};\n\ttypography?: {\n\t\tfontFamily?: UnresolvedValue;\n\t\tfontSize?: UnresolvedValue;\n\t\tfontWeight?: UnresolvedValue;\n\t\tlineHeight?: UnresolvedValue;\n\t\tletterSpacing?: UnresolvedValue;\n\t\ttextTransform?: UnresolvedValue;\n\t};\n\tspacing?: {\n\t\tpadding?: UnresolvedValue | Record< string, UnresolvedValue >;\n\t\tmargin?: UnresolvedValue | Record< string, UnresolvedValue >;\n\t\tblockGap?: string;\n\t};\n\tbackground?: BackgroundStyle;\n\tborder?: {\n\t\tcolor?: UnresolvedValue;\n\t\twidth?: UnresolvedValue;\n\t\tstyle?: UnresolvedValue;\n\t\tradius?:\n\t\t\t| UnresolvedValue\n\t\t\t| {\n\t\t\t\t\ttopLeft?: UnresolvedValue;\n\t\t\t\t\ttopRight?: UnresolvedValue;\n\t\t\t\t\tbottomRight?: UnresolvedValue;\n\t\t\t\t\tbottomLeft?: UnresolvedValue;\n\t\t\t };\n\t\ttop?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t\tright?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t\tbottom?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t\tleft?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t};\n\tfilter?: {\n\t\tduotone?: UnresolvedValue;\n\t\topacity?: UnresolvedValue;\n\t};\n\tdimensions?: {\n\t\twidth?: UnresolvedValue;\n\t\theight?: UnresolvedValue;\n\t\tminWidth?: UnresolvedValue;\n\t\tminHeight?: UnresolvedValue;\n\t\tmaxWidth?: UnresolvedValue;\n\t\tmaxHeight?: UnresolvedValue;\n\t};\n\telements?: Record<\n\t\tstring,\n\t\tOmit< GlobalStylesStyles, 'blocks' | 'elements' | 'variations' > & {\n\t\t\t':hover'?: Omit<\n\t\t\t\tGlobalStylesStyles,\n\t\t\t\t'blocks' | 'elements' | 'variations'\n\t\t\t>;\n\t\t}\n\t>;\n\tblocks?: Record< string, Omit< GlobalStylesStyles, 'blocks' > >;\n\tvariations?: Record< string, Omit< GlobalStylesStyles, 'blocks' > >;\n\tcss?: string;\n}\n\n/**\n * Complete global styles configuration\n */\nexport interface GlobalStylesConfig {\n\tversion?: number;\n\tsettings?: GlobalStylesSettings;\n\tstyles?: GlobalStylesStyles;\n\t_links?: {\n\t\t[ 'wp:theme-file' ]?: ThemeFileLink[];\n\t\t[ 'wp:action-edit-css' ]?: Array< { href: string } >;\n\t};\n}\n\n/**\n * Style variation (extends GlobalStylesConfig with metadata)\n */\nexport interface StyleVariation extends GlobalStylesConfig {\n\ttitle?: string;\n\tdescription?: string;\n}\n\n/**\n * WordPress theme file link\n */\nexport interface ThemeFileLink {\n\tname: string;\n\thref: string;\n\ttarget?: string;\n}\n\n// =============================================================================\n// UTILITY TYPES\n// =============================================================================\n\n/**\n * Deep partial type for global styles merging\n */\nexport type DeepPartial< T > = {\n\t[ P in keyof T ]?: T[ P ] extends object ? DeepPartial< T[ P ] > : T[ P ];\n};\n\n/**\n * CSS selector string\n */\nexport type CSSSelector = string;\n\n/**\n * CSS property value\n */\nexport type CSSValue = string | number | undefined;\n\n/**\n * CSS rules object\n */\nexport type CSSRules = Record< string, CSSValue >;\n"],
4
+ "sourcesContent": ["// =============================================================================\n// CORE PRIMITIVE TYPES\n// =============================================================================\n\n/**\n * Value that can be resolved from various sources (direct value, reference, or URL)\n */\nexport type UnresolvedValue =\n\t| string\n\t| number\n\t| { ref: string }\n\t| { url: string }\n\t| undefined\n\t| null;\n\n/**\n * Origin of a preset (theme, user customizations, or WordPress defaults)\n */\nexport type PresetOrigin = 'theme' | 'custom' | 'default';\n\n/**\n * Common properties for all preset types\n */\nexport interface BasePreset {\n\tname: string;\n\tslug: string;\n}\n\n// =============================================================================\n// COLOR SYSTEM TYPES\n// =============================================================================\n\n/**\n * Color preset definition\n */\nexport interface Color extends BasePreset {\n\tcolor: string;\n}\n\n/**\n * Gradient preset definition\n */\nexport interface Gradient extends BasePreset {\n\tgradient: string;\n}\n\n/**\n * Duotone filter preset definition\n */\nexport interface Duotone extends BasePreset {\n\tcolors: string[];\n}\n\n/**\n * Palette collection for a specific origin (theme, custom, default)\n */\nexport interface Palette {\n\tname: string;\n\tslug: PresetOrigin;\n\tcolors?: Color[];\n\tgradients?: Gradient[];\n\tduotones?: Duotone[];\n}\n\n/**\n * Multi-origin palette structure used by StyleBook\n */\nexport interface MultiOriginPalettes {\n\tcolors?: Palette[];\n\tgradients?: Palette[];\n\tduotones?: Palette[];\n\tdisableCustomColors?: boolean;\n\tdisableCustomGradients?: boolean;\n\thasColorsOrGradients?: boolean;\n}\n\n/**\n * Background style properties\n */\nexport interface BackgroundStyle {\n\tbackgroundColor?: UnresolvedValue;\n\tbackgroundImage?:\n\t\t| {\n\t\t\t\turl: string;\n\t\t\t\tid?: number;\n\t\t }\n\t\t| UnresolvedValue;\n\tbackgroundSize?: UnresolvedValue;\n\tbackgroundPosition?: UnresolvedValue;\n\tbackgroundRepeat?: UnresolvedValue;\n\tbackgroundAttachment?: UnresolvedValue;\n\tbackgroundBlendMode?: UnresolvedValue;\n\tbackgroundOpacity?: UnresolvedValue;\n}\n\n// =============================================================================\n// TYPOGRAPHY SYSTEM TYPES\n// =============================================================================\n\n/**\n * Fluid typography settings for responsive font sizes\n */\nexport interface FluidTypographyConfig {\n\tmin?: string;\n\tmax?: string;\n}\n\n/**\n * Typography preset (font size) definition\n */\nexport interface TypographyPreset extends BasePreset {\n\tsize: string | number | null;\n\tpreviewFontSize?: string;\n\tfluid?: boolean | FluidTypographyConfig;\n}\n\n/**\n * Font size preset definition (alias for TypographyPreset for clarity)\n */\nexport interface FontSizePreset extends TypographyPreset {}\n\n/**\n * Convenience type alias for font size data\n */\nexport type FontSize = FontSizePreset;\n\n/**\n * Font face definition as found in theme.json\n */\nexport interface FontFace {\n\tfontFamily: string;\n\tfontWeight?: string | number;\n\tfontStyle?: string;\n\tfontStretch?: string;\n\tfontDisplay?: string;\n\tsrc?: string | string[];\n}\n\n/**\n * Font family preset definition as found in theme.json\n */\nexport interface FontFamilyPreset extends BasePreset {\n\tfontFamily: string;\n\tfontFace?: FontFace[];\n}\n\n/**\n * Global fluid typography settings\n */\nexport interface FluidTypographySettings {\n\tmaxViewportWidth?: string;\n\tminFontSize?: string;\n\tminViewportWidth?: string;\n}\n\n/**\n * Typography settings collection\n */\nexport interface TypographySettings {\n\tfluid?: boolean | FluidTypographySettings;\n\tfontSizes?: TypographyPreset[] | Record< string, TypographyPreset[] >;\n\tfontFamilies?: Record< string, FontFamilyPreset[] >;\n\tdefaultFontSizes?: boolean;\n}\n\n// =============================================================================\n// LAYOUT SYSTEM TYPES\n// =============================================================================\n\n/**\n * Layout constraint settings\n */\nexport interface LayoutSettings {\n\twideSize?: string;\n\tcontentSize?: string;\n}\n\n/**\n * Spacing settings\n */\nexport interface SpacingSettings {\n\tpadding?: string | Record< string, string >;\n\tmargin?: string | Record< string, string >;\n\tblockGap?: string;\n}\n\n// =============================================================================\n// BLOCK SYSTEM TYPES (need to move to the blocks package eventually)\n// =============================================================================\n\n/**\n * Block type definition with global styles support\n */\nexport interface BlockType {\n\tname: string;\n\ttitle: string;\n\tcategory: string;\n\texample?: any;\n\tattributes?: Record< string, unknown >;\n\tsupports?: {\n\t\t__experimentalSelector?: string;\n\t\tinserter?: boolean;\n\t\tspacing?:\n\t\t\t| boolean\n\t\t\t| {\n\t\t\t\t\tblockGap?:\n\t\t\t\t\t\t| boolean\n\t\t\t\t\t\t| string[]\n\t\t\t\t\t\t| {\n\t\t\t\t\t\t\t\t__experimentalDefault?: string;\n\t\t\t\t\t\t\t\tsides: string[];\n\t\t\t\t\t\t };\n\t\t\t };\n\t\t[ key: string ]: unknown;\n\t};\n\tselectors?: Record< string, string | Record< string, string > >;\n}\n\n/**\n * Block style variation\n */\nexport interface BlockStyleVariation {\n\tname: string;\n\tlabel: string;\n\tstyles?: Record< string, any >;\n}\n\n// =============================================================================\n// GLOBAL STYLES STRUCTURE TYPES\n// =============================================================================\n\n/**\n * Global styles settings node\n */\nexport interface GlobalStylesSettings {\n\tuseRootPaddingAwareAlignments?: boolean;\n\ttypography?: TypographySettings;\n\tlayout?: LayoutSettings;\n\tspacing?: SpacingSettings;\n\tcolor?: {\n\t\tpalette?:\n\t\t\t| Color[]\n\t\t\t| {\n\t\t\t\t\ttheme?: Color[];\n\t\t\t\t\tcustom?: Color[];\n\t\t\t\t\tdefault?: Color[];\n\t\t\t };\n\t\tgradients?: {\n\t\t\ttheme?: Gradient[];\n\t\t\tcustom?: Gradient[];\n\t\t\tdefault?: Gradient[];\n\t\t};\n\t\tduotone?: {\n\t\t\ttheme?: Duotone[];\n\t\t\tcustom?: Duotone[];\n\t\t\tdefault?: Duotone[];\n\t\t};\n\t\tlink?: boolean;\n\t\tcustom?: boolean;\n\t\tcustomGradient?: boolean;\n\t\tcustomDuotone?: boolean;\n\t\tdefaultPalette?: boolean;\n\t\tdefaultGradients?: boolean;\n\t\tdefaultDuotone?: boolean;\n\t};\n\tcustom?: Record<\n\t\tstring,\n\t\tstring | number | Record< string, string | number >\n\t>;\n\tblocks?: Record< string, Omit< GlobalStylesSettings, 'blocks' > >;\n}\n\n/**\n * Global styles values node\n */\nexport interface GlobalStylesStyles {\n\tcolor?: {\n\t\tbackground?: UnresolvedValue;\n\t\ttext?: UnresolvedValue;\n\t};\n\ttypography?: {\n\t\tfontFamily?: UnresolvedValue;\n\t\tfontSize?: UnresolvedValue;\n\t\tfontWeight?: UnresolvedValue;\n\t\tlineHeight?: UnresolvedValue;\n\t\tletterSpacing?: UnresolvedValue;\n\t\ttextTransform?: UnresolvedValue;\n\t\ttextIndent?: UnresolvedValue;\n\t};\n\tspacing?: {\n\t\tpadding?: UnresolvedValue | Record< string, UnresolvedValue >;\n\t\tmargin?: UnresolvedValue | Record< string, UnresolvedValue >;\n\t\tblockGap?: string;\n\t};\n\tbackground?: BackgroundStyle;\n\tborder?: {\n\t\tcolor?: UnresolvedValue;\n\t\twidth?: UnresolvedValue;\n\t\tstyle?: UnresolvedValue;\n\t\tradius?:\n\t\t\t| UnresolvedValue\n\t\t\t| {\n\t\t\t\t\ttopLeft?: UnresolvedValue;\n\t\t\t\t\ttopRight?: UnresolvedValue;\n\t\t\t\t\tbottomRight?: UnresolvedValue;\n\t\t\t\t\tbottomLeft?: UnresolvedValue;\n\t\t\t };\n\t\ttop?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t\tright?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t\tbottom?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t\tleft?: {\n\t\t\tcolor?: UnresolvedValue;\n\t\t\twidth?: UnresolvedValue;\n\t\t\tstyle?: UnresolvedValue;\n\t\t};\n\t};\n\tfilter?: {\n\t\tduotone?: UnresolvedValue;\n\t\topacity?: UnresolvedValue;\n\t};\n\tdimensions?: {\n\t\twidth?: UnresolvedValue;\n\t\theight?: UnresolvedValue;\n\t\tminWidth?: UnresolvedValue;\n\t\tminHeight?: UnresolvedValue;\n\t\tmaxWidth?: UnresolvedValue;\n\t\tmaxHeight?: UnresolvedValue;\n\t};\n\telements?: Record<\n\t\tstring,\n\t\tOmit< GlobalStylesStyles, 'blocks' | 'elements' | 'variations' > & {\n\t\t\t':hover'?: Omit<\n\t\t\t\tGlobalStylesStyles,\n\t\t\t\t'blocks' | 'elements' | 'variations'\n\t\t\t>;\n\t\t}\n\t>;\n\tblocks?: Record< string, Omit< GlobalStylesStyles, 'blocks' > >;\n\tvariations?: Record< string, Omit< GlobalStylesStyles, 'blocks' > >;\n\tcss?: string;\n}\n\n/**\n * Complete global styles configuration\n */\nexport interface GlobalStylesConfig {\n\tversion?: number;\n\tsettings?: GlobalStylesSettings;\n\tstyles?: GlobalStylesStyles;\n\t_links?: {\n\t\t[ 'wp:theme-file' ]?: ThemeFileLink[];\n\t\t[ 'wp:action-edit-css' ]?: Array< { href: string } >;\n\t};\n}\n\n/**\n * Style variation (extends GlobalStylesConfig with metadata)\n */\nexport interface StyleVariation extends GlobalStylesConfig {\n\ttitle?: string;\n\tdescription?: string;\n}\n\n/**\n * WordPress theme file link\n */\nexport interface ThemeFileLink {\n\tname: string;\n\thref: string;\n\ttarget?: string;\n}\n\n// =============================================================================\n// UTILITY TYPES\n// =============================================================================\n\n/**\n * Deep partial type for global styles merging\n */\nexport type DeepPartial< T > = {\n\t[ P in keyof T ]?: T[ P ] extends object ? DeepPartial< T[ P ] > : T[ P ];\n};\n\n/**\n * CSS selector string\n */\nexport type CSSSelector = string;\n\n/**\n * CSS property value\n */\nexport type CSSValue = string | number | undefined;\n\n/**\n * CSS rules object\n */\nexport type CSSRules = Record< string, CSSValue >;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -52,4 +52,4 @@ function setBackgroundStyleDefaults(backgroundStyle) {
52
52
  BACKGROUND_BLOCK_DEFAULT_VALUES,
53
53
  setBackgroundStyleDefaults
54
54
  });
55
- //# sourceMappingURL=background.js.map
55
+ //# sourceMappingURL=background.cjs.map
@@ -36,8 +36,8 @@ __export(common_exports, {
36
36
  });
37
37
  module.exports = __toCommonJS(common_exports);
38
38
  var import_style_engine = require("@wordpress/style-engine");
39
- var import_typography = require("./typography");
40
- var import_object = require("./object");
39
+ var import_typography = require("./typography.cjs");
40
+ var import_object = require("./object.cjs");
41
41
  var ROOT_BLOCK_SELECTOR = "body";
42
42
  var ROOT_CSS_PROPERTIES_SELECTOR = ":root";
43
43
  var PRESET_METADATA = [
@@ -108,6 +108,12 @@ var PRESET_METADATA = [
108
108
  valueKey: "size",
109
109
  cssVarInfix: "border-radius",
110
110
  classes: []
111
+ },
112
+ {
113
+ path: ["dimensions", "dimensionSizes"],
114
+ valueKey: "size",
115
+ cssVarInfix: "dimension",
116
+ classes: []
111
117
  }
112
118
  ];
113
119
  var STYLE_PATH_TO_CSS_VAR_INFIX = {
@@ -417,4 +423,4 @@ function getPresetVariableFromValue(features, blockName, variableStylePath, pres
417
423
  scopeFeatureSelectors,
418
424
  scopeSelector
419
425
  });
420
- //# sourceMappingURL=common.js.map
426
+ //# sourceMappingURL=common.cjs.map