@wordpress/edit-site 4.8.0 → 4.9.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/add-new-template/add-custom-template-modal.js +185 -0
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -0
- package/build/components/add-new-template/new-template.js +79 -14
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +139 -0
- package/build/components/add-new-template/utils.js.map +1 -0
- package/build/components/global-styles/context-menu.js +6 -3
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +2 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +4 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +80 -0
- package/build/components/global-styles/screen-button-color.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +47 -7
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-root.js +4 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +4 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +9 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/ui.js +11 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +40 -9
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +3 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/index.js +28 -10
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/more-menu/site-export.js +4 -1
- package/build/components/header/more-menu/site-export.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +13 -4
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +13 -4
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +17 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/sidebar/template-card/index.js +19 -7
- package/build/components/sidebar/template-card/index.js.map +1 -1
- package/build/components/sidebar/template-card/template-actions.js +64 -0
- package/build/components/sidebar/template-card/template-actions.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js +170 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -0
- package/build-module/components/add-new-template/new-template.js +79 -17
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +119 -0
- package/build-module/components/add-new-template/utils.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +6 -3
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +4 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +67 -0
- package/build-module/components/global-styles/screen-button-color.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +48 -8
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +4 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +4 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +10 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/ui.js +10 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +39 -9
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +3 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/index.js +29 -11
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/more-menu/site-export.js +4 -1
- package/build-module/components/header/more-menu/site-export.js.map +1 -1
- package/build-module/components/header/undo-redo/redo.js +9 -3
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +9 -3
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +17 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/sidebar/template-card/index.js +18 -7
- package/build-module/components/sidebar/template-card/index.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-actions.js +49 -0
- package/build-module/components/sidebar/template-card/template-actions.js.map +1 -0
- package/build-style/style-rtl.css +167 -16
- package/build-style/style.css +167 -16
- package/package.json +29 -29
- package/src/components/add-new-template/add-custom-template-modal.js +231 -0
- package/src/components/add-new-template/new-template.js +124 -47
- package/src/components/add-new-template/style.scss +116 -0
- package/src/components/add-new-template/utils.js +125 -0
- package/src/components/global-styles/context-menu.js +3 -0
- package/src/components/global-styles/hooks.js +1 -0
- package/src/components/global-styles/palette.js +4 -1
- package/src/components/global-styles/screen-block-list.js +10 -1
- package/src/components/global-styles/screen-button-color.js +102 -0
- package/src/components/global-styles/screen-colors.js +49 -4
- package/src/components/global-styles/screen-root.js +8 -2
- package/src/components/global-styles/screen-typography-element.js +4 -0
- package/src/components/global-styles/screen-typography.js +17 -2
- package/src/components/global-styles/style.scss +10 -0
- package/src/components/global-styles/test/use-global-styles-output.js +82 -16
- package/src/components/global-styles/ui.js +13 -0
- package/src/components/global-styles/use-global-styles-output.js +43 -4
- package/src/components/global-styles/utils.js +3 -0
- package/src/components/header/index.js +36 -10
- package/src/components/header/more-menu/site-export.js +3 -0
- package/src/components/header/style.scss +53 -5
- package/src/components/header/undo-redo/redo.js +6 -1
- package/src/components/header/undo-redo/undo.js +6 -1
- package/src/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/src/components/sidebar/template-card/index.js +15 -6
- package/src/components/sidebar/template-card/style.scss +49 -35
- package/src/components/sidebar/template-card/template-actions.js +43 -0
|
@@ -4,7 +4,7 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalVStack as VStack, FlexItem, ColorIndicator } from '@wordpress/components';
|
|
7
|
+
import { __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalZStack as ZStack, FlexItem, ColorIndicator } from '@wordpress/components';
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
@@ -31,13 +31,15 @@ function BackgroundColorItem(_ref) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
return createElement(NavigationButtonAsItem, {
|
|
34
|
-
path: parentMenu + '/colors/background'
|
|
34
|
+
path: parentMenu + '/colors/background',
|
|
35
|
+
"aria-label": __('Colors background styles')
|
|
35
36
|
}, createElement(HStack, {
|
|
36
37
|
justify: "flex-start"
|
|
37
38
|
}, createElement(ColorIndicatorWrapper, {
|
|
38
39
|
expanded: false
|
|
39
40
|
}, createElement(ColorIndicator, {
|
|
40
|
-
colorValue: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
|
|
41
|
+
colorValue: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
|
|
42
|
+
"data-testid": "background-color-indicator"
|
|
41
43
|
})), createElement(FlexItem, null, __('Background'))));
|
|
42
44
|
}
|
|
43
45
|
|
|
@@ -55,13 +57,15 @@ function TextColorItem(_ref2) {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
return createElement(NavigationButtonAsItem, {
|
|
58
|
-
path: parentMenu + '/colors/text'
|
|
60
|
+
path: parentMenu + '/colors/text',
|
|
61
|
+
"aria-label": __('Colors text styles')
|
|
59
62
|
}, createElement(HStack, {
|
|
60
63
|
justify: "flex-start"
|
|
61
64
|
}, createElement(ColorIndicatorWrapper, {
|
|
62
65
|
expanded: false
|
|
63
66
|
}, createElement(ColorIndicator, {
|
|
64
|
-
colorValue: color
|
|
67
|
+
colorValue: color,
|
|
68
|
+
"data-testid": "text-color-indicator"
|
|
65
69
|
})), createElement(FlexItem, null, __('Text'))));
|
|
66
70
|
}
|
|
67
71
|
|
|
@@ -79,7 +83,8 @@ function LinkColorItem(_ref3) {
|
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
return createElement(NavigationButtonAsItem, {
|
|
82
|
-
path: parentMenu + '/colors/link'
|
|
86
|
+
path: parentMenu + '/colors/link',
|
|
87
|
+
"aria-label": __('Colors link styles')
|
|
83
88
|
}, createElement(HStack, {
|
|
84
89
|
justify: "flex-start"
|
|
85
90
|
}, createElement(ColorIndicatorWrapper, {
|
|
@@ -89,10 +94,42 @@ function LinkColorItem(_ref3) {
|
|
|
89
94
|
})), createElement(FlexItem, null, __('Links'))));
|
|
90
95
|
}
|
|
91
96
|
|
|
92
|
-
function
|
|
97
|
+
function ButtonColorItem(_ref4) {
|
|
93
98
|
let {
|
|
94
|
-
name
|
|
99
|
+
name,
|
|
100
|
+
parentMenu
|
|
95
101
|
} = _ref4;
|
|
102
|
+
const supports = getSupportedGlobalStylesPanels(name);
|
|
103
|
+
const hasSupport = supports.includes('buttonColor');
|
|
104
|
+
const [color] = useStyle('elements.button.color.text', name);
|
|
105
|
+
const [bgColor] = useStyle('elements.button.color.background', name);
|
|
106
|
+
|
|
107
|
+
if (!hasSupport) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return createElement(NavigationButtonAsItem, {
|
|
112
|
+
path: parentMenu + '/colors/button'
|
|
113
|
+
}, createElement(HStack, {
|
|
114
|
+
justify: "flex-start"
|
|
115
|
+
}, createElement(ZStack, {
|
|
116
|
+
isLayered: false,
|
|
117
|
+
offset: -8
|
|
118
|
+
}, createElement(ColorIndicatorWrapper, {
|
|
119
|
+
expanded: false
|
|
120
|
+
}, createElement(ColorIndicator, {
|
|
121
|
+
colorValue: bgColor
|
|
122
|
+
})), createElement(ColorIndicatorWrapper, {
|
|
123
|
+
expanded: false
|
|
124
|
+
}, createElement(ColorIndicator, {
|
|
125
|
+
colorValue: color
|
|
126
|
+
}))), createElement(FlexItem, null, __('Buttons'))));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function ScreenColors(_ref5) {
|
|
130
|
+
let {
|
|
131
|
+
name
|
|
132
|
+
} = _ref5;
|
|
96
133
|
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
97
134
|
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
98
135
|
title: __('Colors'),
|
|
@@ -117,6 +154,9 @@ function ScreenColors(_ref4) {
|
|
|
117
154
|
}), createElement(LinkColorItem, {
|
|
118
155
|
name: name,
|
|
119
156
|
parentMenu: parentMenu
|
|
157
|
+
}), createElement(ButtonColorItem, {
|
|
158
|
+
name: name,
|
|
159
|
+
parentMenu: parentMenu
|
|
120
160
|
}))))));
|
|
121
161
|
}
|
|
122
162
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["__","__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalVStack","VStack","FlexItem","ColorIndicator","ScreenHeader","Palette","NavigationButtonAsItem","getSupportedGlobalStylesPanels","useStyle","Subtitle","ColorIndicatorWrapper","BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ScreenColors","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["__","__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalZStack","ZStack","FlexItem","ColorIndicator","ScreenHeader","Palette","NavigationButtonAsItem","getSupportedGlobalStylesPanels","useStyle","Subtitle","ColorIndicatorWrapper","BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ButtonColorItem","bgColor","ScreenColors","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,QALD,EAMCC,cAND,QAOO,uBAPP;AASA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,SAASC,8BAAT,EAAyCC,QAAzC,QAAyD,SAAzD;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;;AAEA,SAASC,mBAAT,OAAqD;AAAA,MAAvB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAuB;AACpD,QAAMC,QAAQ,GAAGP,8BAA8B,CAAEK,IAAF,CAA/C;AACA,QAAMG,UAAU,GACfD,QAAQ,CAACE,QAAT,CAAmB,iBAAnB,KACAF,QAAQ,CAACE,QAAT,CAAmB,YAAnB,CAFD;AAGA,QAAM,CAAEC,eAAF,IAAsBT,QAAQ,CAAE,kBAAF,EAAsBI,IAAtB,CAApC;AACA,QAAM,CAAEM,aAAF,IAAoBV,QAAQ,CAAE,gBAAF,EAAoBI,IAApB,CAAlC;;AAEA,MAAK,CAA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D,CADD,CARD,CADD;AAsCA;;AAED,eAAeW,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalZStack as ZStack,\n\tFlexItem,\n\tColorIndicator,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport Palette from './palette';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { getSupportedGlobalStylesPanels, useStyle } from './hooks';\nimport Subtitle from './subtitle';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\n\nfunction BackgroundColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport =\n\t\tsupports.includes( 'backgroundColor' ) ||\n\t\tsupports.includes( 'background' );\n\tconst [ backgroundColor ] = useStyle( 'color.background', name );\n\tconst [ gradientValue ] = useStyle( 'color.gradient', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/colors/background' }\n\t\t\taria-label={ __( 'Colors background styles' ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<ColorIndicatorWrapper expanded={ false }>\n\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\tcolorValue={ gradientValue ?? backgroundColor }\n\t\t\t\t\t\tdata-testid=\"background-color-indicator\"\n\t\t\t\t\t/>\n\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t<FlexItem>{ __( 'Background' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction TextColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'color' );\n\tconst [ color ] = useStyle( 'color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/colors/text' }\n\t\t\taria-label={ __( 'Colors text styles' ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<ColorIndicatorWrapper expanded={ false }>\n\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\tcolorValue={ color }\n\t\t\t\t\t\tdata-testid=\"text-color-indicator\"\n\t\t\t\t\t/>\n\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t<FlexItem>{ __( 'Text' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction LinkColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'linkColor' );\n\tconst [ color ] = useStyle( 'elements.link.color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/colors/link' }\n\t\t\taria-label={ __( 'Colors link styles' ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<ColorIndicatorWrapper expanded={ false }>\n\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t<FlexItem>{ __( 'Links' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ButtonColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'buttonColor' );\n\tconst [ color ] = useStyle( 'elements.button.color.text', name );\n\tconst [ bgColor ] = useStyle( 'elements.button.color.background', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButtonAsItem path={ parentMenu + '/colors/button' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t<ColorIndicatorWrapper expanded={ false }>\n\t\t\t\t\t\t<ColorIndicator colorValue={ bgColor } />\n\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t\t<ColorIndicatorWrapper expanded={ false }>\n\t\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t</ZStack>\n\t\t\t\t<FlexItem>{ __( 'Buttons' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ScreenColors( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Colors' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage palettes and the default color of different global elements on the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<div className=\"edit-site-global-styles-screen-colors\">\n\t\t\t\t<VStack spacing={ 10 }>\n\t\t\t\t\t<Palette name={ name } />\n\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t\t<BackgroundColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<TextColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<LinkColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ButtonColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenColors;\n"]}
|
|
@@ -30,7 +30,8 @@ function ScreenRoot() {
|
|
|
30
30
|
}, createElement(CardBody, null, createElement(VStack, {
|
|
31
31
|
spacing: 4
|
|
32
32
|
}, createElement(Card, null, createElement(CardMedia, null, createElement(StylesPreview, null))), !!(variations !== null && variations !== void 0 && variations.length) && createElement(ItemGroup, null, createElement(NavigationButtonAsItem, {
|
|
33
|
-
path: "/variations"
|
|
33
|
+
path: "/variations",
|
|
34
|
+
"aria-label": __('Browse styles')
|
|
34
35
|
}, createElement(HStack, {
|
|
35
36
|
justify: "space-between"
|
|
36
37
|
}, createElement(FlexItem, null, __('Browse styles')), createElement(IconWithCurrentColor, {
|
|
@@ -46,7 +47,8 @@ function ScreenRoot() {
|
|
|
46
47
|
paddingX: "13px",
|
|
47
48
|
marginBottom: 4
|
|
48
49
|
}, __('Customize the appearance of specific blocks for the whole site.')), createElement(ItemGroup, null, createElement(NavigationButtonAsItem, {
|
|
49
|
-
path: "/blocks"
|
|
50
|
+
path: "/blocks",
|
|
51
|
+
"aria-label": __('Blocks styles')
|
|
50
52
|
}, createElement(HStack, {
|
|
51
53
|
justify: "space-between"
|
|
52
54
|
}, createElement(FlexItem, null, __('Blocks')), createElement(IconWithCurrentColor, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","__experimentalVStack","VStack","FlexItem","CardBody","Card","CardDivider","CardMedia","isRTL","__","chevronLeft","chevronRight","useSelect","store","coreStore","IconWithCurrentColor","NavigationButtonAsItem","ContextMenu","StylesPreview","ScreenRoot","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,QALD,EAMCC,QAND,EAOCC,IAPD,EAQCC,WARD,EASCC,SATD,QAUO,uBAVP;AAWA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,kBAA1C;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,aAAP,MAA0B,WAA1B;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAiBR,SAAS,CAAIS,MAAF,IAAc;AAC/C,WAAO;AACND,MAAAA,UAAU,EACTC,MAAM,CACLP,SADK,CAAN,CAEEQ,mDAFF;AAFK,KAAP;AAMA,GAP+B,EAO7B,EAP6B,CAAhC;AASA,SACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAC;AAAX,KACC,cAAC,QAAD,QACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,IAAD,QACC,cAAC,SAAD,QACC,cAAC,aAAD,OADD,CADD,CADD,EAMG,CAAC,EAAEF,UAAF,aAAEA,UAAF,eAAEA,UAAU,CAAEG,MAAd,CAAD,IACD,cAAC,SAAD,QACC,cAAC,sBAAD;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","__experimentalVStack","VStack","FlexItem","CardBody","Card","CardDivider","CardMedia","isRTL","__","chevronLeft","chevronRight","useSelect","store","coreStore","IconWithCurrentColor","NavigationButtonAsItem","ContextMenu","StylesPreview","ScreenRoot","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,QALD,EAMCC,QAND,EAOCC,IAPD,EAQCC,WARD,EASCC,SATD,QAUO,uBAVP;AAWA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,kBAA1C;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,aAAP,MAA0B,WAA1B;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAiBR,SAAS,CAAIS,MAAF,IAAc;AAC/C,WAAO;AACND,MAAAA,UAAU,EACTC,MAAM,CACLP,SADK,CAAN,CAEEQ,mDAFF;AAFK,KAAP;AAMA,GAP+B,EAO7B,EAP6B,CAAhC;AASA,SACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAC;AAAX,KACC,cAAC,QAAD,QACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,IAAD,QACC,cAAC,SAAD,QACC,cAAC,aAAD,OADD,CADD,CADD,EAMG,CAAC,EAAEF,UAAF,aAAEA,UAAF,eAAEA,UAAU,CAAEG,MAAd,CAAD,IACD,cAAC,SAAD,QACC,cAAC,sBAAD;AACC,IAAA,IAAI,EAAC,aADN;AAEC,kBAAad,EAAE,CAAE,eAAF;AAFhB,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QACGA,EAAE,CAAE,eAAF,CADL,CADD,EAIC,cAAC,oBAAD;AACC,IAAA,IAAI,EACHD,KAAK,KAAKE,WAAL,GAAmBC;AAF1B,IAJD,CAJD,CADD,CAPF,EAyBC,cAAC,WAAD,OAzBD,CADD,CADD,EA+BC,cAAC,WAAD,OA/BD,EAiCC,cAAC,QAAD,QACC,cAAC,MAAD;AACC,IAAA,EAAE,EAAC,GADJ;AAEC,IAAA,UAAU,EAAG;AACb;AACL;AACA;AACA;AANI;AAOC,IAAA,QAAQ,EAAC,MAPV;AAQC,IAAA,YAAY,EAAG;AARhB,KAUGF,EAAE,CACH,iEADG,CAVL,CADD,EAeC,cAAC,SAAD,QACC,cAAC,sBAAD;AACC,IAAA,IAAI,EAAC,SADN;AAEC,kBAAaA,EAAE,CAAE,eAAF;AAFhB,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QAAYA,EAAE,CAAE,QAAF,CAAd,CADD,EAEC,cAAC,oBAAD;AACC,IAAA,IAAI,EAAGD,KAAK,KAAKE,WAAL,GAAmBC;AADhC,IAFD,CAJD,CADD,CAfD,CAjCD,CADD;AAiEA;;AAED,eAAeQ,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport ContextMenu from './context-menu';\nimport StylesPreview from './preview';\n\nfunction ScreenRoot() {\n\tconst { variations } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tvariations:\n\t\t\t\tselect(\n\t\t\t\t\tcoreStore\n\t\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ !! variations?.length && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<ContextMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this particular instance only and should be reconsidered before making into a pattern.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["__","TypographyPanel","ScreenHeader","elements","text","description","title","link","ScreenTypographyElement","name","element"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,YAAP,MAAyB,UAAzB;AAEA,MAAMC,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAEL,EAAE,CAAE,oCAAF,CADV;AAELM,IAAAA,KAAK,EAAEN,EAAE,CAAE,MAAF;AAFJ,GADU;AAKhBO,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAEL,EAAE,CAAE,oDAAF,CADV;AAELM,IAAAA,KAAK,EAAEN,EAAE,CAAE,OAAF;AAFJ;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["__","TypographyPanel","ScreenHeader","elements","text","description","title","link","button","ScreenTypographyElement","name","element"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,YAAP,MAAyB,UAAzB;AAEA,MAAMC,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAEL,EAAE,CAAE,oCAAF,CADV;AAELM,IAAAA,KAAK,EAAEN,EAAE,CAAE,MAAF;AAFJ,GADU;AAKhBO,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAEL,EAAE,CAAE,oDAAF,CADV;AAELM,IAAAA,KAAK,EAAEN,EAAE,CAAE,OAAF;AAFJ,GALU;AAShBQ,EAAAA,MAAM,EAAE;AACPH,IAAAA,WAAW,EAAEL,EAAE,CAAE,kDAAF,CADR;AAEPM,IAAAA,KAAK,EAAEN,EAAE,CAAE,SAAF;AAFF;AATQ,CAAjB;;AAeA,SAASS,uBAAT,OAAsD;AAAA,MAApB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAoB;AACrD,SACC,8BACC,cAAC,YAAD;AACC,IAAA,KAAK,EAAGR,QAAQ,CAAEQ,OAAF,CAAR,CAAoBL,KAD7B;AAEC,IAAA,WAAW,EAAGH,QAAQ,CAAEQ,OAAF,CAAR,CAAoBN;AAFnC,IADD,EAKC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGK,IAAxB;AAA+B,IAAA,OAAO,EAAGC;AAAzC,IALD,CADD;AASA;;AAED,eAAeF,uBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { name, element } ) {\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<TypographyPanel name={ name } element={ element } />\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"]}
|
|
@@ -3,7 +3,7 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
7
7
|
import { __experimentalItemGroup as ItemGroup, __experimentalVStack as VStack, __experimentalHStack as HStack, FlexItem } from '@wordpress/components';
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
@@ -39,8 +39,11 @@ function Item(_ref) {
|
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
const navigationButtonLabel = sprintf( // translators: %s: is a subset of Typography, e.g., 'text' or 'links'.
|
|
43
|
+
__('Typography %s styles'), label);
|
|
42
44
|
return createElement(NavigationButtonAsItem, {
|
|
43
|
-
path: parentMenu + '/typography/' + element
|
|
45
|
+
path: parentMenu + '/typography/' + element,
|
|
46
|
+
"aria-label": navigationButtonLabel
|
|
44
47
|
}, createElement(HStack, {
|
|
45
48
|
justify: "flex-start"
|
|
46
49
|
}, createElement(FlexItem, {
|
|
@@ -82,6 +85,11 @@ function ScreenTypography(_ref2) {
|
|
|
82
85
|
parentMenu: parentMenu,
|
|
83
86
|
element: "link",
|
|
84
87
|
label: __('Links')
|
|
88
|
+
}), createElement(Item, {
|
|
89
|
+
name: name,
|
|
90
|
+
parentMenu: parentMenu,
|
|
91
|
+
element: "button",
|
|
92
|
+
label: __('Buttons')
|
|
85
93
|
})))), !!name && createElement(TypographyPanel, {
|
|
86
94
|
name: name,
|
|
87
95
|
element: "text"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["__","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","ScreenHeader","NavigationButtonAsItem","useStyle","Subtitle","TypographyPanel","Item","name","parentMenu","element","label","hasSupport","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","background","ScreenTypography","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["__","sprintf","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","ScreenHeader","NavigationButtonAsItem","useStyle","Subtitle","TypographyPanel","Item","name","parentMenu","element","label","hasSupport","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","navigationButtonLabel","background","ScreenTypography","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,QAKO,uBALP;AAOA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,SAASC,sBAAT,QAAuC,qBAAvC;AACA,SAASC,QAAT,QAAyB,SAAzB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,eAAP,MAA4B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U,EAAGC,UAFd;AAGC,IAAA,OAAO,EAAC,MAHT;AAIC,IAAA,KAAK,EAAGhB,EAAE,CAAE,OAAF;AAJX,IAPD,EAaC,cAAC,IAAD;AACC,IAAA,IAAI,EAAGe,IADR;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,OAAO,EAAC,QAHT;AAIC,IAAA,KAAK,EAAGhB,EAAE,CAAE,SAAF;AAJX,IAbD,CAFD,CADD,CATF,EAoCG,CAAC,CAAEe,IAAH,IAAW,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGA,IAAxB;AAA+B,IAAA,OAAO,EAAC;AAAvC,IApCd,CADD;AAwCA;;AAED,eAAeiB,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useStyle } from './hooks';\nimport Subtitle from './subtitle';\nimport TypographyPanel from './typography-panel';\n\nfunction Item( { name, parentMenu, element, label } ) {\n\tconst hasSupport = ! name;\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useStyle( prefix + 'typography.fontFamily', name );\n\tconst [ fontStyle ] = useStyle( prefix + 'typography.fontStyle', name );\n\tconst [ fontWeight ] = useStyle( prefix + 'typography.fontWeight', name );\n\tconst [ letterSpacing ] = useStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst [ backgroundColor ] = useStyle( prefix + 'color.background', name );\n\tconst [ gradientValue ] = useStyle( prefix + 'color.gradient', name );\n\tconst [ color ] = useStyle( prefix + 'color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ScreenTypography( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage the typography settings for different elements.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t{ ! name && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-typography\">\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t\telement=\"text\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t\telement=\"link\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t\telement=\"button\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ /* No typography elements support yet for blocks. */ }\n\t\t\t{ !! name && <TypographyPanel name={ name } element=\"text\" /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
|
|
@@ -20,6 +20,7 @@ import ScreenColorPalette from './screen-color-palette';
|
|
|
20
20
|
import ScreenBackgroundColor from './screen-background-color';
|
|
21
21
|
import ScreenTextColor from './screen-text-color';
|
|
22
22
|
import ScreenLinkColor from './screen-link-color';
|
|
23
|
+
import ScreenButtonColor from './screen-button-color';
|
|
23
24
|
import ScreenLayout from './screen-layout';
|
|
24
25
|
import ScreenStyleVariations from './screen-style-variations';
|
|
25
26
|
|
|
@@ -52,6 +53,11 @@ function ContextScreens(_ref2) {
|
|
|
52
53
|
}, createElement(ScreenTypographyElement, {
|
|
53
54
|
name: name,
|
|
54
55
|
element: "link"
|
|
56
|
+
})), createElement(GlobalStylesNavigationScreen, {
|
|
57
|
+
path: parentMenu + '/typography/button'
|
|
58
|
+
}, createElement(ScreenTypographyElement, {
|
|
59
|
+
name: name,
|
|
60
|
+
element: "button"
|
|
55
61
|
})), createElement(GlobalStylesNavigationScreen, {
|
|
56
62
|
path: parentMenu + '/colors'
|
|
57
63
|
}, createElement(ScreenColors, {
|
|
@@ -72,6 +78,10 @@ function ContextScreens(_ref2) {
|
|
|
72
78
|
path: parentMenu + '/colors/link'
|
|
73
79
|
}, createElement(ScreenLinkColor, {
|
|
74
80
|
name: name
|
|
81
|
+
})), createElement(GlobalStylesNavigationScreen, {
|
|
82
|
+
path: parentMenu + '/colors/button'
|
|
83
|
+
}, createElement(ScreenButtonColor, {
|
|
84
|
+
name: name
|
|
75
85
|
})), createElement(GlobalStylesNavigationScreen, {
|
|
76
86
|
path: parentMenu + '/layout'
|
|
77
87
|
}, createElement(ScreenLayout, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","getBlockTypes","ScreenRoot","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenBackgroundColor","ScreenTextColor","ScreenLinkColor","ScreenLayout","ScreenStyleVariations","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","ContextScreens","name","parentMenu","undefined","GlobalStylesUI","blocks","map","block"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,aAAT,QAA8B,mBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,OAAOC,uBAAP,MAAoC,6BAApC;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;;AAEA,SAASC,4BAAT,OAAiE;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AAChE,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAG,CACX,mDADW,EAEXD,SAFW,EAIVE,MAJU,CAIFC,OAJE,EAKVC,IALU,CAKJ,GALI;AADb,KAOMH,KAPN,EADD;AAWA;;AAED,SAASI,cAAT,QAAoC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACnC,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AAEA,SACC,8BACC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAGC,UAAU,GAAG;AAAlD,KACC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAGD;AAAzB,IADD,CADD,EAKC,cAAC,4BAAD;AACC,IAAA,IAAI,EAAGC,UAAU,GAAG;AADrB,KAGC,cAAC,uBAAD;AAAyB,IAAA,IAAI,EAAGD,IAAhC;AAAuC,IAAA,OAAO,EAAC;AAA/C,IAHD,CALD,EAWC,cAAC,4BAAD;AACC,IAAA,IAAI,EAAGC,UAAU,GAAG;AADrB,KAGC,cAAC,uBAAD;AAAyB,IAAA,IAAI,EAAGD,IAAhC;AAAuC,IAAA,OAAO,EAAC;AAA/C,IAHD,CAXD,EAiBC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAGC,UAAU,GAAG;AAAlD,KACC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAGD;AAArB,IADD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","getBlockTypes","ScreenRoot","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenBackgroundColor","ScreenTextColor","ScreenLinkColor","ScreenButtonColor","ScreenLayout","ScreenStyleVariations","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","ContextScreens","name","parentMenu","undefined","GlobalStylesUI","blocks","map","block"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,aAAT,QAA8B,mBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,OAAOC,uBAAP,MAAoC,6BAApC;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;;AAEA,SAASC,4BAAT,OAAiE;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AAChE,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAG,CACX,mDADW,EAEXD,SAFW,EAIVE,MAJU,CAIFC,OAJE,EAKVC,IALU,CAKJ,GALI;AADb,KAOMH,KAPN,EADD;AAWA;;AAED,SAASI,cAAT,QAAoC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACnC,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AAEA,SACC,8BACC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAGC,UAAU,GAAG;AAAlD,KACC,cAAC,gBAAD;A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AC,iBAAD;AAAmB,IAAA,IAAI,EAAGD;AAA1B,IAHD,CA/CD,EAqDC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAGC,UAAU,GAAG;AAAlD,KACC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAGD;AAArB,IADD,CArDD,CADD;AA2DA;;AAED,SAASG,cAAT,GAA0B;AACzB,QAAMC,MAAM,GAAGzB,aAAa,EAA5B;AAEA,SACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,qDADX;AAEC,IAAA,WAAW,EAAC;AAFb,KAIC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,cAAC,UAAD,OADD,CAJD,EAQC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,cAAC,qBAAD,OADD,CARD,EAYC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,cAAC,eAAD,OADD,CAZD,EAgBGyB,MAAM,CAACC,GAAP,CAAcC,KAAF,IACb,cAAC,4BAAD;AACC,IAAA,GAAG,EAAG,gBAAgBA,KAAK,CAACN,IAD7B;AAEC,IAAA,IAAI,EAAG,aAAaM,KAAK,CAACN;AAF3B,KAIC,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGM,KAAK,CAACN;AAA1B,IAJD,CADC,CAhBH,EAyBC,cAAC,cAAD,OAzBD,EA2BGI,MAAM,CAACC,GAAP,CAAcC,KAAF,IACb,cAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAACN,IADhC;AAEC,IAAA,IAAI,EAAGM,KAAK,CAACN;AAFd,IADC,CA3BH,CADD;AAoCA;;AAED,eAAeG,cAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { getBlockTypes } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport ScreenBlockList from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenBackgroundColor from './screen-background-color';\nimport ScreenTextColor from './screen-text-color';\nimport ScreenLinkColor from './screen-link-color';\nimport ScreenButtonColor from './screen-button-color';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ContextScreens( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/typography' }>\n\t\t\t\t<ScreenTypography name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/typography/text' }\n\t\t\t>\n\t\t\t\t<ScreenTypographyElement name={ name } element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/typography/link' }\n\t\t\t>\n\t\t\t\t<ScreenTypographyElement name={ name } element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/typography/button' }\n\t\t\t>\n\t\t\t\t<ScreenTypographyElement name={ name } element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/colors' }>\n\t\t\t\t<ScreenColors name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/background' }\n\t\t\t>\n\t\t\t\t<ScreenBackgroundColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>\n\t\t\t\t<ScreenTextColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/colors/link' }>\n\t\t\t\t<ScreenLinkColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/button' }\n\t\t\t>\n\t\t\t\t<ScreenButtonColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/layout' }>\n\t\t\t\t<ScreenLayout name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + block.name }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</NavigatorProvider>\n\t);\n}\n\nexport default GlobalStylesUI;\n"]}
|
|
@@ -244,7 +244,10 @@ export const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
244
244
|
if (!!value && !!(blockSelectors !== null && blockSelectors !== void 0 && blockSelectors[blockName]) && !!(ELEMENTS !== null && ELEMENTS !== void 0 && ELEMENTS[elementName])) {
|
|
245
245
|
nodes.push({
|
|
246
246
|
styles: value,
|
|
247
|
-
selector: blockSelectors[blockName].selector.split(',').map(sel =>
|
|
247
|
+
selector: blockSelectors[blockName].selector.split(',').map(sel => {
|
|
248
|
+
const elementSelectors = ELEMENTS[elementName].split(',');
|
|
249
|
+
return elementSelectors.map(elementSelector => sel + ' ' + elementSelector);
|
|
250
|
+
}).join(',')
|
|
248
251
|
});
|
|
249
252
|
}
|
|
250
253
|
});
|
|
@@ -364,11 +367,38 @@ export const toStyles = (tree, blockSelectors, hasBlockGapSupport) => {
|
|
|
364
367
|
|
|
365
368
|
const declarations = getStylesDeclarations(styles);
|
|
366
369
|
|
|
367
|
-
if (declarations
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
+
if (declarations !== null && declarations !== void 0 && declarations.length) {
|
|
371
|
+
ruleset = ruleset + `${selector}{${declarations.join(';')};}`;
|
|
372
|
+
} // Check for pseudo selector in `styles` and handle separately.
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
const psuedoSelectorStyles = Object.entries(styles).filter(_ref9 => {
|
|
376
|
+
let [key] = _ref9;
|
|
377
|
+
return key.startsWith(':');
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
if (psuedoSelectorStyles !== null && psuedoSelectorStyles !== void 0 && psuedoSelectorStyles.length) {
|
|
381
|
+
psuedoSelectorStyles.forEach(_ref10 => {
|
|
382
|
+
let [pseudoKey, pseudoRule] = _ref10;
|
|
383
|
+
const pseudoDeclarations = getStylesDeclarations(pseudoRule);
|
|
370
384
|
|
|
371
|
-
|
|
385
|
+
if (!(pseudoDeclarations !== null && pseudoDeclarations !== void 0 && pseudoDeclarations.length)) {
|
|
386
|
+
return;
|
|
387
|
+
} // `selector` maybe provided in a form
|
|
388
|
+
// where block level selectors have sub element
|
|
389
|
+
// selectors appended to them as a comma seperated
|
|
390
|
+
// string.
|
|
391
|
+
// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;
|
|
392
|
+
// Split and append pseudo selector to create
|
|
393
|
+
// the proper rules to target the elements.
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
const _selector = selector.split(',').map(sel => sel + pseudoKey).join(',');
|
|
397
|
+
|
|
398
|
+
const psuedoRule = `${_selector}{${pseudoDeclarations.join(';')};}`;
|
|
399
|
+
ruleset = ruleset + psuedoRule;
|
|
400
|
+
});
|
|
401
|
+
}
|
|
372
402
|
});
|
|
373
403
|
/* Add alignment / layout styles */
|
|
374
404
|
|
|
@@ -381,11 +411,11 @@ export const toStyles = (tree, blockSelectors, hasBlockGapSupport) => {
|
|
|
381
411
|
ruleset = ruleset + '.wp-site-blocks > * + * { margin-block-start: var( --wp--style--block-gap ); }';
|
|
382
412
|
}
|
|
383
413
|
|
|
384
|
-
nodesWithSettings.forEach(
|
|
414
|
+
nodesWithSettings.forEach(_ref11 => {
|
|
385
415
|
let {
|
|
386
416
|
selector,
|
|
387
417
|
presets
|
|
388
|
-
} =
|
|
418
|
+
} = _ref11;
|
|
389
419
|
|
|
390
420
|
if (ROOT_BLOCK_SELECTOR === selector) {
|
|
391
421
|
// Do not add extra specificity for top-level classes.
|
|
@@ -402,10 +432,10 @@ export const toStyles = (tree, blockSelectors, hasBlockGapSupport) => {
|
|
|
402
432
|
};
|
|
403
433
|
export function toSvgFilters(tree, blockSelectors) {
|
|
404
434
|
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
|
|
405
|
-
return nodesWithSettings.flatMap(
|
|
435
|
+
return nodesWithSettings.flatMap(_ref12 => {
|
|
406
436
|
let {
|
|
407
437
|
presets
|
|
408
|
-
} =
|
|
438
|
+
} = _ref12;
|
|
409
439
|
return getPresetsSvgFilters(presets);
|
|
410
440
|
});
|
|
411
441
|
}
|