@wordpress/block-editor 15.5.1-next.ff1cebbba.0 → 15.6.1-next.36001005c.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 (121) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/background-image-control/index.js +2 -2
  3. package/build/components/background-image-control/index.js.map +2 -2
  4. package/build/components/block-edit/edit.js +2 -2
  5. package/build/components/block-edit/edit.js.map +2 -2
  6. package/build/components/block-quick-navigation/index.js +1 -0
  7. package/build/components/block-quick-navigation/index.js.map +2 -2
  8. package/build/components/global-styles/border-panel.js +2 -1
  9. package/build/components/global-styles/border-panel.js.map +2 -2
  10. package/build/components/global-styles/color-panel.js +2 -1
  11. package/build/components/global-styles/color-panel.js.map +2 -2
  12. package/build/components/global-styles/dimensions-panel.js +3 -2
  13. package/build/components/global-styles/dimensions-panel.js.map +2 -2
  14. package/build/components/global-styles/filters-panel.js +2 -1
  15. package/build/components/global-styles/filters-panel.js.map +2 -2
  16. package/build/components/global-styles/hooks.js +23 -95
  17. package/build/components/global-styles/hooks.js.map +2 -2
  18. package/build/components/global-styles/index.js +0 -14
  19. package/build/components/global-styles/index.js.map +2 -2
  20. package/build/components/global-styles/typography-panel.js +2 -1
  21. package/build/components/global-styles/typography-panel.js.map +2 -2
  22. package/build/components/global-styles/typography-utils.js +2 -49
  23. package/build/components/global-styles/typography-utils.js.map +2 -2
  24. package/build/components/global-styles/utils.js +0 -377
  25. package/build/components/global-styles/utils.js.map +2 -2
  26. package/build/hooks/block-style-variation.js +6 -10
  27. package/build/hooks/block-style-variation.js.map +2 -2
  28. package/build/hooks/duotone.js +3 -3
  29. package/build/hooks/duotone.js.map +2 -2
  30. package/build/hooks/fit-text.js +17 -8
  31. package/build/hooks/fit-text.js.map +2 -2
  32. package/build/hooks/font-size.js +2 -2
  33. package/build/hooks/font-size.js.map +2 -2
  34. package/build/hooks/use-typography-props.js +2 -2
  35. package/build/hooks/use-typography-props.js.map +2 -2
  36. package/build/utils/fit-text-utils.js +4 -4
  37. package/build/utils/fit-text-utils.js.map +2 -2
  38. package/build-module/components/background-image-control/index.js +1 -1
  39. package/build-module/components/background-image-control/index.js.map +2 -2
  40. package/build-module/components/block-edit/edit.js +2 -2
  41. package/build-module/components/block-edit/edit.js.map +2 -2
  42. package/build-module/components/block-quick-navigation/index.js +1 -0
  43. package/build-module/components/block-quick-navigation/index.js.map +2 -2
  44. package/build-module/components/global-styles/border-panel.js +2 -1
  45. package/build-module/components/global-styles/border-panel.js.map +2 -2
  46. package/build-module/components/global-styles/color-panel.js +2 -1
  47. package/build-module/components/global-styles/color-panel.js.map +2 -2
  48. package/build-module/components/global-styles/dimensions-panel.js +2 -1
  49. package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
  50. package/build-module/components/global-styles/filters-panel.js +2 -1
  51. package/build-module/components/global-styles/filters-panel.js.map +2 -2
  52. package/build-module/components/global-styles/hooks.js +27 -95
  53. package/build-module/components/global-styles/hooks.js.map +2 -2
  54. package/build-module/components/global-styles/index.js +0 -14
  55. package/build-module/components/global-styles/index.js.map +2 -2
  56. package/build-module/components/global-styles/typography-panel.js +2 -1
  57. package/build-module/components/global-styles/typography-panel.js.map +2 -2
  58. package/build-module/components/global-styles/typography-utils.js +1 -49
  59. package/build-module/components/global-styles/typography-utils.js.map +2 -2
  60. package/build-module/components/global-styles/utils.js +0 -364
  61. package/build-module/components/global-styles/utils.js.map +2 -2
  62. package/build-module/hooks/block-style-variation.js +4 -12
  63. package/build-module/hooks/block-style-variation.js.map +2 -2
  64. package/build-module/hooks/duotone.js +3 -3
  65. package/build-module/hooks/duotone.js.map +2 -2
  66. package/build-module/hooks/fit-text.js +18 -9
  67. package/build-module/hooks/fit-text.js.map +2 -2
  68. package/build-module/hooks/font-size.js +1 -1
  69. package/build-module/hooks/font-size.js.map +2 -2
  70. package/build-module/hooks/use-typography-props.js +1 -1
  71. package/build-module/hooks/use-typography-props.js.map +2 -2
  72. package/build-module/utils/fit-text-utils.js +4 -4
  73. package/build-module/utils/fit-text-utils.js.map +2 -2
  74. package/build-style/content-rtl.css +4 -0
  75. package/build-style/content.css +4 -0
  76. package/build-style/style-rtl.css +10 -6
  77. package/build-style/style.css +10 -6
  78. package/package.json +36 -35
  79. package/src/components/background-image-control/index.js +1 -1
  80. package/src/components/block-card/style.scss +1 -1
  81. package/src/components/block-edit/edit.js +2 -2
  82. package/src/components/block-navigation/style.scss +1 -1
  83. package/src/components/block-quick-navigation/index.js +1 -0
  84. package/src/components/block-quick-navigation/style.scss +5 -0
  85. package/src/components/block-switcher/style.scss +1 -1
  86. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  87. package/src/components/global-styles/border-panel.js +2 -1
  88. package/src/components/global-styles/color-panel.js +2 -1
  89. package/src/components/global-styles/color-panel.native.js +1 -1
  90. package/src/components/global-styles/dimensions-panel.js +2 -1
  91. package/src/components/global-styles/filters-panel.js +2 -1
  92. package/src/components/global-styles/hooks.js +29 -108
  93. package/src/components/global-styles/index.js +0 -8
  94. package/src/components/global-styles/test/typography-utils.js +0 -806
  95. package/src/components/global-styles/test/utils.js +1 -442
  96. package/src/components/global-styles/typography-panel.js +2 -1
  97. package/src/components/global-styles/typography-utils.js +0 -133
  98. package/src/components/global-styles/utils.js +0 -537
  99. package/src/components/inserter/style.scss +2 -2
  100. package/src/components/link-control/test/index.js +7 -6
  101. package/src/components/multi-selection-inspector/style.scss +1 -1
  102. package/src/components/rich-text/content.scss +5 -0
  103. package/src/hooks/block-style-variation.js +4 -12
  104. package/src/hooks/duotone.js +3 -3
  105. package/src/hooks/fit-text.js +27 -11
  106. package/src/hooks/font-size.js +1 -1
  107. package/src/hooks/use-typography-props.js +1 -1
  108. package/src/style.scss +1 -0
  109. package/src/utils/fit-text-utils.js +16 -4
  110. package/tsconfig.json +1 -0
  111. package/build/components/global-styles/get-block-css-selector.js +0 -78
  112. package/build/components/global-styles/get-block-css-selector.js.map +0 -7
  113. package/build/components/global-styles/use-global-styles-output.js +0 -998
  114. package/build/components/global-styles/use-global-styles-output.js.map +0 -7
  115. package/build-module/components/global-styles/get-block-css-selector.js +0 -54
  116. package/build-module/components/global-styles/get-block-css-selector.js.map +0 -7
  117. package/build-module/components/global-styles/use-global-styles-output.js +0 -979
  118. package/build-module/components/global-styles/use-global-styles-output.js.map +0 -7
  119. package/src/components/global-styles/get-block-css-selector.js +0 -114
  120. package/src/components/global-styles/test/use-global-styles-output.js +0 -1131
  121. package/src/components/global-styles/use-global-styles-output.js +0 -1487
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "15.5.1-next.ff1cebbba.0",
3
+ "version": "15.6.1-next.36001005c.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -56,39 +56,40 @@
56
56
  "@emotion/react": "^11.7.1",
57
57
  "@emotion/styled": "^11.6.0",
58
58
  "@react-spring/web": "^9.4.5",
59
- "@wordpress/a11y": "^4.32.1-next.ff1cebbba.0",
60
- "@wordpress/api-fetch": "^7.32.1-next.ff1cebbba.0",
61
- "@wordpress/base-styles": "^6.8.1-next.ff1cebbba.0",
62
- "@wordpress/blob": "^4.32.1-next.ff1cebbba.0",
63
- "@wordpress/block-serialization-default-parser": "^5.32.1-next.ff1cebbba.0",
64
- "@wordpress/blocks": "^15.5.1-next.ff1cebbba.0",
65
- "@wordpress/commands": "^1.32.1-next.ff1cebbba.0",
66
- "@wordpress/components": "^30.6.1-next.ff1cebbba.0",
67
- "@wordpress/compose": "^7.32.1-next.ff1cebbba.0",
68
- "@wordpress/data": "^10.32.1-next.ff1cebbba.0",
69
- "@wordpress/date": "^5.32.1-next.ff1cebbba.0",
70
- "@wordpress/deprecated": "^4.32.1-next.ff1cebbba.0",
71
- "@wordpress/dom": "^4.32.1-next.ff1cebbba.0",
72
- "@wordpress/element": "^6.32.1-next.ff1cebbba.0",
73
- "@wordpress/escape-html": "^3.32.1-next.ff1cebbba.0",
74
- "@wordpress/hooks": "^4.32.1-next.ff1cebbba.0",
75
- "@wordpress/html-entities": "^4.32.1-next.ff1cebbba.0",
76
- "@wordpress/i18n": "^6.5.1-next.ff1cebbba.0",
77
- "@wordpress/icons": "^11.0.1-next.ff1cebbba.0",
78
- "@wordpress/is-shallow-equal": "^5.32.1-next.ff1cebbba.0",
79
- "@wordpress/keyboard-shortcuts": "^5.32.1-next.ff1cebbba.0",
80
- "@wordpress/keycodes": "^4.32.1-next.ff1cebbba.0",
81
- "@wordpress/notices": "^5.32.1-next.ff1cebbba.0",
82
- "@wordpress/preferences": "^4.32.1-next.ff1cebbba.0",
83
- "@wordpress/priority-queue": "^3.32.1-next.ff1cebbba.0",
84
- "@wordpress/private-apis": "^1.32.1-next.ff1cebbba.0",
85
- "@wordpress/rich-text": "^7.32.1-next.ff1cebbba.0",
86
- "@wordpress/style-engine": "^2.32.1-next.ff1cebbba.0",
87
- "@wordpress/token-list": "^3.32.1-next.ff1cebbba.0",
88
- "@wordpress/upload-media": "^0.17.1-next.ff1cebbba.0",
89
- "@wordpress/url": "^4.32.1-next.ff1cebbba.0",
90
- "@wordpress/warning": "^3.32.1-next.ff1cebbba.0",
91
- "@wordpress/wordcount": "^4.32.1-next.ff1cebbba.0",
59
+ "@wordpress/a11y": "^4.33.1-next.36001005c.0",
60
+ "@wordpress/api-fetch": "^7.33.1-next.36001005c.0",
61
+ "@wordpress/base-styles": "^6.10.1-next.36001005c.0",
62
+ "@wordpress/blob": "^4.33.1-next.36001005c.0",
63
+ "@wordpress/block-serialization-default-parser": "^5.33.1-next.36001005c.0",
64
+ "@wordpress/blocks": "^15.6.1-next.36001005c.0",
65
+ "@wordpress/commands": "^1.33.1-next.36001005c.0",
66
+ "@wordpress/components": "^30.7.1-next.36001005c.0",
67
+ "@wordpress/compose": "^7.33.1-next.36001005c.0",
68
+ "@wordpress/data": "^10.33.1-next.36001005c.0",
69
+ "@wordpress/date": "^5.33.1-next.36001005c.0",
70
+ "@wordpress/deprecated": "^4.33.1-next.36001005c.0",
71
+ "@wordpress/dom": "^4.33.1-next.36001005c.0",
72
+ "@wordpress/element": "^6.33.1-next.36001005c.0",
73
+ "@wordpress/escape-html": "^3.33.1-next.36001005c.0",
74
+ "@wordpress/global-styles-engine": "^1.0.1-next.36001005c.0",
75
+ "@wordpress/hooks": "^4.33.1-next.36001005c.0",
76
+ "@wordpress/html-entities": "^4.33.1-next.36001005c.0",
77
+ "@wordpress/i18n": "^6.6.1-next.36001005c.0",
78
+ "@wordpress/icons": "^11.0.1-next.36001005c.0",
79
+ "@wordpress/is-shallow-equal": "^5.33.1-next.36001005c.0",
80
+ "@wordpress/keyboard-shortcuts": "^5.33.1-next.36001005c.0",
81
+ "@wordpress/keycodes": "^4.33.1-next.36001005c.0",
82
+ "@wordpress/notices": "^5.33.1-next.36001005c.0",
83
+ "@wordpress/preferences": "^4.33.1-next.36001005c.0",
84
+ "@wordpress/priority-queue": "^3.33.1-next.36001005c.0",
85
+ "@wordpress/private-apis": "^1.33.1-next.36001005c.0",
86
+ "@wordpress/rich-text": "^7.33.1-next.36001005c.0",
87
+ "@wordpress/style-engine": "^2.33.1-next.36001005c.0",
88
+ "@wordpress/token-list": "^3.33.1-next.36001005c.0",
89
+ "@wordpress/upload-media": "^0.18.1-next.36001005c.0",
90
+ "@wordpress/url": "^4.33.1-next.36001005c.0",
91
+ "@wordpress/warning": "^3.33.1-next.36001005c.0",
92
+ "@wordpress/wordcount": "^4.33.1-next.36001005c.0",
92
93
  "change-case": "^4.1.2",
93
94
  "clsx": "^2.1.1",
94
95
  "colord": "^2.7.0",
@@ -111,5 +112,5 @@
111
112
  "publishConfig": {
112
113
  "access": "public"
113
114
  },
114
- "gitHead": "c5b659710aff01d40d2eb97b211eb2cec9c07d3b"
115
+ "gitHead": "b73a8a22e779c59efb8f911e32b681652f237d60"
115
116
  }
@@ -33,11 +33,11 @@ import { useRef, useState, useEffect, useMemo } from '@wordpress/element';
33
33
  import { useDispatch, useSelect } from '@wordpress/data';
34
34
  import { focus } from '@wordpress/dom';
35
35
  import { isBlobURL } from '@wordpress/blob';
36
+ import { getResolvedValue } from '@wordpress/global-styles-engine';
36
37
 
37
38
  /**
38
39
  * Internal dependencies
39
40
  */
40
- import { getResolvedValue } from '../global-styles/utils';
41
41
  import { hasBackgroundImageValue } from '../global-styles/background-panel';
42
42
  import { setImmutably } from '../../utils/object';
43
43
  import MediaReplaceFlow from '../media-replace-flow';
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  .block-editor-block-card__title {
12
- font-weight: 500;
12
+ font-weight: $font-weight-medium;
13
13
  display: flex;
14
14
  align-items: center;
15
15
  flex-wrap: wrap;
@@ -123,7 +123,7 @@ const EditWithGeneratedProps = ( props ) => {
123
123
  const source = registeredSources[ sourceName ];
124
124
  if (
125
125
  ! source ||
126
- ! bindableAttributes.includes( attributeName )
126
+ ! bindableAttributes?.includes( attributeName )
127
127
  ) {
128
128
  continue;
129
129
  }
@@ -202,7 +202,7 @@ const EditWithGeneratedProps = ( props ) => {
202
202
  ) ) {
203
203
  if (
204
204
  ! blockBindings[ attributeName ] ||
205
- ! bindableAttributes.includes( attributeName )
205
+ ! bindableAttributes?.includes( attributeName )
206
206
  ) {
207
207
  continue;
208
208
  }
@@ -10,5 +10,5 @@
10
10
  color: $gray-700;
11
11
  text-transform: uppercase;
12
12
  font-size: 11px;
13
- font-weight: 500;
13
+ font-weight: $font-weight-medium;
14
14
  }
@@ -60,6 +60,7 @@ function BlockQuickNavigationItem( { clientId, onSelect } ) {
60
60
  return (
61
61
  <Button
62
62
  __next40pxDefaultSize
63
+ className="block-editor-block-quick-navigation__item"
63
64
  isPressed={ isSelected }
64
65
  onClick={ async () => {
65
66
  await selectBlock( clientId );
@@ -0,0 +1,5 @@
1
+ @use "@wordpress/base-styles/variables";
2
+
3
+ .block-editor-block-quick-navigation__item {
4
+ font-weight: variables.$font-weight-regular;
5
+ }
@@ -94,7 +94,7 @@
94
94
  color: $gray-700;
95
95
  text-transform: uppercase;
96
96
  font-size: 11px;
97
- font-weight: 500;
97
+ font-weight: $font-weight-medium;
98
98
  }
99
99
 
100
100
  // The block switcher in the contextual toolbar should be bigger.
@@ -42,7 +42,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
42
42
 
43
43
  .emotion-6 {
44
44
  font-size: 11px;
45
- font-weight: 500;
45
+ font-weight: 499;
46
46
  line-height: 1.4;
47
47
  text-transform: uppercase;
48
48
  display: block;
@@ -11,13 +11,14 @@ import {
11
11
  } from '@wordpress/components';
12
12
  import { useCallback, useMemo } from '@wordpress/element';
13
13
  import { __ } from '@wordpress/i18n';
14
+ import { getValueFromVariable } from '@wordpress/global-styles-engine';
14
15
 
15
16
  /**
16
17
  * Internal dependencies
17
18
  */
18
19
  import BorderRadiusControl from '../border-radius-control';
19
20
  import { useColorsPerOrigin } from './hooks';
20
- import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
21
+ import { useToolsPanelDropdownMenuProps } from './utils';
21
22
  import { setImmutably } from '../../utils/object';
22
23
  import { useBorderPanelLabel } from '../../hooks/border';
23
24
  import { ShadowPopover, useShadowPresets } from './shadow-panel-components';
@@ -21,13 +21,14 @@ import {
21
21
  } from '@wordpress/components';
22
22
  import { useCallback, useRef } from '@wordpress/element';
23
23
  import { __ } from '@wordpress/i18n';
24
+ import { getValueFromVariable } from '@wordpress/global-styles-engine';
24
25
 
25
26
  /**
26
27
  * Internal dependencies
27
28
  */
28
29
  import ColorGradientControl from '../colors-gradients/control';
29
30
  import { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';
30
- import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
31
+ import { useToolsPanelDropdownMenuProps } from './utils';
31
32
  import { setImmutably } from '../../utils/object';
32
33
  import { unlock } from '../../lock-unlock';
33
34
  import { reset as resetIcon } from '@wordpress/icons';
@@ -5,13 +5,13 @@ import { useSelect } from '@wordpress/data';
5
5
  import { useEffect, useState, useMemo, useCallback } from '@wordpress/element';
6
6
  import { __ } from '@wordpress/i18n';
7
7
  import { store as blockEditorStore } from '@wordpress/block-editor';
8
+ import { getValueFromVariable } from '@wordpress/global-styles-engine';
8
9
 
9
10
  /**
10
11
  * Internal dependencies
11
12
  */
12
13
  import PanelColorGradientSettings from '../colors-gradients/panel-color-gradient-settings';
13
14
  import { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';
14
- import { getValueFromVariable } from './utils';
15
15
  import { setImmutably } from '../../utils/object';
16
16
  import ContrastChecker from '../contrast-checker';
17
17
  import InspectorControls from '../inspector-controls';
@@ -17,11 +17,12 @@ import {
17
17
  } from '@wordpress/components';
18
18
  import { Icon, alignNone, stretchWide } from '@wordpress/icons';
19
19
  import { useCallback, useState, Platform } from '@wordpress/element';
20
+ import { getValueFromVariable } from '@wordpress/global-styles-engine';
20
21
 
21
22
  /**
22
23
  * Internal dependencies
23
24
  */
24
- import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
25
+ import { useToolsPanelDropdownMenuProps } from './utils';
25
26
  import SpacingSizesControl from '../spacing-sizes-control';
26
27
  import HeightControl from '../height-control';
27
28
  import ChildLayoutControl from '../child-layout-control';
@@ -24,11 +24,12 @@ import {
24
24
  import { __, _x } from '@wordpress/i18n';
25
25
  import { useCallback, useMemo, useRef } from '@wordpress/element';
26
26
  import { reset as resetIcon } from '@wordpress/icons';
27
+ import { getValueFromVariable } from '@wordpress/global-styles-engine';
27
28
 
28
29
  /**
29
30
  * Internal dependencies
30
31
  */
31
- import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
32
+ import { useToolsPanelDropdownMenuProps } from './utils';
32
33
  import { setImmutably } from '../../utils/object';
33
34
 
34
35
  const EMPTY_ARRAY = [];
@@ -10,81 +10,21 @@ import { useContext, useCallback, useMemo } from '@wordpress/element';
10
10
  import { useSelect } from '@wordpress/data';
11
11
  import { store as blocksStore } from '@wordpress/blocks';
12
12
  import { _x } from '@wordpress/i18n';
13
+ import {
14
+ getSetting,
15
+ getStyle,
16
+ getPresetVariableFromValue,
17
+ } from '@wordpress/global-styles-engine';
13
18
 
14
19
  /**
15
20
  * Internal dependencies
16
21
  */
17
- import { getValueFromVariable, getPresetVariableFromValue } from './utils';
18
- import { getValueFromObjectPath, setImmutably } from '../../utils/object';
22
+ import { setImmutably } from '../../utils/object';
19
23
  import { GlobalStylesContext } from './context';
20
24
  import { unlock } from '../../lock-unlock';
21
25
 
22
26
  const EMPTY_CONFIG = { settings: {}, styles: {} };
23
27
 
24
- const VALID_SETTINGS = [
25
- 'appearanceTools',
26
- 'useRootPaddingAwareAlignments',
27
- 'background.backgroundImage',
28
- 'background.backgroundRepeat',
29
- 'background.backgroundSize',
30
- 'background.backgroundPosition',
31
- 'border.color',
32
- 'border.radius',
33
- 'border.style',
34
- 'border.width',
35
- 'border.radiusSizes',
36
- 'shadow.presets',
37
- 'shadow.defaultPresets',
38
- 'color.background',
39
- 'color.button',
40
- 'color.caption',
41
- 'color.custom',
42
- 'color.customDuotone',
43
- 'color.customGradient',
44
- 'color.defaultDuotone',
45
- 'color.defaultGradients',
46
- 'color.defaultPalette',
47
- 'color.duotone',
48
- 'color.gradients',
49
- 'color.heading',
50
- 'color.link',
51
- 'color.palette',
52
- 'color.text',
53
- 'custom',
54
- 'dimensions.aspectRatio',
55
- 'dimensions.minHeight',
56
- 'layout.contentSize',
57
- 'layout.definitions',
58
- 'layout.wideSize',
59
- 'lightbox.enabled',
60
- 'lightbox.allowEditing',
61
- 'position.fixed',
62
- 'position.sticky',
63
- 'spacing.customSpacingSize',
64
- 'spacing.defaultSpacingSizes',
65
- 'spacing.spacingSizes',
66
- 'spacing.spacingScale',
67
- 'spacing.blockGap',
68
- 'spacing.margin',
69
- 'spacing.padding',
70
- 'spacing.units',
71
- 'typography.fluid',
72
- 'typography.customFontSize',
73
- 'typography.defaultFontSizes',
74
- 'typography.dropCap',
75
- 'typography.fontFamilies',
76
- 'typography.fontSizes',
77
- 'typography.fontStyle',
78
- 'typography.fontWeight',
79
- 'typography.letterSpacing',
80
- 'typography.lineHeight',
81
- 'typography.textAlign',
82
- 'typography.textColumns',
83
- 'typography.textDecoration',
84
- 'typography.textTransform',
85
- 'typography.writingMode',
86
- ];
87
-
88
28
  export const useGlobalStylesReset = () => {
89
29
  const { user, setUserConfig } = useContext( GlobalStylesContext );
90
30
  const config = {
@@ -103,7 +43,6 @@ export function useGlobalSetting( propertyPath, blockName, source = 'all' ) {
103
43
  const appendedBlockPath = blockName ? '.blocks.' + blockName : '';
104
44
  const appendedPropertyPath = propertyPath ? '.' + propertyPath : '';
105
45
  const contextualPath = `settings${ appendedBlockPath }${ appendedPropertyPath }`;
106
- const globalPath = `settings${ appendedPropertyPath }`;
107
46
  const sourceKey = source === 'all' ? 'merged' : source;
108
47
 
109
48
  const settingValue = useMemo( () => {
@@ -112,34 +51,9 @@ export function useGlobalSetting( propertyPath, blockName, source = 'all' ) {
112
51
  throw 'Unsupported source';
113
52
  }
114
53
 
115
- if ( propertyPath ) {
116
- return (
117
- getValueFromObjectPath( configToUse, contextualPath ) ??
118
- getValueFromObjectPath( configToUse, globalPath )
119
- );
120
- }
121
-
122
- let result = {};
123
- VALID_SETTINGS.forEach( ( setting ) => {
124
- const value =
125
- getValueFromObjectPath(
126
- configToUse,
127
- `settings${ appendedBlockPath }.${ setting }`
128
- ) ??
129
- getValueFromObjectPath( configToUse, `settings.${ setting }` );
130
- if ( value !== undefined ) {
131
- result = setImmutably( result, setting.split( '.' ), value );
132
- }
133
- } );
134
- return result;
135
- }, [
136
- configs,
137
- sourceKey,
138
- propertyPath,
139
- contextualPath,
140
- globalPath,
141
- appendedBlockPath,
142
- ] );
54
+ // Use engine's getSetting instead of duplicating logic
55
+ return getSetting( configToUse, propertyPath, blockName );
56
+ }, [ configs, sourceKey, propertyPath, blockName ] );
143
57
 
144
58
  const setSetting = ( newValue ) => {
145
59
  setUserConfig( ( currentConfig ) =>
@@ -183,25 +97,32 @@ export function useGlobalStyle(
183
97
  );
184
98
  };
185
99
 
186
- let rawResult, result;
100
+ let result;
101
+ // Use engine's getStyle instead of duplicating logic
187
102
  switch ( source ) {
188
103
  case 'all':
189
- rawResult = getValueFromObjectPath( mergedConfig, finalPath );
190
- result = shouldDecodeEncode
191
- ? getValueFromVariable( mergedConfig, blockName, rawResult )
192
- : rawResult;
104
+ result = getStyle(
105
+ mergedConfig,
106
+ path,
107
+ blockName,
108
+ shouldDecodeEncode
109
+ );
193
110
  break;
194
111
  case 'user':
195
- rawResult = getValueFromObjectPath( userConfig, finalPath );
196
- result = shouldDecodeEncode
197
- ? getValueFromVariable( mergedConfig, blockName, rawResult )
198
- : rawResult;
112
+ result = getStyle(
113
+ userConfig,
114
+ path,
115
+ blockName,
116
+ shouldDecodeEncode
117
+ );
199
118
  break;
200
119
  case 'base':
201
- rawResult = getValueFromObjectPath( baseConfig, finalPath );
202
- result = shouldDecodeEncode
203
- ? getValueFromVariable( baseConfig, blockName, rawResult )
204
- : rawResult;
120
+ result = getStyle(
121
+ baseConfig,
122
+ path,
123
+ blockName,
124
+ shouldDecodeEncode
125
+ );
205
126
  break;
206
127
  default:
207
128
  throw 'Unsupported source';
@@ -4,14 +4,6 @@ export {
4
4
  useGlobalStyle,
5
5
  useSettingsForBlockElement,
6
6
  } from './hooks';
7
- export { getBlockCSSSelector } from './get-block-css-selector';
8
- export {
9
- getLayoutStyles,
10
- getBlockSelectors,
11
- toStyles,
12
- useGlobalStylesOutput,
13
- useGlobalStylesOutputWithConfig,
14
- } from './use-global-styles-output';
15
7
  export { GlobalStylesContext } from './context';
16
8
  export {
17
9
  default as TypographyPanel,