@wordpress/global-styles-engine 1.4.0 → 1.4.1-next.06ee73755.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 (116) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +1 -1
  3. package/build/core/{equal.js → equal.cjs} +2 -2
  4. package/build/core/equal.cjs.map +7 -0
  5. package/build/core/{merge.js → merge.cjs} +1 -1
  6. package/build/core/{render.js → render.cjs} +11 -11
  7. package/build/core/{selectors.js → selectors.cjs} +3 -3
  8. package/build/{index.js → index.cjs} +17 -14
  9. package/build/{index.js.map → index.cjs.map} +2 -2
  10. package/build/settings/{get-palette.js → get-palette.cjs} +2 -2
  11. package/build/settings/{get-setting.js → get-setting.cjs} +4 -2
  12. package/build/settings/get-setting.cjs.map +7 -0
  13. package/build/settings/{get-style.js → get-style.cjs} +3 -3
  14. package/build/settings/{set-setting.js → set-setting.cjs} +2 -2
  15. package/build/settings/{set-style.js → set-style.cjs} +2 -2
  16. package/build/{types.js → types.cjs} +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} +1 -1
  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/{equal.js → equal.mjs} +2 -2
  32. package/build-module/core/equal.mjs.map +7 -0
  33. package/build-module/core/{merge.js → merge.mjs} +1 -1
  34. package/build-module/core/{render.js → render.mjs} +11 -11
  35. package/build-module/core/{selectors.js → selectors.mjs} +3 -3
  36. package/build-module/index.mjs +44 -0
  37. package/build-module/{index.js.map → index.mjs.map} +2 -2
  38. package/build-module/settings/{get-palette.js → get-palette.mjs} +2 -2
  39. package/build-module/settings/{get-setting.js → get-setting.mjs} +4 -2
  40. package/build-module/settings/get-setting.mjs.map +7 -0
  41. package/build-module/settings/{get-style.js → get-style.mjs} +3 -3
  42. package/build-module/settings/{set-setting.js → set-setting.mjs} +2 -2
  43. package/build-module/settings/{set-style.js → set-style.mjs} +2 -2
  44. package/build-module/types.mjs +1 -0
  45. package/build-module/utils/{background.js → background.mjs} +1 -1
  46. package/build-module/utils/{common.js → common.mjs} +9 -3
  47. package/build-module/utils/common.mjs.map +7 -0
  48. package/build-module/utils/dimensions.mjs +15 -0
  49. package/build-module/utils/dimensions.mjs.map +7 -0
  50. package/build-module/utils/{duotone.js → duotone.mjs} +1 -1
  51. package/build-module/utils/{fluid.js → fluid.mjs} +1 -1
  52. package/build-module/utils/{gap.js → gap.mjs} +2 -2
  53. package/build-module/utils/{get-global-styles-changes.js → get-global-styles-changes.mjs} +1 -1
  54. package/build-module/utils/{layout.js → layout.mjs} +1 -1
  55. package/build-module/utils/{object.js → object.mjs} +1 -1
  56. package/build-module/utils/{spacing.js → spacing.mjs} +1 -1
  57. package/build-module/utils/{string.js → string.mjs} +1 -1
  58. package/build-module/utils/{typography.js → typography.mjs} +2 -2
  59. package/build-types/index.d.ts +1 -0
  60. package/build-types/index.d.ts.map +1 -1
  61. package/build-types/settings/get-setting.d.ts.map +1 -1
  62. package/build-types/utils/common.d.ts.map +1 -1
  63. package/build-types/utils/dimensions.d.ts +2 -0
  64. package/build-types/utils/dimensions.d.ts.map +1 -0
  65. package/package.json +21 -10
  66. package/src/core/equal.ts +1 -1
  67. package/src/index.ts +1 -0
  68. package/src/settings/get-setting.ts +2 -0
  69. package/src/utils/common.ts +6 -0
  70. package/src/utils/dimensions.ts +13 -0
  71. package/build/core/equal.js.map +0 -7
  72. package/build/settings/get-setting.js.map +0 -7
  73. package/build/utils/common.js.map +0 -7
  74. package/build-module/core/equal.js.map +0 -7
  75. package/build-module/index.js +0 -42
  76. package/build-module/settings/get-setting.js.map +0 -7
  77. package/build-module/types.js +0 -1
  78. package/build-module/utils/common.js.map +0 -7
  79. package/tsconfig.json +0 -18
  80. package/tsconfig.tsbuildinfo +0 -1
  81. /package/build/core/{merge.js.map → merge.cjs.map} +0 -0
  82. /package/build/core/{render.js.map → render.cjs.map} +0 -0
  83. /package/build/core/{selectors.js.map → selectors.cjs.map} +0 -0
  84. /package/build/settings/{get-palette.js.map → get-palette.cjs.map} +0 -0
  85. /package/build/settings/{get-style.js.map → get-style.cjs.map} +0 -0
  86. /package/build/settings/{set-setting.js.map → set-setting.cjs.map} +0 -0
  87. /package/build/settings/{set-style.js.map → set-style.cjs.map} +0 -0
  88. /package/build/{types.js.map → types.cjs.map} +0 -0
  89. /package/build/utils/{background.js.map → background.cjs.map} +0 -0
  90. /package/build/utils/{duotone.js.map → duotone.cjs.map} +0 -0
  91. /package/build/utils/{fluid.js.map → fluid.cjs.map} +0 -0
  92. /package/build/utils/{gap.js.map → gap.cjs.map} +0 -0
  93. /package/build/utils/{get-global-styles-changes.js.map → get-global-styles-changes.cjs.map} +0 -0
  94. /package/build/utils/{layout.js.map → layout.cjs.map} +0 -0
  95. /package/build/utils/{object.js.map → object.cjs.map} +0 -0
  96. /package/build/utils/{spacing.js.map → spacing.cjs.map} +0 -0
  97. /package/build/utils/{string.js.map → string.cjs.map} +0 -0
  98. /package/build/utils/{typography.js.map → typography.cjs.map} +0 -0
  99. /package/build-module/core/{merge.js.map → merge.mjs.map} +0 -0
  100. /package/build-module/core/{render.js.map → render.mjs.map} +0 -0
  101. /package/build-module/core/{selectors.js.map → selectors.mjs.map} +0 -0
  102. /package/build-module/settings/{get-palette.js.map → get-palette.mjs.map} +0 -0
  103. /package/build-module/settings/{get-style.js.map → get-style.mjs.map} +0 -0
  104. /package/build-module/settings/{set-setting.js.map → set-setting.mjs.map} +0 -0
  105. /package/build-module/settings/{set-style.js.map → set-style.mjs.map} +0 -0
  106. /package/build-module/{types.js.map → types.mjs.map} +0 -0
  107. /package/build-module/utils/{background.js.map → background.mjs.map} +0 -0
  108. /package/build-module/utils/{duotone.js.map → duotone.mjs.map} +0 -0
  109. /package/build-module/utils/{fluid.js.map → fluid.mjs.map} +0 -0
  110. /package/build-module/utils/{gap.js.map → gap.mjs.map} +0 -0
  111. /package/build-module/utils/{get-global-styles-changes.js.map → get-global-styles-changes.mjs.map} +0 -0
  112. /package/build-module/utils/{layout.js.map → layout.mjs.map} +0 -0
  113. /package/build-module/utils/{object.js.map → object.mjs.map} +0 -0
  114. /package/build-module/utils/{spacing.js.map → spacing.mjs.map} +0 -0
  115. /package/build-module/utils/{string.js.map → string.mjs.map} +0 -0
  116. /package/build-module/utils/{typography.js.map → typography.mjs.map} +0 -0
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2025 by the contributors
3
+ Copyright 2016-2026 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
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/index.js"));
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
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/core/equal.ts"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * Internal dependencies\n */\nimport type { GlobalStylesConfig } from '../types';\n\n/**\n * Compares global style variations according to their styles and settings properties.\n *\n * @param original A global styles object.\n * @param variation A global styles object.\n * @return Whether `original` and `variation` match.\n */\nexport function areGlobalStylesEqual(\n\toriginal: GlobalStylesConfig,\n\tvariation: GlobalStylesConfig\n): boolean {\n\tif ( typeof original !== 'object' || typeof variation !== 'object' ) {\n\t\treturn original === variation;\n\t}\n\treturn (\n\t\tfastDeepEqual( original?.styles, variation?.styles ) &&\n\t\tfastDeepEqual( original?.settings, variation?.settings )\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAA0B;AAcnB,SAAS,qBACf,UACA,WACU;AACV,MAAK,OAAO,aAAa,YAAY,OAAO,cAAc,UAAW;AACpE,WAAO,aAAa;AAAA,EACrB;AACA,aACC,WAAAA,SAAe,UAAU,QAAQ,WAAW,MAAO,SACnD,WAAAA,SAAe,UAAU,UAAU,WAAW,QAAS;AAEzD;",
6
+ "names": ["fastDeepEqual"]
7
+ }
@@ -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"
@@ -999,4 +999,4 @@ function generateGlobalStyles(config = {}, blockTypes = [], options = {}) {
999
999
  processCSSNesting,
1000
1000
  transformToStyles
1001
1001
  });
1002
- //# sourceMappingURL=render.js.map
1002
+ //# sourceMappingURL=render.cjs.map
@@ -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"));
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"));
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
@@ -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
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/common.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getCSSValueFromRawStyle } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tGlobalStylesSettings,\n\tThemeFileLink,\n\tTypographyPreset,\n\tUnresolvedValue,\n\tGlobalStylesConfig,\n} from '../types';\nimport { getTypographyFontSizeValue } from './typography';\nimport { getValueFromObjectPath } from './object';\n\nexport const ROOT_BLOCK_SELECTOR = 'body';\nexport const ROOT_CSS_PROPERTIES_SELECTOR = ':root';\n\nexport const PRESET_METADATA = [\n\t{\n\t\tpath: [ 'color', 'palette' ],\n\t\tvalueKey: 'color',\n\t\tcssVarInfix: 'color',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'color', propertyName: 'color' },\n\t\t\t{\n\t\t\t\tclassSuffix: 'background-color',\n\t\t\t\tpropertyName: 'background-color',\n\t\t\t},\n\t\t\t{\n\t\t\t\tclassSuffix: 'border-color',\n\t\t\t\tpropertyName: 'border-color',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'gradients' ],\n\t\tvalueKey: 'gradient',\n\t\tcssVarInfix: 'gradient',\n\t\tclasses: [\n\t\t\t{\n\t\t\t\tclassSuffix: 'gradient-background',\n\t\t\t\tpropertyName: 'background',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'duotone' ],\n\t\tvalueKey: 'colors',\n\t\tcssVarInfix: 'duotone',\n\t\tvalueFunc: ( { slug }: { slug: string } ) =>\n\t\t\t`url( '#wp-duotone-${ slug }' )`,\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'shadow', 'presets' ],\n\t\tvalueKey: 'shadow',\n\t\tcssVarInfix: 'shadow',\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontSizes' ],\n\t\tvalueFunc: (\n\t\t\tpreset: TypographyPreset,\n\t\t\tsettings: GlobalStylesSettings\n\t\t) => getTypographyFontSizeValue( preset, settings ),\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'font-size',\n\t\tclasses: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontFamilies' ],\n\t\tvalueKey: 'fontFamily',\n\t\tcssVarInfix: 'font-family',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'font-family', propertyName: 'font-family' },\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'spacing', 'spacingSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'spacing',\n\t\tvalueFunc: ( { size }: { size: string } ) => size,\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'border', 'radiusSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'border-radius',\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'dimensions', 'dimensionSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'dimension',\n\t\tclasses: [],\n\t},\n];\n\nexport const STYLE_PATH_TO_CSS_VAR_INFIX: Record< string, string > = {\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'filter.duotone': 'duotone',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.caption.color.text': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tshadow: 'shadow',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n/**\n * Function that scopes a selector with another one. This works a bit like\n * SCSS nesting except the `&` operator isn't supported.\n *\n * @example\n * ```js\n * const scope = '.a, .b .c';\n * const selector = '> .x, .y';\n * const merged = scopeSelector( scope, selector );\n * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'\n * ```\n *\n * @param scope Selector to scope to.\n * @param selector Original selector.\n *\n * @return Scoped selector.\n */\nexport function scopeSelector( scope: string | undefined, selector: string ) {\n\tif ( ! scope || ! selector ) {\n\t\treturn selector;\n\t}\n\n\tconst scopes = scope.split( ',' );\n\tconst selectors = selector.split( ',' );\n\n\tconst selectorsScoped: string[] = [];\n\tscopes.forEach( ( outer ) => {\n\t\tselectors.forEach( ( inner ) => {\n\t\t\tselectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );\n\t\t} );\n\t} );\n\n\treturn selectorsScoped.join( ', ' );\n}\n\n/**\n * Scopes a collection of selectors for features and subfeatures.\n *\n * @example\n * ```js\n * const scope = '.custom-scope';\n * const selectors = {\n * color: '.wp-my-block p',\n * typography: { fontSize: '.wp-my-block caption' },\n * };\n * const result = scopeFeatureSelector( scope, selectors );\n * // result is {\n * // color: '.custom-scope .wp-my-block p',\n * // typography: { fonSize: '.custom-scope .wp-my-block caption' },\n * // }\n * ```\n *\n * @param scope Selector to scope collection of selectors with.\n * @param selectors Collection of feature selectors e.g.\n *\n * @return Scoped collection of feature selectors.\n */\nexport function scopeFeatureSelectors(\n\tscope: string | undefined,\n\tselectors: string | Record< string, string | Record< string, string > >\n) {\n\tif ( ! scope || ! selectors ) {\n\t\treturn;\n\t}\n\n\tconst featureSelectors: Record<\n\t\tstring,\n\t\tstring | Record< string, string >\n\t> = {};\n\n\tObject.entries( selectors ).forEach( ( [ feature, selector ] ) => {\n\t\tif ( typeof selector === 'string' ) {\n\t\t\tfeatureSelectors[ feature ] = scopeSelector( scope, selector );\n\t\t}\n\n\t\tif ( typeof selector === 'object' ) {\n\t\t\tfeatureSelectors[ feature ] = {};\n\n\t\t\tObject.entries( selector ).forEach(\n\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\tfeatureSelectors[ feature ][ subfeature ] = scopeSelector(\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tsubfeatureSelector as string\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn featureSelectors;\n}\n\n/**\n * Appends a sub-selector to an existing one.\n *\n * Given the compounded `selector` \"h1, h2, h3\"\n * and the `toAppend` selector \".some-class\" the result will be\n * \"h1.some-class, h2.some-class, h3.some-class\".\n *\n * @param selector Original selector.\n * @param toAppend Selector to append.\n *\n * @return The new selector.\n */\nexport function appendToSelector( selector: string, toAppend: string ) {\n\tif ( ! selector.includes( ',' ) ) {\n\t\treturn selector + toAppend;\n\t}\n\tconst selectors = selector.split( ',' );\n\tconst newSelectors = selectors.map( ( sel ) => sel + toAppend );\n\treturn newSelectors.join( ',' );\n}\n\n/**\n * Generates the selector for a block style variation by creating the\n * appropriate CSS class and adding it to the ancestor portion of the block's\n * selector.\n *\n * For example, take the Button block which has a compound selector:\n * `.wp-block-button .wp-block-button__link`. With a variation named 'custom',\n * the class `.is-style-custom` should be added to the `.wp-block-button`\n * ancestor only.\n *\n * This function will take into account comma separated and complex selectors.\n *\n * @param variation Name for the variation.\n * @param blockSelector CSS selector for the block.\n *\n * @return CSS selector for the block style variation.\n */\nexport function getBlockStyleVariationSelector(\n\tvariation: string,\n\tblockSelector: string\n) {\n\tconst variationClass = `.is-style-${ variation }`;\n\n\tif ( ! blockSelector ) {\n\t\treturn variationClass;\n\t}\n\n\tconst ancestorRegex = /((?::\\([^)]+\\))?\\s*)([^\\s:]+)/;\n\tconst addVariationClass = (\n\t\t_match: string,\n\t\tgroup1: string,\n\t\tgroup2: string\n\t) => {\n\t\treturn group1 + group2 + variationClass;\n\t};\n\n\tconst result = blockSelector\n\t\t.split( ',' )\n\t\t.map( ( part ) => part.replace( ancestorRegex, addVariationClass ) );\n\n\treturn result.join( ',' );\n}\n\n/**\n * Resolves ref values in theme JSON.\n *\n * @param ruleValue A block style value that may contain a reference to a theme.json value.\n * @param tree A theme.json object.\n * @return The resolved value or incoming ruleValue.\n */\nexport function getResolvedRefValue(\n\truleValue: UnresolvedValue,\n\ttree?: GlobalStylesConfig\n): UnresolvedValue {\n\tif ( ! ruleValue || ! tree ) {\n\t\treturn ruleValue;\n\t}\n\n\t/*\n\t * Where the rule value is an object with a 'ref' property pointing\n\t * to a path, this converts that path into the value at that path.\n\t * For example: { \"ref\": \"style.color.background\" } => \"#fff\".\n\t */\n\tif (\n\t\ttypeof ruleValue === 'object' &&\n\t\t'ref' in ruleValue &&\n\t\truleValue?.ref\n\t) {\n\t\tconst resolvedRuleValue = getCSSValueFromRawStyle(\n\t\t\tgetValueFromObjectPath( tree, ruleValue.ref )\n\t\t) as UnresolvedValue;\n\n\t\t/*\n\t\t * Presence of another ref indicates a reference to another dynamic value.\n\t\t * Pointing to another dynamic value is not supported.\n\t\t */\n\t\tif (\n\t\t\ttypeof resolvedRuleValue === 'object' &&\n\t\t\tresolvedRuleValue !== null &&\n\t\t\t'ref' in resolvedRuleValue &&\n\t\t\tresolvedRuleValue?.ref\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ( resolvedRuleValue === undefined ) {\n\t\t\treturn ruleValue;\n\t\t}\n\n\t\treturn resolvedRuleValue;\n\t}\n\treturn ruleValue;\n}\n\n/**\n * Looks up a theme file URI based on a relative path.\n *\n * @param file A relative path.\n * @param themeFileURIs A collection of absolute theme file URIs and their corresponding file paths.\n * @return A resolved theme file URI, if one is found in the themeFileURIs collection.\n */\nexport function getResolvedThemeFilePath(\n\tfile: string,\n\tthemeFileURIs?: ThemeFileLink[]\n) {\n\tif ( ! file || ! themeFileURIs || ! Array.isArray( themeFileURIs ) ) {\n\t\treturn file;\n\t}\n\n\tconst uri = themeFileURIs.find(\n\t\t( themeFileUri ) => themeFileUri?.name === file\n\t);\n\n\tif ( ! uri?.href ) {\n\t\treturn file;\n\t}\n\n\treturn uri?.href;\n}\n\n/**\n * Resolves ref and relative path values in theme JSON.\n *\n * @param ruleValue A block style value that may contain a reference to a theme.json value.\n * @param tree A theme.json object.\n * @return The resolved value or incoming ruleValue.\n */\nexport function getResolvedValue(\n\truleValue: UnresolvedValue,\n\ttree: GlobalStylesConfig | undefined\n) {\n\tif ( ! ruleValue || ! tree ) {\n\t\treturn ruleValue;\n\t}\n\n\t// Resolve ref values.\n\tconst resolvedValue = getResolvedRefValue( ruleValue, tree );\n\n\t// Resolve relative paths.\n\tif (\n\t\ttypeof resolvedValue === 'object' &&\n\t\tresolvedValue !== null &&\n\t\t'url' in resolvedValue &&\n\t\tresolvedValue?.url\n\t) {\n\t\tresolvedValue.url = getResolvedThemeFilePath(\n\t\t\tresolvedValue.url,\n\t\t\ttree?._links?.[ 'wp:theme-file' ]\n\t\t);\n\t}\n\n\treturn resolvedValue;\n}\n\nfunction findInPresetsBy(\n\tsettings: GlobalStylesSettings,\n\tblockName?: string,\n\tpresetPath: string[] = [],\n\tpresetProperty: string = 'slug',\n\tpresetValueValue?: string\n) {\n\t// Block presets take priority above root level presets.\n\tconst orderedPresetsByOrigin = [\n\t\tblockName\n\t\t\t? getValueFromObjectPath( settings, [\n\t\t\t\t\t'blocks',\n\t\t\t\t\tblockName,\n\t\t\t\t\t...presetPath,\n\t\t\t ] )\n\t\t\t: undefined,\n\t\tgetValueFromObjectPath( settings, presetPath ),\n\t].filter( Boolean );\n\n\tfor ( const presetByOrigin of orderedPresetsByOrigin ) {\n\t\tif ( presetByOrigin ) {\n\t\t\t// Preset origins ordered by priority.\n\t\t\tconst origins = [ 'custom', 'theme', 'default' ];\n\t\t\tfor ( const origin of origins ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tconst presets = presetByOrigin[ origin ];\n\t\t\t\tif ( presets ) {\n\t\t\t\t\tconst presetObject = presets.find(\n\t\t\t\t\t\t( preset: any ) =>\n\t\t\t\t\t\t\tpreset[ presetProperty ] === presetValueValue\n\t\t\t\t\t);\n\t\t\t\t\tif ( presetObject ) {\n\t\t\t\t\t\tif ( presetProperty === 'slug' ) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.\n\t\t\t\t\t\tconst highestPresetObjectWithSameSlug = findInPresetsBy(\n\t\t\t\t\t\t\tsettings,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpresetPath,\n\t\t\t\t\t\t\t'slug',\n\t\t\t\t\t\t\tpresetObject.slug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\thighestPresetObjectWithSameSlug[\n\t\t\t\t\t\t\t\tpresetProperty\n\t\t\t\t\t\t\t] === presetObject[ presetProperty ]\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getValueFromPresetVariable(\n\tfeatures: GlobalStylesConfig,\n\tblockName?: string,\n\tvariable?: string,\n\t[ presetType, slug ]: string[] = []\n) {\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === presetType\n\t);\n\tif ( ! metadata || ! features.settings ) {\n\t\treturn variable;\n\t}\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures.settings,\n\t\tblockName,\n\t\tmetadata.path,\n\t\t'slug',\n\t\tslug\n\t);\n\n\tif ( presetObject ) {\n\t\tconst { valueKey } = metadata;\n\t\tconst result = presetObject[ valueKey ];\n\t\treturn getValueFromVariable( features, blockName, result );\n\t}\n\n\treturn variable;\n}\n\nfunction getValueFromCustomVariable(\n\tfeatures: GlobalStylesConfig,\n\tblockName?: string,\n\tvariable?: string,\n\tpath: string[] = []\n): string | undefined {\n\tconst result =\n\t\t( blockName\n\t\t\t? getValueFromObjectPath( features?.settings ?? {}, [\n\t\t\t\t\t'blocks',\n\t\t\t\t\tblockName,\n\t\t\t\t\t'custom',\n\t\t\t\t\t...path,\n\t\t\t ] )\n\t\t\t: undefined ) ??\n\t\tgetValueFromObjectPath( features?.settings ?? {}, [\n\t\t\t'custom',\n\t\t\t...path,\n\t\t] );\n\tif ( ! result ) {\n\t\treturn variable;\n\t}\n\t// A variable may reference another variable so we need recursion until we find the value.\n\treturn getValueFromVariable( features, blockName, result as string );\n}\n\n/**\n * Attempts to fetch the value of a theme.json CSS variable.\n *\n * This function resolves CSS variable references in two formats:\n * - User format: `var:preset|color|red` or `var:custom|spacing|small`\n * - Theme format: `var(--wp--preset--color--red)` or `var(--wp--custom--spacing--small)`\n *\n * It also handles ref-style variables in the format `{ ref: \"path.to.value\" }`.\n *\n * @param features GlobalStylesContext config (user, base, or merged). Represents the theme.json tree.\n * @param blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/block-name' for blocks.\n * @param variable An incoming style value. A CSS var value is expected, but it could be any value.\n * @return The value of the CSS var, if found. If not found, returns the original variable argument.\n */\nexport function getValueFromVariable(\n\tfeatures: GlobalStylesConfig,\n\tblockName?: string,\n\tvariable?: string | UnresolvedValue\n): any {\n\tif ( ! variable || typeof variable !== 'string' ) {\n\t\tif (\n\t\t\ttypeof variable === 'object' &&\n\t\t\tvariable !== null &&\n\t\t\t'ref' in variable &&\n\t\t\ttypeof variable.ref === 'string'\n\t\t) {\n\t\t\tconst resolvedVariable = getValueFromObjectPath(\n\t\t\t\tfeatures,\n\t\t\t\tvariable.ref\n\t\t\t);\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif (\n\t\t\t\t! resolvedVariable ||\n\t\t\t\t( typeof resolvedVariable === 'object' &&\n\t\t\t\t\t'ref' in resolvedVariable )\n\t\t\t) {\n\t\t\t\treturn resolvedVariable;\n\t\t\t}\n\t\t\tvariable = resolvedVariable as string;\n\t\t} else {\n\t\t\treturn variable;\n\t\t}\n\t}\n\tconst USER_VALUE_PREFIX = 'var:';\n\tconst THEME_VALUE_PREFIX = 'var(--wp--';\n\tconst THEME_VALUE_SUFFIX = ')';\n\n\tlet parsedVar;\n\n\tif ( variable.startsWith( USER_VALUE_PREFIX ) ) {\n\t\tparsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );\n\t} else if (\n\t\tvariable.startsWith( THEME_VALUE_PREFIX ) &&\n\t\tvariable.endsWith( THEME_VALUE_SUFFIX )\n\t) {\n\t\tparsedVar = variable\n\t\t\t.slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )\n\t\t\t.split( '--' );\n\t} else {\n\t\t// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`\n\t\treturn variable;\n\t}\n\n\tconst [ type, ...path ] = parsedVar;\n\tif ( type === 'preset' ) {\n\t\treturn getValueFromPresetVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\tif ( type === 'custom' ) {\n\t\treturn getValueFromCustomVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\treturn variable;\n}\n\n/**\n * Encodes a value to a preset variable format if it matches a preset.\n * This is the inverse operation of getValueFromVariable().\n *\n * @example\n * ```js\n * const presetVar = getPresetVariableFromValue(\n * globalStyles.settings,\n * 'core/paragraph',\n * 'color.text',\n * '#ff0000'\n * );\n * // If #ff0000 is the 'red' preset color, returns 'var:preset|color|red'\n * // Otherwise returns '#ff0000'\n * ```\n *\n * @param features GlobalStylesContext settings object.\n * @param blockName The name of a block (e.g., 'core/paragraph').\n * @param variableStylePath The style path (e.g., 'color.text', 'typography.fontSize').\n * @param presetPropertyValue The value to encode (e.g., '#ff0000').\n * @return The preset variable if found, otherwise the original value.\n */\nexport function getPresetVariableFromValue(\n\tfeatures: GlobalStylesSettings,\n\tblockName: string | undefined,\n\tvariableStylePath: string,\n\tpresetPropertyValue: any\n): any {\n\tif ( ! presetPropertyValue ) {\n\t\treturn presetPropertyValue;\n\t}\n\n\tconst cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];\n\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === cssVarInfix\n\t);\n\n\tif ( ! metadata ) {\n\t\t// The property doesn't have preset data\n\t\t// so the value should be returned as it is.\n\t\treturn presetPropertyValue;\n\t}\n\tconst { valueKey, path } = metadata;\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tpath,\n\t\tvalueKey,\n\t\tpresetPropertyValue\n\t);\n\n\tif ( ! presetObject ) {\n\t\t// Value wasn't found in the presets,\n\t\t// so it must be a custom value.\n\t\treturn presetPropertyValue;\n\t}\n\n\treturn `var:preset|${ cssVarInfix }|${ presetObject.slug }`;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAwC;AAYxC,wBAA2C;AAC3C,oBAAuC;AAEhC,IAAM,sBAAsB;AAC5B,IAAM,+BAA+B;AAErC,IAAM,kBAAkB;AAAA,EAC9B;AAAA,IACC,MAAM,CAAE,SAAS,SAAU;AAAA,IAC3B,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,MACR,EAAE,aAAa,SAAS,cAAc,QAAQ;AAAA,MAC9C;AAAA,QACC,aAAa;AAAA,QACb,cAAc;AAAA,MACf;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,cAAc;AAAA,MACf;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,MAAM,CAAE,SAAS,WAAY;AAAA,IAC7B,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,MACR;AAAA,QACC,aAAa;AAAA,QACb,cAAc;AAAA,MACf;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,MAAM,CAAE,SAAS,SAAU;AAAA,IAC3B,UAAU;AAAA,IACV,aAAa;AAAA,IACb,WAAW,CAAE,EAAE,KAAK,MACnB,qBAAsB,IAAK;AAAA,IAC5B,SAAS,CAAC;AAAA,EACX;AAAA,EACA;AAAA,IACC,MAAM,CAAE,UAAU,SAAU;AAAA,IAC5B,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS,CAAC;AAAA,EACX;AAAA,EACA;AAAA,IACC,MAAM,CAAE,cAAc,WAAY;AAAA,IAClC,WAAW,CACV,QACA,iBACI,8CAA4B,QAAQ,QAAS;AAAA,IAClD,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS,CA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EAAE,MAAO,GAAI;AAAA,EACnE,WACC,SAAS,WAAY,kBAAmB,KACxC,SAAS,SAAU,kBAAmB,GACrC;AACD,gBAAY,SACV,MAAO,mBAAmB,QAAQ,CAAC,mBAAmB,MAAO,EAC7D,MAAO,IAAK;AAAA,EACf,OAAO;AAEN,WAAO;AAAA,EACR;AAEA,QAAM,CAAE,MAAM,GAAG,IAAK,IAAI;AAC1B,MAAK,SAAS,UAAW;AACxB,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACA,MAAK,SAAS,UAAW;AACxB,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;AAwBO,SAAS,2BACf,UACA,WACA,mBACA,qBACM;AACN,MAAK,CAAE,qBAAsB;AAC5B,WAAO;AAAA,EACR;AAEA,QAAM,cAAc,4BAA6B,iBAAkB;AAEnE,QAAM,WAAW,gBAAgB;AAAA,IAChC,CAAE,SAAU,KAAK,gBAAgB;AAAA,EAClC;AAEA,MAAK,CAAE,UAAW;AAGjB,WAAO;AAAA,EACR;AACA,QAAM,EAAE,UAAU,KAAK,IAAI;AAE3B,QAAM,eAAe;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,MAAK,CAAE,cAAe;AAGrB,WAAO;AAAA,EACR;AAEA,SAAO,cAAe,WAAY,IAAK,aAAa,IAAK;AAC1D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/global-styles-engine/src/utils/dimensions.ts
21
+ var dimensions_exports = {};
22
+ __export(dimensions_exports, {
23
+ getDimensionPresetCssVar: () => getDimensionPresetCssVar
24
+ });
25
+ module.exports = __toCommonJS(dimensions_exports);
26
+ function getDimensionPresetCssVar(value) {
27
+ if (!value) {
28
+ return;
29
+ }
30
+ const slug = value.match(/var:preset\|dimension\|(.+)/);
31
+ if (!slug) {
32
+ return value;
33
+ }
34
+ return `var(--wp--preset--dimension--${slug[1]})`;
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ getDimensionPresetCssVar
39
+ });
40
+ //# sourceMappingURL=dimensions.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/dimensions.ts"],
4
+ "sourcesContent": ["export function getDimensionPresetCssVar( value?: string ) {\n\tif ( ! value ) {\n\t\treturn;\n\t}\n\n\tconst slug = value.match( /var:preset\\|dimension\\|(.+)/ );\n\n\tif ( ! slug ) {\n\t\treturn value;\n\t}\n\n\treturn `var(--wp--preset--dimension--${ slug[ 1 ] })`;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,yBAA0B,OAAiB;AAC1D,MAAK,CAAE,OAAQ;AACd;AAAA,EACD;AAEA,QAAM,OAAO,MAAM,MAAO,6BAA8B;AAExD,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AAEA,SAAO,gCAAiC,KAAM,CAAE,CAAE;AACnD;",
6
+ "names": []
7
+ }
@@ -89,4 +89,4 @@ function getDuotoneFilter(id, colors) {
89
89
  getDuotoneUnsetStylesheet,
90
90
  getValuesFromColors
91
91
  });
92
- //# sourceMappingURL=duotone.js.map
92
+ //# sourceMappingURL=duotone.cjs.map
@@ -172,4 +172,4 @@ function roundToPrecision(value, digits = 3) {
172
172
  getTypographyValueAndUnit,
173
173
  roundToPrecision
174
174
  });
175
- //# sourceMappingURL=fluid.js.map
175
+ //# sourceMappingURL=fluid.cjs.map
@@ -24,7 +24,7 @@ __export(gap_exports, {
24
24
  getGapCSSValue: () => getGapCSSValue
25
25
  });
26
26
  module.exports = __toCommonJS(gap_exports);
27
- var import_spacing = require("./spacing");
27
+ var import_spacing = require("./spacing.cjs");
28
28
  function getGapBoxControlValueFromStyle(blockGapValue) {
29
29
  if (!blockGapValue) {
30
30
  return null;
@@ -49,4 +49,4 @@ function getGapCSSValue(blockGapValue, defaultValue = "0") {
49
49
  getGapBoxControlValueFromStyle,
50
50
  getGapCSSValue
51
51
  });
52
- //# sourceMappingURL=gap.js.map
52
+ //# sourceMappingURL=gap.cjs.map
@@ -222,4 +222,4 @@ function getGlobalStylesChanges(next, previous, options = {}) {
222
222
  0 && (module.exports = {
223
223
  getGlobalStylesChangelist
224
224
  });
225
- //# sourceMappingURL=get-global-styles-changes.js.map
225
+ //# sourceMappingURL=get-global-styles-changes.cjs.map
@@ -198,4 +198,4 @@ var LAYOUT_DEFINITIONS = {
198
198
  0 && (module.exports = {
199
199
  LAYOUT_DEFINITIONS
200
200
  });
201
- //# sourceMappingURL=layout.js.map
201
+ //# sourceMappingURL=layout.cjs.map
@@ -49,4 +49,4 @@ var getValueFromObjectPath = (object, path, defaultValue) => {
49
49
  getValueFromObjectPath,
50
50
  setImmutably
51
51
  });
52
- //# sourceMappingURL=object.js.map
52
+ //# sourceMappingURL=object.cjs.map
@@ -37,4 +37,4 @@ function getSpacingPresetCssVar(value) {
37
37
  0 && (module.exports = {
38
38
  getSpacingPresetCssVar
39
39
  });
40
- //# sourceMappingURL=spacing.js.map
40
+ //# sourceMappingURL=spacing.cjs.map
@@ -30,4 +30,4 @@ function kebabCase(str) {
30
30
  0 && (module.exports = {
31
31
  kebabCase
32
32
  });
33
- //# sourceMappingURL=string.js.map
33
+ //# sourceMappingURL=string.cjs.map
@@ -24,7 +24,7 @@ __export(typography_exports, {
24
24
  getTypographyFontSizeValue: () => getTypographyFontSizeValue
25
25
  });
26
26
  module.exports = __toCommonJS(typography_exports);
27
- var import_fluid = require("./fluid");
27
+ var import_fluid = require("./fluid.cjs");
28
28
  function isFluidTypographyEnabled(typographySettings) {
29
29
  const fluidSettings = typographySettings?.fluid;
30
30
  return true === fluidSettings || fluidSettings && typeof fluidSettings === "object" && Object.keys(fluidSettings).length > 0;
@@ -71,4 +71,4 @@ function getTypographyFontSizeValue(preset, settings) {
71
71
  getFluidTypographyOptionsFromSettings,
72
72
  getTypographyFontSizeValue
73
73
  });
74
- //# sourceMappingURL=typography.js.map
74
+ //# sourceMappingURL=typography.cjs.map
@@ -1,5 +1,5 @@
1
1
  // packages/global-styles-engine/src/core/equal.ts
2
- import fastDeepEqual from "fast-deep-equal/es6";
2
+ import fastDeepEqual from "fast-deep-equal/es6/index.js";
3
3
  function areGlobalStylesEqual(original, variation) {
4
4
  if (typeof original !== "object" || typeof variation !== "object") {
5
5
  return original === variation;
@@ -9,4 +9,4 @@ function areGlobalStylesEqual(original, variation) {
9
9
  export {
10
10
  areGlobalStylesEqual
11
11
  };
12
- //# sourceMappingURL=equal.js.map
12
+ //# sourceMappingURL=equal.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/core/equal.ts"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * Internal dependencies\n */\nimport type { GlobalStylesConfig } from '../types';\n\n/**\n * Compares global style variations according to their styles and settings properties.\n *\n * @param original A global styles object.\n * @param variation A global styles object.\n * @return Whether `original` and `variation` match.\n */\nexport function areGlobalStylesEqual(\n\toriginal: GlobalStylesConfig,\n\tvariation: GlobalStylesConfig\n): boolean {\n\tif ( typeof original !== 'object' || typeof variation !== 'object' ) {\n\t\treturn original === variation;\n\t}\n\treturn (\n\t\tfastDeepEqual( original?.styles, variation?.styles ) &&\n\t\tfastDeepEqual( original?.settings, variation?.settings )\n\t);\n}\n"],
5
+ "mappings": ";AAGA,OAAO,mBAAmB;AAcnB,SAAS,qBACf,UACA,WACU;AACV,MAAK,OAAO,aAAa,YAAY,OAAO,cAAc,UAAW;AACpE,WAAO,aAAa;AAAA,EACrB;AACA,SACC,cAAe,UAAU,QAAQ,WAAW,MAAO,KACnD,cAAe,UAAU,UAAU,WAAW,QAAS;AAEzD;",
6
+ "names": []
7
+ }
@@ -25,4 +25,4 @@ function mergeGlobalStyles(base, user) {
25
25
  export {
26
26
  mergeGlobalStyles
27
27
  };
28
- //# sourceMappingURL=merge.js.map
28
+ //# sourceMappingURL=merge.mjs.map
@@ -17,16 +17,16 @@ import {
17
17
  appendToSelector,
18
18
  getBlockStyleVariationSelector,
19
19
  getResolvedValue
20
- } from "../utils/common";
21
- import { getBlockSelector } from "./selectors";
22
- import { getTypographyFontSizeValue } from "../utils/typography";
23
- import { getDuotoneFilter } from "../utils/duotone";
24
- import { kebabCase } from "../utils/string";
25
- import { getGapCSSValue } from "../utils/gap";
26
- import { setBackgroundStyleDefaults } from "../utils/background";
27
- import { LAYOUT_DEFINITIONS } from "../utils/layout";
28
- import { getValueFromObjectPath, setImmutably } from "../utils/object";
29
- import { getSetting } from "../settings/get-setting";
20
+ } from "../utils/common.mjs";
21
+ import { getBlockSelector } from "./selectors.mjs";
22
+ import { getTypographyFontSizeValue } from "../utils/typography.mjs";
23
+ import { getDuotoneFilter } from "../utils/duotone.mjs";
24
+ import { kebabCase } from "../utils/string.mjs";
25
+ import { getGapCSSValue } from "../utils/gap.mjs";
26
+ import { setBackgroundStyleDefaults } from "../utils/background.mjs";
27
+ import { LAYOUT_DEFINITIONS } from "../utils/layout.mjs";
28
+ import { getValueFromObjectPath, setImmutably } from "../utils/object.mjs";
29
+ import { getSetting } from "../settings/get-setting.mjs";
30
30
  var ELEMENT_CLASS_NAMES = {
31
31
  button: "wp-element-button",
32
32
  caption: "wp-element-caption"
@@ -980,4 +980,4 @@ export {
980
980
  processCSSNesting,
981
981
  transformToStyles
982
982
  };
983
- //# sourceMappingURL=render.js.map
983
+ //# sourceMappingURL=render.mjs.map
@@ -1,6 +1,6 @@
1
1
  // packages/global-styles-engine/src/core/selectors.ts
2
- import { scopeSelector } from "../utils/common";
3
- import { getValueFromObjectPath } from "../utils/object";
2
+ import { scopeSelector } from "../utils/common.mjs";
3
+ import { getValueFromObjectPath } from "../utils/object.mjs";
4
4
  function getBlockSelector(blockType, target = "root", options = {}) {
5
5
  if (!target) {
6
6
  return null;
@@ -56,4 +56,4 @@ function getBlockSelector(blockType, target = "root", options = {}) {
56
56
  export {
57
57
  getBlockSelector
58
58
  };
59
- //# sourceMappingURL=selectors.js.map
59
+ //# sourceMappingURL=selectors.mjs.map