@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.
- package/CHANGELOG.md +2 -0
- package/build/components/background-image-control/index.js +2 -2
- package/build/components/background-image-control/index.js.map +2 -2
- package/build/components/block-edit/edit.js +2 -2
- package/build/components/block-edit/edit.js.map +2 -2
- package/build/components/block-quick-navigation/index.js +1 -0
- package/build/components/block-quick-navigation/index.js.map +2 -2
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +2 -2
- package/build/components/global-styles/color-panel.js +2 -1
- package/build/components/global-styles/color-panel.js.map +2 -2
- package/build/components/global-styles/dimensions-panel.js +3 -2
- package/build/components/global-styles/dimensions-panel.js.map +2 -2
- package/build/components/global-styles/filters-panel.js +2 -1
- package/build/components/global-styles/filters-panel.js.map +2 -2
- package/build/components/global-styles/hooks.js +23 -95
- package/build/components/global-styles/hooks.js.map +2 -2
- package/build/components/global-styles/index.js +0 -14
- package/build/components/global-styles/index.js.map +2 -2
- package/build/components/global-styles/typography-panel.js +2 -1
- package/build/components/global-styles/typography-panel.js.map +2 -2
- package/build/components/global-styles/typography-utils.js +2 -49
- package/build/components/global-styles/typography-utils.js.map +2 -2
- package/build/components/global-styles/utils.js +0 -377
- package/build/components/global-styles/utils.js.map +2 -2
- package/build/hooks/block-style-variation.js +6 -10
- package/build/hooks/block-style-variation.js.map +2 -2
- package/build/hooks/duotone.js +3 -3
- package/build/hooks/duotone.js.map +2 -2
- package/build/hooks/fit-text.js +17 -8
- package/build/hooks/fit-text.js.map +2 -2
- package/build/hooks/font-size.js +2 -2
- package/build/hooks/font-size.js.map +2 -2
- package/build/hooks/use-typography-props.js +2 -2
- package/build/hooks/use-typography-props.js.map +2 -2
- package/build/utils/fit-text-utils.js +4 -4
- package/build/utils/fit-text-utils.js.map +2 -2
- package/build-module/components/background-image-control/index.js +1 -1
- package/build-module/components/background-image-control/index.js.map +2 -2
- package/build-module/components/block-edit/edit.js +2 -2
- package/build-module/components/block-edit/edit.js.map +2 -2
- package/build-module/components/block-quick-navigation/index.js +1 -0
- package/build-module/components/block-quick-navigation/index.js.map +2 -2
- package/build-module/components/global-styles/border-panel.js +2 -1
- package/build-module/components/global-styles/border-panel.js.map +2 -2
- package/build-module/components/global-styles/color-panel.js +2 -1
- package/build-module/components/global-styles/color-panel.js.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.js +2 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
- package/build-module/components/global-styles/filters-panel.js +2 -1
- package/build-module/components/global-styles/filters-panel.js.map +2 -2
- package/build-module/components/global-styles/hooks.js +27 -95
- package/build-module/components/global-styles/hooks.js.map +2 -2
- package/build-module/components/global-styles/index.js +0 -14
- package/build-module/components/global-styles/index.js.map +2 -2
- package/build-module/components/global-styles/typography-panel.js +2 -1
- package/build-module/components/global-styles/typography-panel.js.map +2 -2
- package/build-module/components/global-styles/typography-utils.js +1 -49
- package/build-module/components/global-styles/typography-utils.js.map +2 -2
- package/build-module/components/global-styles/utils.js +0 -364
- package/build-module/components/global-styles/utils.js.map +2 -2
- package/build-module/hooks/block-style-variation.js +4 -12
- package/build-module/hooks/block-style-variation.js.map +2 -2
- package/build-module/hooks/duotone.js +3 -3
- package/build-module/hooks/duotone.js.map +2 -2
- package/build-module/hooks/fit-text.js +18 -9
- package/build-module/hooks/fit-text.js.map +2 -2
- package/build-module/hooks/font-size.js +1 -1
- package/build-module/hooks/font-size.js.map +2 -2
- package/build-module/hooks/use-typography-props.js +1 -1
- package/build-module/hooks/use-typography-props.js.map +2 -2
- package/build-module/utils/fit-text-utils.js +4 -4
- package/build-module/utils/fit-text-utils.js.map +2 -2
- package/build-style/content-rtl.css +4 -0
- package/build-style/content.css +4 -0
- package/build-style/style-rtl.css +10 -6
- package/build-style/style.css +10 -6
- package/package.json +36 -35
- package/src/components/background-image-control/index.js +1 -1
- package/src/components/block-card/style.scss +1 -1
- package/src/components/block-edit/edit.js +2 -2
- package/src/components/block-navigation/style.scss +1 -1
- package/src/components/block-quick-navigation/index.js +1 -0
- package/src/components/block-quick-navigation/style.scss +5 -0
- package/src/components/block-switcher/style.scss +1 -1
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/global-styles/border-panel.js +2 -1
- package/src/components/global-styles/color-panel.js +2 -1
- package/src/components/global-styles/color-panel.native.js +1 -1
- package/src/components/global-styles/dimensions-panel.js +2 -1
- package/src/components/global-styles/filters-panel.js +2 -1
- package/src/components/global-styles/hooks.js +29 -108
- package/src/components/global-styles/index.js +0 -8
- package/src/components/global-styles/test/typography-utils.js +0 -806
- package/src/components/global-styles/test/utils.js +1 -442
- package/src/components/global-styles/typography-panel.js +2 -1
- package/src/components/global-styles/typography-utils.js +0 -133
- package/src/components/global-styles/utils.js +0 -537
- package/src/components/inserter/style.scss +2 -2
- package/src/components/link-control/test/index.js +7 -6
- package/src/components/multi-selection-inspector/style.scss +1 -1
- package/src/components/rich-text/content.scss +5 -0
- package/src/hooks/block-style-variation.js +4 -12
- package/src/hooks/duotone.js +3 -3
- package/src/hooks/fit-text.js +27 -11
- package/src/hooks/font-size.js +1 -1
- package/src/hooks/use-typography-props.js +1 -1
- package/src/style.scss +1 -0
- package/src/utils/fit-text-utils.js +16 -4
- package/tsconfig.json +1 -0
- package/build/components/global-styles/get-block-css-selector.js +0 -78
- package/build/components/global-styles/get-block-css-selector.js.map +0 -7
- package/build/components/global-styles/use-global-styles-output.js +0 -998
- package/build/components/global-styles/use-global-styles-output.js.map +0 -7
- package/build-module/components/global-styles/get-block-css-selector.js +0 -54
- package/build-module/components/global-styles/get-block-css-selector.js.map +0 -7
- package/build-module/components/global-styles/use-global-styles-output.js +0 -979
- package/build-module/components/global-styles/use-global-styles-output.js.map +0 -7
- package/src/components/global-styles/get-block-css-selector.js +0 -114
- package/src/components/global-styles/test/use-global-styles-output.js +0 -1131
- 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.
|
|
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.
|
|
60
|
-
"@wordpress/api-fetch": "^7.
|
|
61
|
-
"@wordpress/base-styles": "^6.
|
|
62
|
-
"@wordpress/blob": "^4.
|
|
63
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
64
|
-
"@wordpress/blocks": "^15.
|
|
65
|
-
"@wordpress/commands": "^1.
|
|
66
|
-
"@wordpress/components": "^30.
|
|
67
|
-
"@wordpress/compose": "^7.
|
|
68
|
-
"@wordpress/data": "^10.
|
|
69
|
-
"@wordpress/date": "^5.
|
|
70
|
-
"@wordpress/deprecated": "^4.
|
|
71
|
-
"@wordpress/dom": "^4.
|
|
72
|
-
"@wordpress/element": "^6.
|
|
73
|
-
"@wordpress/escape-html": "^3.
|
|
74
|
-
"@wordpress/
|
|
75
|
-
"@wordpress/
|
|
76
|
-
"@wordpress/
|
|
77
|
-
"@wordpress/
|
|
78
|
-
"@wordpress/
|
|
79
|
-
"@wordpress/
|
|
80
|
-
"@wordpress/
|
|
81
|
-
"@wordpress/
|
|
82
|
-
"@wordpress/
|
|
83
|
-
"@wordpress/
|
|
84
|
-
"@wordpress/
|
|
85
|
-
"@wordpress/
|
|
86
|
-
"@wordpress/
|
|
87
|
-
"@wordpress/
|
|
88
|
-
"@wordpress/
|
|
89
|
-
"@wordpress/
|
|
90
|
-
"@wordpress/
|
|
91
|
-
"@wordpress/
|
|
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": "
|
|
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';
|
|
@@ -123,7 +123,7 @@ const EditWithGeneratedProps = ( props ) => {
|
|
|
123
123
|
const source = registeredSources[ sourceName ];
|
|
124
124
|
if (
|
|
125
125
|
! source ||
|
|
126
|
-
! bindableAttributes
|
|
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
|
|
205
|
+
! bindableAttributes?.includes( attributeName )
|
|
206
206
|
) {
|
|
207
207
|
continue;
|
|
208
208
|
}
|
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
|
100
|
+
let result;
|
|
101
|
+
// Use engine's getStyle instead of duplicating logic
|
|
187
102
|
switch ( source ) {
|
|
188
103
|
case 'all':
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
104
|
+
result = getStyle(
|
|
105
|
+
mergedConfig,
|
|
106
|
+
path,
|
|
107
|
+
blockName,
|
|
108
|
+
shouldDecodeEncode
|
|
109
|
+
);
|
|
193
110
|
break;
|
|
194
111
|
case 'user':
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
112
|
+
result = getStyle(
|
|
113
|
+
userConfig,
|
|
114
|
+
path,
|
|
115
|
+
blockName,
|
|
116
|
+
shouldDecodeEncode
|
|
117
|
+
);
|
|
199
118
|
break;
|
|
200
119
|
case 'base':
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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,
|