@wordpress/edit-site 4.2.0 → 4.3.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/block-editor/index.js +53 -4
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +37 -0
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -0
- package/build/components/global-styles/dimensions-panel.js +32 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/header.js +1 -4
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +34 -0
- package/build/components/global-styles/icon-with-current-color.js.map +1 -0
- package/build/components/global-styles/navigation-button.js +7 -3
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +8 -5
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +142 -26
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -2
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +11 -3
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-root.js +7 -5
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +12 -5
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/sidebar/index.js +12 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/navigation-menu-sidebar/index.js +40 -0
- package/build/components/sidebar/navigation-menu-sidebar/index.js.map +1 -0
- package/build/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +185 -0
- package/build/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -0
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js +54 -0
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -0
- package/build/components/template-part-converter/convert-to-regular.js +6 -0
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/block-editor/index.js +51 -6
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +25 -0
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -0
- package/build-module/components/global-styles/dimensions-panel.js +33 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -5
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +22 -0
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -0
- package/build-module/components/global-styles/navigation-button.js +7 -3
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +8 -6
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +141 -27
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +2 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +10 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +8 -7
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +13 -6
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/navigation-menu-sidebar/index.js +26 -0
- package/build-module/components/sidebar/navigation-menu-sidebar/index.js.map +1 -0
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +168 -0
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -0
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js +45 -0
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-regular.js +6 -0
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-style/style-rtl.css +51 -4
- package/build-style/style.css +51 -4
- package/package.json +29 -29
- package/src/components/block-editor/index.js +79 -9
- package/src/components/global-styles/color-indicator-wrapper.js +23 -0
- package/src/components/global-styles/dimensions-panel.js +39 -1
- package/src/components/global-styles/header.js +2 -7
- package/src/components/global-styles/icon-with-current-color.js +21 -0
- package/src/components/global-styles/navigation-button.js +6 -4
- package/src/components/global-styles/palette.js +8 -11
- package/src/components/global-styles/preview.js +186 -29
- package/src/components/global-styles/screen-block-list.js +1 -3
- package/src/components/global-styles/screen-colors.js +7 -6
- package/src/components/global-styles/screen-root.js +15 -17
- package/src/components/global-styles/screen-style-variations.js +13 -4
- package/src/components/global-styles/style.scss +18 -6
- package/src/components/sidebar/index.js +12 -0
- package/src/components/sidebar/navigation-menu-sidebar/index.js +34 -0
- package/src/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +224 -0
- package/src/components/sidebar/navigation-menu-sidebar/navigation-menu.js +62 -0
- package/src/components/sidebar/navigation-menu-sidebar/style.scss +42 -0
- package/src/components/sidebar/style.scss +1 -1
- package/src/components/template-part-converter/convert-to-regular.js +9 -0
- package/src/style.scss +1 -0
|
@@ -9,6 +9,10 @@ var _element = require("@wordpress/element");
|
|
|
9
9
|
|
|
10
10
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
11
|
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _compose = require("@wordpress/compose");
|
|
15
|
+
|
|
12
16
|
var _hooks = require("./hooks");
|
|
13
17
|
|
|
14
18
|
var _useGlobalStylesOutput = require("./use-global-styles-output");
|
|
@@ -20,61 +24,173 @@ var _useGlobalStylesOutput = require("./use-global-styles-output");
|
|
|
20
24
|
/**
|
|
21
25
|
* Internal dependencies
|
|
22
26
|
*/
|
|
27
|
+
const firstFrame = {
|
|
28
|
+
start: {
|
|
29
|
+
opacity: 1,
|
|
30
|
+
display: 'block'
|
|
31
|
+
},
|
|
32
|
+
hover: {
|
|
33
|
+
opacity: 0,
|
|
34
|
+
display: 'none'
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const secondFrame = {
|
|
38
|
+
hover: {
|
|
39
|
+
opacity: 1,
|
|
40
|
+
display: 'block'
|
|
41
|
+
},
|
|
42
|
+
start: {
|
|
43
|
+
opacity: 0,
|
|
44
|
+
display: 'none'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const normalizedWidth = 248;
|
|
48
|
+
const normalizedHeight = 152;
|
|
49
|
+
const normalizedColorSwatchSize = 32;
|
|
50
|
+
|
|
23
51
|
const StylesPreview = _ref => {
|
|
24
52
|
let {
|
|
25
|
-
|
|
53
|
+
label,
|
|
54
|
+
isFocused
|
|
26
55
|
} = _ref;
|
|
56
|
+
const [fontWeight] = (0, _hooks.useStyle)('typography.fontWeight');
|
|
27
57
|
const [fontFamily = 'serif'] = (0, _hooks.useStyle)('typography.fontFamily');
|
|
58
|
+
const [headingFontFamily = fontFamily] = (0, _hooks.useStyle)('elements.h1.typography.fontFamily');
|
|
59
|
+
const [headingFontWeight = fontWeight] = (0, _hooks.useStyle)('elements.h1.typography.fontWeight');
|
|
28
60
|
const [textColor = 'black'] = (0, _hooks.useStyle)('color.text');
|
|
61
|
+
const [headingColor = textColor] = (0, _hooks.useStyle)('elements.h1.color.text');
|
|
29
62
|
const [linkColor = 'blue'] = (0, _hooks.useStyle)('elements.link.color.text');
|
|
30
63
|
const [backgroundColor = 'white'] = (0, _hooks.useStyle)('color.background');
|
|
31
64
|
const [gradientValue] = (0, _hooks.useStyle)('color.gradient');
|
|
32
65
|
const [styles] = (0, _useGlobalStylesOutput.useGlobalStylesOutput)();
|
|
66
|
+
const disableMotion = (0, _compose.useReducedMotion)();
|
|
67
|
+
const [coreColors] = (0, _hooks.useSetting)('color.palette.core');
|
|
68
|
+
const [themeColors] = (0, _hooks.useSetting)('color.palette.theme');
|
|
69
|
+
const [customColors] = (0, _hooks.useSetting)('color.palette.custom');
|
|
70
|
+
const [isHovered, setIsHovered] = (0, _element.useState)(false);
|
|
71
|
+
const [containerResizeListener, {
|
|
72
|
+
width
|
|
73
|
+
}] = (0, _compose.useResizeObserver)();
|
|
74
|
+
const ratio = width ? width / normalizedWidth : 1;
|
|
75
|
+
const paletteColors = (themeColors !== null && themeColors !== void 0 ? themeColors : []).concat(customColors !== null && customColors !== void 0 ? customColors : []).concat(coreColors !== null && coreColors !== void 0 ? coreColors : []);
|
|
76
|
+
const highlightedColors = paletteColors.filter( // we exclude these two colors because they are already visible in the preview.
|
|
77
|
+
_ref2 => {
|
|
78
|
+
let {
|
|
79
|
+
color
|
|
80
|
+
} = _ref2;
|
|
81
|
+
return color !== backgroundColor && color !== headingColor;
|
|
82
|
+
}).slice(0, 2);
|
|
33
83
|
return (0, _element.createElement)(_blockEditor.__unstableIframe, {
|
|
34
84
|
className: "edit-site-global-styles-preview__iframe",
|
|
35
85
|
head: (0, _element.createElement)(_blockEditor.__unstableEditorStyles, {
|
|
36
86
|
styles: styles
|
|
37
87
|
}),
|
|
38
88
|
style: {
|
|
39
|
-
height
|
|
40
|
-
|
|
41
|
-
|
|
89
|
+
height: normalizedHeight * ratio,
|
|
90
|
+
visibility: !width ? 'hidden' : 'visible'
|
|
91
|
+
},
|
|
92
|
+
onMouseEnter: () => setIsHovered(true),
|
|
93
|
+
onMouseLeave: () => setIsHovered(false),
|
|
94
|
+
tabIndex: -1
|
|
95
|
+
}, containerResizeListener, (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
42
96
|
style: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
justifyContent: 'center',
|
|
47
|
-
height: '100%',
|
|
48
|
-
transform: `scale(${height / 150})`,
|
|
97
|
+
height: normalizedHeight * ratio,
|
|
98
|
+
width: '100%',
|
|
49
99
|
background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
|
|
50
100
|
cursor: 'pointer'
|
|
101
|
+
},
|
|
102
|
+
initial: "start",
|
|
103
|
+
animate: (isHovered || isFocused) && !disableMotion ? 'hover' : 'start'
|
|
104
|
+
}, (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
105
|
+
variants: firstFrame,
|
|
106
|
+
style: {
|
|
107
|
+
height: '100%',
|
|
108
|
+
overflow: 'hidden'
|
|
109
|
+
}
|
|
110
|
+
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
111
|
+
spacing: 10 * ratio,
|
|
112
|
+
justify: "center",
|
|
113
|
+
style: {
|
|
114
|
+
height: '100%',
|
|
115
|
+
overflow: 'hidden'
|
|
51
116
|
}
|
|
52
117
|
}, (0, _element.createElement)("div", {
|
|
53
118
|
style: {
|
|
54
|
-
fontFamily,
|
|
55
|
-
fontSize:
|
|
119
|
+
fontFamily: headingFontFamily,
|
|
120
|
+
fontSize: 65 * ratio,
|
|
121
|
+
color: headingColor,
|
|
122
|
+
fontWeight: headingFontWeight
|
|
56
123
|
}
|
|
57
|
-
}, "Aa"), (0, _element.createElement)(
|
|
124
|
+
}, "Aa"), (0, _element.createElement)(_components.__experimentalVStack, {
|
|
125
|
+
spacing: 4 * ratio
|
|
126
|
+
}, highlightedColors.map(_ref3 => {
|
|
127
|
+
let {
|
|
128
|
+
slug,
|
|
129
|
+
color
|
|
130
|
+
} = _ref3;
|
|
131
|
+
return (0, _element.createElement)("div", {
|
|
132
|
+
key: slug,
|
|
133
|
+
style: {
|
|
134
|
+
height: normalizedColorSwatchSize * ratio,
|
|
135
|
+
width: normalizedColorSwatchSize * ratio,
|
|
136
|
+
background: color,
|
|
137
|
+
borderRadius: normalizedColorSwatchSize * ratio / 2
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
})))), (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
141
|
+
variants: secondFrame,
|
|
142
|
+
style: {
|
|
143
|
+
height: '100%',
|
|
144
|
+
overflow: 'hidden'
|
|
145
|
+
}
|
|
146
|
+
}, (0, _element.createElement)(_components.__experimentalVStack, {
|
|
147
|
+
spacing: 3 * ratio,
|
|
148
|
+
justify: "center",
|
|
58
149
|
style: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
150
|
+
height: '100%',
|
|
151
|
+
overflow: 'hidden',
|
|
152
|
+
padding: 10 * ratio,
|
|
153
|
+
boxSizing: 'border-box'
|
|
154
|
+
}
|
|
155
|
+
}, label && (0, _element.createElement)("div", {
|
|
156
|
+
style: {
|
|
157
|
+
fontSize: 35 * ratio,
|
|
158
|
+
fontFamily: headingFontFamily,
|
|
159
|
+
color: headingColor,
|
|
160
|
+
fontWeight: headingFontWeight,
|
|
161
|
+
lineHeight: '1em'
|
|
62
162
|
}
|
|
163
|
+
}, label), (0, _element.createElement)(_components.__experimentalHStack, {
|
|
164
|
+
spacing: 2 * ratio,
|
|
165
|
+
justify: "flex-start"
|
|
63
166
|
}, (0, _element.createElement)("div", {
|
|
64
167
|
style: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
borderRadius: 20
|
|
168
|
+
fontFamily,
|
|
169
|
+
fontSize: 24 * ratio,
|
|
170
|
+
color: textColor
|
|
69
171
|
}
|
|
70
|
-
}
|
|
172
|
+
}, "Aa"), (0, _element.createElement)("div", {
|
|
71
173
|
style: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
borderRadius: 20
|
|
174
|
+
fontFamily,
|
|
175
|
+
fontSize: 24 * ratio,
|
|
176
|
+
color: linkColor
|
|
76
177
|
}
|
|
77
|
-
})))
|
|
178
|
+
}, "Aa")), paletteColors && (0, _element.createElement)(_components.__experimentalHStack, {
|
|
179
|
+
spacing: 0
|
|
180
|
+
}, paletteColors.slice(0, 4).map((_ref4, index) => {
|
|
181
|
+
let {
|
|
182
|
+
color
|
|
183
|
+
} = _ref4;
|
|
184
|
+
return (0, _element.createElement)("div", {
|
|
185
|
+
key: index,
|
|
186
|
+
style: {
|
|
187
|
+
height: 10 * ratio,
|
|
188
|
+
width: 30 * ratio,
|
|
189
|
+
background: color,
|
|
190
|
+
flexGrow: 1
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}))))));
|
|
78
194
|
};
|
|
79
195
|
|
|
80
196
|
var _default = StylesPreview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/preview.js"],"names":["StylesPreview","height","fontFamily","textColor","linkColor","backgroundColor","gradientValue","styles","display","gap","alignItems","justifyContent","transform","background","cursor","fontSize","flexDirection","width","borderRadius"],"mappings":";;;;;;;;;AAGA;;AAQA;;AACA;;AAZA;AACA;AACA;;AAMA;AACA;AACA;AAIA,MAAMA,aAAa,GAAG,QAAwB;AAAA,MAAtB;AAAEC,IAAAA,MAAM,GAAG;AAAX,GAAsB;AAC7C,QAAM,CAAEC,UAAU,GAAG,OAAf,IAA2B,qBAAU,uBAAV,CAAjC;AACA,QAAM,CAAEC,SAAS,GAAG,OAAd,IAA0B,qBAAU,YAAV,CAAhC;AACA,QAAM,CAAEC,SAAS,GAAG,MAAd,IAAyB,qBAAU,0BAAV,CAA/B;AACA,QAAM,CAAEC,eAAe,GAAG,OAApB,IAAgC,qBAAU,kBAAV,CAAtC;AACA,QAAM,CAAEC,aAAF,IAAoB,qBAAU,gBAAV,CAA1B;AACA,QAAM,CAAEC,MAAF,IAAa,mDAAnB;AAEA,SACC,4BAAC,6BAAD;AACC,IAAA,SAAS,EAAC,yCADX;AAEC,IAAA,IAAI,EAAG,4BAAC,mCAAD;AAAc,MAAA,MAAM,EAAGA;AAAvB,MAFR;AAGC,IAAA,KAAK,EAAG;AAAEN,MAAAA;AAAF;AAHT,KAKC;AACC,IAAA,KAAK,EAAG;AACPO,MAAAA,OAAO,EAAE,MADF;AAEPC,MAAAA,GAAG,EAAE,EAFE;AAGPC,MAAAA,UAAU,EAAE,QAHL;AAIPC,MAAAA,cAAc,EAAE,QAJT;AAKPV,MAAAA,MAAM,EAAE,MALD;AAMPW,MAAAA,SAAS,EAAG,SAASX,MAAM,GAAG,GAAK,GAN5B;AAOPY,MAAAA,UAAU,EAAEP,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmBD,eAPtB;AAQPS,MAAAA,MAAM,EAAE;AARD;AADT,KAYC;AAAK,IAAA,KAAK,EAAG;AAAEZ,MAAAA,UAAF;AAAca,MAAAA,QAAQ,EAAE;AAAxB;AAAb,UAZD,EAaC;AACC,IAAA,KAAK,EAAG;AACPP,MAAAA,OAAO,EAAE,MADF;AAEPC,MAAAA,GAAG,EAAE,EAFE;AAGPO,MAAAA,aAAa,EAAE;AAHR;AADT,KAOC;AACC,IAAA,KAAK,EAAG;AACPf,MAAAA,MAAM,EAAE,EADD;AAEPgB,MAAAA,KAAK,EAAE,EAFA;AAGPJ,MAAAA,UAAU,EAAEV,SAHL;AAIPe,MAAAA,YAAY,EAAE;AAJP;AADT,IAPD,EAcK,GAdL,EAeC;AACC,IAAA,KAAK,EAAG;AACPjB,MAAAA,MAAM,EAAE,EADD;AAEPgB,MAAAA,KAAK,EAAE,EAFA;AAGPJ,MAAAA,UAAU,EAAET,SAHL;AAIPc,MAAAA,YAAY,EAAE;AAJP;AADT,IAfD,CAbD,CALD,CADD;AA8CA,CAtDD;;eAwDelB,a","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__unstableIframe as Iframe,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from './hooks';\nimport { useGlobalStylesOutput } from './use-global-styles-output';\n\nconst StylesPreview = ( { height = 150 } ) => {\n\tconst [ fontFamily = 'serif' ] = useStyle( 'typography.fontFamily' );\n\tconst [ textColor = 'black' ] = useStyle( 'color.text' );\n\tconst [ linkColor = 'blue' ] = useStyle( 'elements.link.color.text' );\n\tconst [ backgroundColor = 'white' ] = useStyle( 'color.background' );\n\tconst [ gradientValue ] = useStyle( 'color.gradient' );\n\tconst [ styles ] = useGlobalStylesOutput();\n\n\treturn (\n\t\t<Iframe\n\t\t\tclassName=\"edit-site-global-styles-preview__iframe\"\n\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\tstyle={ { height } }\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tgap: 20,\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\theight: '100%',\n\t\t\t\t\ttransform: `scale(${ height / 150 })`,\n\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div style={ { fontFamily, fontSize: '80px' } }>Aa</div>\n\t\t\t\t<div\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tgap: 20,\n\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: 40,\n\t\t\t\t\t\t\twidth: 40,\n\t\t\t\t\t\t\tbackground: textColor,\n\t\t\t\t\t\t\tborderRadius: 20,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>{ ' ' }\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: 40,\n\t\t\t\t\t\t\twidth: 40,\n\t\t\t\t\t\t\tbackground: linkColor,\n\t\t\t\t\t\t\tborderRadius: 20,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Iframe>\n\t);\n};\n\nexport default StylesPreview;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/preview.js"],"names":["firstFrame","start","opacity","display","hover","secondFrame","normalizedWidth","normalizedHeight","normalizedColorSwatchSize","StylesPreview","label","isFocused","fontWeight","fontFamily","headingFontFamily","headingFontWeight","textColor","headingColor","linkColor","backgroundColor","gradientValue","styles","disableMotion","coreColors","themeColors","customColors","isHovered","setIsHovered","containerResizeListener","width","ratio","paletteColors","concat","highlightedColors","filter","color","slice","height","visibility","background","cursor","overflow","fontSize","map","slug","borderRadius","padding","boxSizing","lineHeight","index","flexGrow"],"mappings":";;;;;;;AAaA;;AAVA;;AAIA;;AAKA;;AAMA;;AACA;;AAnBA;AACA;AACA;;AAaA;AACA;AACA;AAIA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,KAAK,EAAE;AACNC,IAAAA,OAAO,EAAE,CADH;AAENC,IAAAA,OAAO,EAAE;AAFH,GADW;AAKlBC,EAAAA,KAAK,EAAE;AACNF,IAAAA,OAAO,EAAE,CADH;AAENC,IAAAA,OAAO,EAAE;AAFH;AALW,CAAnB;AAWA,MAAME,WAAW,GAAG;AACnBD,EAAAA,KAAK,EAAE;AACNF,IAAAA,OAAO,EAAE,CADH;AAENC,IAAAA,OAAO,EAAE;AAFH,GADY;AAKnBF,EAAAA,KAAK,EAAE;AACNC,IAAAA,OAAO,EAAE,CADH;AAENC,IAAAA,OAAO,EAAE;AAFH;AALY,CAApB;AAWA,MAAMG,eAAe,GAAG,GAAxB;AACA,MAAMC,gBAAgB,GAAG,GAAzB;AAEA,MAAMC,yBAAyB,GAAG,EAAlC;;AAEA,MAAMC,aAAa,GAAG,QAA4B;AAAA,MAA1B;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA0B;AACjD,QAAM,CAAEC,UAAF,IAAiB,qBAAU,uBAAV,CAAvB;AACA,QAAM,CAAEC,UAAU,GAAG,OAAf,IAA2B,qBAAU,uBAAV,CAAjC;AACA,QAAM,CAAEC,iBAAiB,GAAGD,UAAtB,IAAqC,qBAC1C,mCAD0C,CAA3C;AAGA,QAAM,CAAEE,iBAAiB,GAAGH,UAAtB,IAAqC,qBAC1C,mCAD0C,CAA3C;AAGA,QAAM,CAAEI,SAAS,GAAG,OAAd,IAA0B,qBAAU,YA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EAAC;AAAtC,KACC;AACC,IAAA,KAAK,EAAG;AACPjB,MAAAA,UADO;AAEP6B,MAAAA,QAAQ,EAAE,KAAKZ,KAFR;AAGPK,MAAAA,KAAK,EAAEnB;AAHA;AADT,UADD,EAUC;AACC,IAAA,KAAK,EAAG;AACPH,MAAAA,UADO;AAEP6B,MAAAA,QAAQ,EAAE,KAAKZ,KAFR;AAGPK,MAAAA,KAAK,EAAEjB;AAHA;AADT,UAVD,CAvBD,EA2CGa,aAAa,IACd,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACGA,aAAa,CACbK,KADA,CACO,CADP,EACU,CADV,EAEAO,GAFA,CAEK,QAAaM,KAAb;AAAA,QAAE;AAAEd,MAAAA;AAAF,KAAF;AAAA,WACL;AACC,MAAA,GAAG,EAAGc,KADP;AAEC,MAAA,KAAK,EAAG;AACPZ,QAAAA,MAAM,EAAE,KAAKP,KADN;AAEPD,QAAAA,KAAK,EAAE,KAAKC,KAFL;AAGPS,QAAAA,UAAU,EAAEJ,KAHL;AAIPe,QAAAA,QAAQ,EAAE;AAJH;AAFT,MADK;AAAA,GAFL,CADH,CA5CF,CAPD,CA3DD,CAZD,CADD;AAgJA,CAjLD;;eAmLezC,a","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__unstableIframe as Iframe,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport {\n\t__unstableMotion as motion,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useReducedMotion, useResizeObserver } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSetting, useStyle } from './hooks';\nimport { useGlobalStylesOutput } from './use-global-styles-output';\n\nconst firstFrame = {\n\tstart: {\n\t\topacity: 1,\n\t\tdisplay: 'block',\n\t},\n\thover: {\n\t\topacity: 0,\n\t\tdisplay: 'none',\n\t},\n};\n\nconst secondFrame = {\n\thover: {\n\t\topacity: 1,\n\t\tdisplay: 'block',\n\t},\n\tstart: {\n\t\topacity: 0,\n\t\tdisplay: 'none',\n\t},\n};\n\nconst normalizedWidth = 248;\nconst normalizedHeight = 152;\n\nconst normalizedColorSwatchSize = 32;\n\nconst StylesPreview = ( { label, isFocused } ) => {\n\tconst [ fontWeight ] = useStyle( 'typography.fontWeight' );\n\tconst [ fontFamily = 'serif' ] = useStyle( 'typography.fontFamily' );\n\tconst [ headingFontFamily = fontFamily ] = useStyle(\n\t\t'elements.h1.typography.fontFamily'\n\t);\n\tconst [ headingFontWeight = fontWeight ] = useStyle(\n\t\t'elements.h1.typography.fontWeight'\n\t);\n\tconst [ textColor = 'black' ] = useStyle( 'color.text' );\n\tconst [ headingColor = textColor ] = useStyle( 'elements.h1.color.text' );\n\tconst [ linkColor = 'blue' ] = useStyle( 'elements.link.color.text' );\n\tconst [ backgroundColor = 'white' ] = useStyle( 'color.background' );\n\tconst [ gradientValue ] = useStyle( 'color.gradient' );\n\tconst [ styles ] = useGlobalStylesOutput();\n\tconst disableMotion = useReducedMotion();\n\tconst [ coreColors ] = useSetting( 'color.palette.core' );\n\tconst [ themeColors ] = useSetting( 'color.palette.theme' );\n\tconst [ customColors ] = useSetting( 'color.palette.custom' );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ containerResizeListener, { width } ] = useResizeObserver();\n\tconst ratio = width ? width / normalizedWidth : 1;\n\n\tconst paletteColors = ( themeColors ?? [] )\n\t\t.concat( customColors ?? [] )\n\t\t.concat( coreColors ?? [] );\n\tconst highlightedColors = paletteColors\n\t\t.filter(\n\t\t\t// we exclude these two colors because they are already visible in the preview.\n\t\t\t( { color } ) => color !== backgroundColor && color !== headingColor\n\t\t)\n\t\t.slice( 0, 2 );\n\n\treturn (\n\t\t<Iframe\n\t\t\tclassName=\"edit-site-global-styles-preview__iframe\"\n\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\tstyle={ {\n\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\tvisibility: ! width ? 'hidden' : 'visible',\n\t\t\t} }\n\t\t\tonMouseEnter={ () => setIsHovered( true ) }\n\t\t\tonMouseLeave={ () => setIsHovered( false ) }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ containerResizeListener }\n\t\t\t<motion.div\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t} }\n\t\t\t\tinitial=\"start\"\n\t\t\t\tanimate={\n\t\t\t\t\t( isHovered || isFocused ) && ! disableMotion\n\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t: 'start'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ firstFrame }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\tfontSize: 65 * ratio,\n\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tAa\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<VStack spacing={ 4 * ratio }>\n\t\t\t\t\t\t\t{ highlightedColors.map( ( { slug, color } ) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\t\tnormalizedColorSwatchSize * ratio,\n\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\tnormalizedColorSwatchSize * ratio,\n\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\tborderRadius:\n\t\t\t\t\t\t\t\t\t\t\t( normalizedColorSwatchSize *\n\t\t\t\t\t\t\t\t\t\t\t\tratio ) /\n\t\t\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ secondFrame }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 3 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tpadding: 10 * ratio,\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontSize: 35 * ratio,\n\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\tlineHeight: '1em',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<HStack spacing={ 2 * ratio } justify=\"flex-start\">\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontFamily,\n\t\t\t\t\t\t\t\t\tfontSize: 24 * ratio,\n\t\t\t\t\t\t\t\t\tcolor: textColor,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tAa\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontFamily,\n\t\t\t\t\t\t\t\t\tfontSize: 24 * ratio,\n\t\t\t\t\t\t\t\t\tcolor: linkColor,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tAa\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t{ paletteColors && (\n\t\t\t\t\t\t\t<HStack spacing={ 0 }>\n\t\t\t\t\t\t\t\t{ paletteColors\n\t\t\t\t\t\t\t\t\t.slice( 0, 4 )\n\t\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\theight: 10 * ratio,\n\t\t\t\t\t\t\t\t\t\t\t\twidth: 30 * ratio,\n\t\t\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</motion.div>\n\t\t\t</motion.div>\n\t\t</Iframe>\n\t);\n};\n\nexport default StylesPreview;\n"]}
|
|
@@ -84,9 +84,9 @@ function BlockMenuItem(_ref) {
|
|
|
84
84
|
path: '/blocks/' + block.name
|
|
85
85
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
86
86
|
justify: "flex-start"
|
|
87
|
-
}, (0, _element.createElement)(
|
|
87
|
+
}, (0, _element.createElement)(_blockEditor.BlockIcon, {
|
|
88
88
|
icon: block.icon
|
|
89
|
-
})
|
|
89
|
+
}), (0, _element.createElement)(_components.FlexItem, null, block.title)));
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function ScreenBlockList() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"names":["useSortedBlockTypes","blockItems","select","blocksStore","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","BlockMenuItem","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasBlockMenuItem","icon","title","ScreenBlockList","sortedBlockTypes","map"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAUA;AACA;AACA;AAQA,SAASA,mBAAT,GAA+B;AAC9B,QAAMC,UAAU,GAAG,qBAChBC,MAAF,IAAcA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,aAAtB,EADI,EAElB,EAFkB,CAAnB,CAD8B,CAK9B;AACA;AACA;AACA;AACA;;AACA,QAAMC,WAAW,GAAG,CAAEC,MAAF,EAAUC,KAAV,KAAqB;AACxC,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA;AAAR,QAAoBH,MAA1B;AACA,UAAMI,IAAI,GAAGH,KAAK,CAACI,IAAN,CAAWC,UAAX,CAAuB,OAAvB,IAAmCJ,IAAnC,GAA0CC,OAAvD;AACAC,IAAAA,IAAI,CAACG,IAAL,CAAWN,KAAX;AACA,WAAOD,MAAP;AACA,GALD;;AAMA,QAAM;AACLE,IAAAA,IAAI,EAAEM,SADD;AAELL,IAAAA,OAAO,EAAEM;AAFJ,MAGFd,UAAU,CAACe,MAAX,CAAmBX,WAAnB,EAAgC;AAAEG,IAAAA,IAAI,EAAE,EAAR;AAAYC,IAAAA,OAAO,EAAE;AAArB,GAAhC,CAHJ;AAIA,SAAO,CAAE,GAAGK,SAAL,EAAgB,GAAGC,YAAnB,CAAP;AACA;;AAED,SAASE,aAAT,OAAoC;AAAA,MAAZ;AAAEV,IAAAA;AAAF,GAAY;AACnC,QAAMW,kBAAkB,GAAG,4CAAuBX,KAAK,CAACI,IAA7B,CAA3B;AACA,QAAMQ,aAAa,GAAG,kCAAkBZ,KAAK,CAACI,IAAxB,CAAtB;AACA,QAAMS,cAAc,GAAG,oCAAmBb,KAAK,CAACI,IAAzB,CAAvB;AACA,QAAMU,kBAAkB,GAAG,4CAAuBd,KAAK,CAACI,IAA7B,CAA3B;AACA,QAAMW,cAAc,GAAGF,cAAc,IAAIC,kBAAzC;AACA,QAAME,gBAAgB,GACrBL,kBAAkB,IAAIC,aAAtB,IAAuCG,cADxC;;AAGA,MAAK,CAAEC,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAG,aAAahB,KAAK,CAACI;AAA5C,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"names":["useSortedBlockTypes","blockItems","select","blocksStore","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","BlockMenuItem","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel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B,CAA3B;AACA,QAAMW,cAAc,GAAGF,cAAc,IAAIC,kBAAzC;AACA,QAAME,gBAAgB,GACrBL,kBAAkB,IAAIC,aAAtB,IAAuCG,cADxC;;AAGA,MAAK,CAAEC,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAG,aAAahB,KAAK,CAACI;AAA5C,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGJ,KAAK,CAACiB;AAAxB,IADD,EAEC,4BAAC,oBAAD,QAAYjB,KAAK,CAACkB,KAAlB,CAFD,CADD,CADD;AAQA;;AAED,SAASC,eAAT,GAA2B;AAC1B,QAAMC,gBAAgB,GAAG3B,mBAAmB,EAA5C;AACA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,QAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cACb,qEADa;AAFf,IADD,EAOG2B,gBAAgB,CAACC,GAAjB,CAAwBrB,KAAF,IACvB,4BAAC,aAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,GAAG,EAAG,oBAAoBA,KAAK,CAACI;AAFjC,IADC,CAPH,CADD;AAgBA;;eAEce,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useHasBorderPanel } from './border-panel';\nimport { useHasColorPanel } from './color-utils';\nimport { useHasDimensionsPanel } from './dimensions-panel';\nimport { useHasTypographyPanel } from './typography-panel';\nimport ScreenHeader from './header';\nimport { NavigationButton } from './navigation-button';\n\nfunction useSortedBlockTypes() {\n\tconst blockItems = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\t// Ensure core blocks are prioritized in the returned results,\n\t// because third party blocks can be registered earlier than\n\t// the core blocks (usually by using the `init` action),\n\t// thus affecting the display order.\n\t// We don't sort reusable blocks as they are handled differently.\n\tconst groupByType = ( blocks, block ) => {\n\t\tconst { core, noncore } = blocks;\n\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\t\ttype.push( block );\n\t\treturn blocks;\n\t};\n\tconst {\n\t\tcore: coreItems,\n\t\tnoncore: nonCoreItems,\n\t} = blockItems.reduce( groupByType, { core: [], noncore: [] } );\n\treturn [ ...coreItems, ...nonCoreItems ];\n}\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasTypographyPanel = useHasTypographyPanel( block.name );\n\tconst hasColorPanel = useHasColorPanel( block.name );\n\tconst hasBorderPanel = useHasBorderPanel( block.name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( block.name );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasBlockMenuItem =\n\t\thasTypographyPanel || hasColorPanel || hasLayoutPanel;\n\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ '/blocks/' + block.name }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenBlockList() {\n\tconst sortedBlockTypes = useSortedBlockTypes();\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t{ sortedBlockTypes.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"]}
|
|
@@ -23,6 +23,8 @@ var _hooks = require("./hooks");
|
|
|
23
23
|
|
|
24
24
|
var _subtitle = _interopRequireDefault(require("./subtitle"));
|
|
25
25
|
|
|
26
|
+
var _colorIndicatorWrapper = _interopRequireDefault(require("./color-indicator-wrapper"));
|
|
27
|
+
|
|
26
28
|
/**
|
|
27
29
|
* WordPress dependencies
|
|
28
30
|
*/
|
|
@@ -48,7 +50,9 @@ function BackgroundColorItem(_ref) {
|
|
|
48
50
|
path: parentMenu + '/colors/background'
|
|
49
51
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
50
52
|
justify: "flex-start"
|
|
51
|
-
}, (0, _element.createElement)(
|
|
53
|
+
}, (0, _element.createElement)(_colorIndicatorWrapper.default, {
|
|
54
|
+
expanded: false
|
|
55
|
+
}, (0, _element.createElement)(_components.ColorIndicator, {
|
|
52
56
|
colorValue: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
|
|
53
57
|
})), (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Background'))));
|
|
54
58
|
}
|
|
@@ -70,7 +74,9 @@ function TextColorItem(_ref2) {
|
|
|
70
74
|
path: parentMenu + '/colors/text'
|
|
71
75
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
72
76
|
justify: "flex-start"
|
|
73
|
-
}, (0, _element.createElement)(
|
|
77
|
+
}, (0, _element.createElement)(_colorIndicatorWrapper.default, {
|
|
78
|
+
expanded: false
|
|
79
|
+
}, (0, _element.createElement)(_components.ColorIndicator, {
|
|
74
80
|
colorValue: color
|
|
75
81
|
})), (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Text'))));
|
|
76
82
|
}
|
|
@@ -92,7 +98,9 @@ function LinkColorItem(_ref3) {
|
|
|
92
98
|
path: parentMenu + '/colors/link'
|
|
93
99
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
94
100
|
justify: "flex-start"
|
|
95
|
-
}, (0, _element.createElement)(
|
|
101
|
+
}, (0, _element.createElement)(_colorIndicatorWrapper.default, {
|
|
102
|
+
expanded: false
|
|
103
|
+
}, (0, _element.createElement)(_components.ColorIndicator, {
|
|
96
104
|
colorValue: color
|
|
97
105
|
})), (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Links'))));
|
|
98
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ScreenColors","undefined"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ScreenColors","undefined"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAUA;AACA;AACA;AAQA,SAASA,mBAAT,OAAqD;AAAA,MAAvB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAuB;AACpD,QAAMC,QAAQ,GAAG,2CAAgCF,IAAhC,CAAjB;AACA,QAAMG,UAAU,GACfD,QAAQ,CAACE,QAAT,CAAmB,iBAAnB,KACAF,QAAQ,CAACE,QAAT,CAAmB,YAAnB,CAFD;AAGA,QAAM,CAAEC,eAAF,IAAsB,qBAAU,kBAAV,EAA8BL,IAA9B,CAA5B;AACA,QAAM,CAAEM,aAAF,IAAoB,qBAAU,gBAAV,EAA4BN,IAA5B,CAA1B;;AAEA,MAAK,CAAEG,UAAP,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,SACC,4BAA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AEcS,Y","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\tFlexItem,\n\tColorIndicator,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport Palette from './palette';\nimport { NavigationButton } 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<NavigationButton path={ parentMenu + '/colors/background' }>\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/>\n\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t<FlexItem>{ __( 'Background' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\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<NavigationButton path={ parentMenu + '/colors/text' }>\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>{ __( 'Text' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\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<NavigationButton path={ parentMenu + '/colors/link' }>\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</NavigationButton>\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</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"]}
|
|
@@ -19,6 +19,8 @@ var _data = require("@wordpress/data");
|
|
|
19
19
|
|
|
20
20
|
var _coreData = require("@wordpress/core-data");
|
|
21
21
|
|
|
22
|
+
var _iconWithCurrentColor = require("./icon-with-current-color");
|
|
23
|
+
|
|
22
24
|
var _navigationButton = require("./navigation-button");
|
|
23
25
|
|
|
24
26
|
var _contextMenu = _interopRequireDefault(require("./context-menu"));
|
|
@@ -44,19 +46,19 @@ function ScreenRoot() {
|
|
|
44
46
|
size: "small"
|
|
45
47
|
}, (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalVStack, {
|
|
46
48
|
spacing: 2
|
|
47
|
-
}, (0, _element.createElement)(_components.Card, null, (0, _element.createElement)(_preview.default, null)), !!(variations !== null && variations !== void 0 && variations.length) && (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
49
|
+
}, (0, _element.createElement)(_components.Card, null, (0, _element.createElement)(_components.CardMedia, null, (0, _element.createElement)(_preview.default, null))), !!(variations !== null && variations !== void 0 && variations.length) && (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
48
50
|
path: "/variations"
|
|
49
51
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
50
52
|
justify: "space-between"
|
|
51
|
-
}, (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('
|
|
53
|
+
}, (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Browse styles')), (0, _element.createElement)(_iconWithCurrentColor.IconWithCurrentColor, {
|
|
52
54
|
icon: (0, _i18n.isRTL)() ? _icons.chevronLeft : _icons.chevronRight
|
|
53
|
-
})))))
|
|
55
|
+
}))))), (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_contextMenu.default, null)), (0, _element.createElement)(_components.CardDivider, null), (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_components.__experimentalItem, null, (0, _i18n.__)('Customize the appearance of specific blocks for the whole site.')), (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
54
56
|
path: "/blocks"
|
|
55
57
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
56
58
|
justify: "space-between"
|
|
57
|
-
}, (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Blocks')), (0, _element.createElement)(
|
|
59
|
+
}, (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Blocks')), (0, _element.createElement)(_iconWithCurrentColor.IconWithCurrentColor, {
|
|
58
60
|
icon: (0, _i18n.isRTL)() ? _icons.chevronLeft : _icons.chevronRight
|
|
59
|
-
}))))))
|
|
61
|
+
}))))));
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
var _default = ScreenRoot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAiBA;AACA;AACA;AAMA,SAASA,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAiB,qBAAaC,MAAF,IAAc;AAC/C,WAAO;AACND,MAAAA,UAAU,EAAEC,MAAM,CACjBC,eADiB,CAAN,CAEVC,mDAFU;AADN,KAAP;AAKA,GANsB,EAMpB,EANoB,CAAvB;AAQA,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC;AAAX,KACC,4BAAC,oBAAD,QACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gBAAD,QACC,4BAAC,qBAAD,QACC,4BAAC,gBAAD,OADD,CADD,CADD,EAMG,CAAC,EAAEH,UAAF,aAAEA,UAAF,eAAEA,UAAU,CAAEI,MAAd,CAAD,IACD,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QAAY,cAAI,eAAJ,CAAZ,CADD,EAEC,4BAAC,0CAAD;AACC,IAAA,IAAI,EACH,qBAAUC,kBAAV,GAAwBC;AAF1B,IAFD,CADD,CAPF,CADD,CADD,EAuBC,4BAAC,oBAAD,QACC,4BAAC,oBAAD,OADD,CAvBD,EA2BC,4BAAC,uBAAD,OA3BD,EA6BC,4BAAC,oBAAD,QACC,4BAAC,mCAAD,QACC,4BAAC,8BAAD,QACG,cACD,iEADC,CADH,CADD,EAMC,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QAAY,cAAI,QAAJ,CAAZ,CADD,EAEC,4BAAC,0CAAD;AACC,IAAA,IAAI,EAAG,qBAAUD,kBAAV,GAAwBC;AADhC,IAFD,CADD,CAND,CADD,CA7BD,CADD;AAiDA;;eAEcP,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\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 { NavigationButton } 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: select(\n\t\t\t\tcoreStore\n\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={ 2 }>\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<NavigationButton path=\"/variations\">\n\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t<FlexItem>{ __( 'Browse styles' ) }</FlexItem>\n\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</NavigationButton>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardBody>\n\t\t\t\t<ContextMenu />\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<Item>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Item>\n\t\t\t\t\t<NavigationButton path=\"/blocks\">\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</NavigationButton>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
|
|
@@ -50,6 +50,7 @@ function Variation(_ref) {
|
|
|
50
50
|
let {
|
|
51
51
|
variation
|
|
52
52
|
} = _ref;
|
|
53
|
+
const [isFocused, setIsFocused] = (0, _element.useState)(false);
|
|
53
54
|
const {
|
|
54
55
|
base,
|
|
55
56
|
user,
|
|
@@ -97,10 +98,16 @@ function Variation(_ref) {
|
|
|
97
98
|
role: "button",
|
|
98
99
|
onClick: selectVariation,
|
|
99
100
|
onKeyDown: selectOnEnter,
|
|
100
|
-
tabIndex: "0"
|
|
101
|
+
tabIndex: "0",
|
|
102
|
+
"aria-label": variation === null || variation === void 0 ? void 0 : variation.title,
|
|
103
|
+
onFocus: () => setIsFocused(true),
|
|
104
|
+
onBlur: () => setIsFocused(false)
|
|
105
|
+
}, (0, _element.createElement)("div", {
|
|
106
|
+
className: "edit-site-global-styles-variations_item-preview"
|
|
101
107
|
}, (0, _element.createElement)(_preview.default, {
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
label: variation === null || variation === void 0 ? void 0 : variation.title,
|
|
109
|
+
isFocused: isFocused
|
|
110
|
+
}))));
|
|
104
111
|
}
|
|
105
112
|
|
|
106
113
|
function ScreenStyleVariations() {
|
|
@@ -113,14 +120,14 @@ function ScreenStyleVariations() {
|
|
|
113
120
|
}, []);
|
|
114
121
|
const withEmptyVariation = (0, _element.useMemo)(() => {
|
|
115
122
|
return [{
|
|
116
|
-
|
|
123
|
+
title: (0, _i18n.__)('Default'),
|
|
117
124
|
settings: {},
|
|
118
125
|
styles: {}
|
|
119
126
|
}, ...variations];
|
|
120
127
|
}, [variations]);
|
|
121
128
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
122
129
|
back: "/",
|
|
123
|
-
title: (0, _i18n.__)('
|
|
130
|
+
title: (0, _i18n.__)('Browse styles'),
|
|
124
131
|
description: (0, _i18n.__)('Choose a different style combination for the theme styles')
|
|
125
132
|
}), (0, _element.createElement)(_components.Card, {
|
|
126
133
|
size: "small",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"names":["compareVariations","a","b","styles","settings","Variation","variation","base","user","setUserConfig","GlobalStylesContext","context","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","ScreenStyleVariations","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"names":["compareVariations","a","b","styles","settings","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","GlobalStylesContext","context","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","title","ScreenStyleVariations","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;;;;;;;;AAWA;;AARA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAIA;AACA;AACA;;AAYA;AACA;AACA;AAMA,SAASA,iBAAT,CAA4BC,CAA5B,EAA+BC,CAA/B,EAAmC;AAClC,SAAO,qBAASD,CAAC,CAACE,MAAX,EAAmBD,CAAC,CAACC,MAArB,KAAiC,qBAASF,CAAC,CAACG,QAAX,EAAqBF,CAAC,CAACE,QAAvB,CAAxC;AACA;;AAED,SAASC,S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AAC,oBAAD,QACC,4BAAC,8BAAD;AAAM,IAAA,OAAO,EAAG;AAAhB,KACGI,kBADH,aACGA,kBADH,uBACGA,kBAAkB,CAAEC,GAApB,CAAyB,CAAEvB,SAAF,EAAawB,KAAb,KAC1B,4BAAC,SAAD;AAAW,IAAA,GAAG,EAAGA,KAAjB;AAAyB,IAAA,SAAS,EAAGxB;AAArC,IADC,CADH,CADD,CADD,CATD,CADD;AAqBA;;eAEciB,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEqual } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport {\n\t__experimentalGrid as Grid,\n\tCard,\n\tCardBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport { GlobalStylesContext } from './context';\nimport StylesPreview from './preview';\nimport ScreenHeader from './header';\n\nfunction compareVariations( a, b ) {\n\treturn isEqual( a.styles, b.styles ) && isEqual( a.settings, b.settings );\n}\n\nfunction Variation( { variation } ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base ] );\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => {\n\t\t\treturn {\n\t\t\t\tsettings: variation.settings,\n\t\t\t\tstyles: variation.styles,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo( () => {\n\t\treturn compareVariations( user, variation );\n\t}, [ user, variation ] );\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-global-styles-variations_item',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\taria-label={ variation?.title }\n\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-global-styles-variations_item-preview\">\n\t\t\t\t\t<StylesPreview\n\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nfunction ScreenStyleVariations() {\n\tconst { variations } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tvariations: select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t};\n\t}, [] );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variations,\n\t\t];\n\t}, [ variations ] );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback=\"/\"\n\t\t\t\ttitle={ __( 'Browse styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<Card size=\"small\" isBorderless>\n\t\t\t\t<CardBody>\n\t\t\t\t\t<Grid columns={ 2 }>\n\t\t\t\t\t\t{ withEmptyVariation?.map( ( variation, index ) => (\n\t\t\t\t\t\t\t<Variation key={ index } variation={ variation } />\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Grid>\n\t\t\t\t</CardBody>\n\t\t\t</Card>\n\t\t</>\n\t);\n}\n\nexport default ScreenStyleVariations;\n"]}
|
|
@@ -26,6 +26,8 @@ var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
|
|
|
26
26
|
|
|
27
27
|
var _globalStylesSidebar = _interopRequireDefault(require("./global-styles-sidebar"));
|
|
28
28
|
|
|
29
|
+
var _navigationMenuSidebar = _interopRequireDefault(require("./navigation-menu-sidebar"));
|
|
30
|
+
|
|
29
31
|
var _constants = require("../../store/constants");
|
|
30
32
|
|
|
31
33
|
var _settingsHeader = _interopRequireDefault(require("./settings-header"));
|
|
@@ -80,6 +82,15 @@ function SidebarComplementaryAreaFills() {
|
|
|
80
82
|
|
|
81
83
|
if (!isEditorSidebarOpened) {
|
|
82
84
|
sidebarName = hasBlockSelection ? _constants2.SIDEBAR_BLOCK : _constants2.SIDEBAR_TEMPLATE;
|
|
85
|
+
} // Conditionally include NavMenu sidebar in Plugin only.
|
|
86
|
+
// Optimise for dead code elimination.
|
|
87
|
+
// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
let MaybeNavigationMenuSidebar = 'Fragment';
|
|
91
|
+
|
|
92
|
+
if (process.env.IS_GUTENBERG_PLUGIN) {
|
|
93
|
+
MaybeNavigationMenuSidebar = _navigationMenuSidebar.default;
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_defaultSidebar.default, {
|
|
@@ -93,6 +104,6 @@ function SidebarComplementaryAreaFills() {
|
|
|
93
104
|
headerClassName: "edit-site-sidebar__panel-tabs"
|
|
94
105
|
}, sidebarName === _constants2.SIDEBAR_TEMPLATE && (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_templateCard.default, null)), sidebarName === _constants2.SIDEBAR_BLOCK && (0, _element.createElement)(InspectorSlot, {
|
|
95
106
|
bubblesVirtually: true
|
|
96
|
-
})), (0, _element.createElement)(_globalStylesSidebar.default, null));
|
|
107
|
+
})), (0, _element.createElement)(_globalStylesSidebar.default, null), (0, _element.createElement)(MaybeNavigationMenuSidebar, null));
|
|
97
108
|
}
|
|
98
109
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","blockEditorStore","getBlockSelectionStart","enableComplementaryArea","sidebarName","cog"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","blockEditorStore","getBlockSelectionStart","enableComplementaryArea","sidebarName","MaybeNavigationMenuSidebar","process","env","IS_GUTENBERG_PLUGIN","NavigationMenuSidebar","cog"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;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AAmBC,4BAAlD;AACA,GAhC8C,CAkC/C;AACA;AACA;;;AACA,MAAIM,0BAA0B,GAAG,UAAjC;;AAEA,MAAKC,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtCH,IAAAA,0BAA0B,GAAGI,8BAA7B;AACA;;AAED,SACC,qDACC,4BAAC,uBAAD;AACC,IAAA,UAAU,EAAGL,WADd;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,IAAI,EAAGM,UAHR;AAIC,IAAA,UAAU,EAAG,cAAI,wBAAJ,CAJd;AAKC,IAAA,MAAM,EAAG,4BAAC,uBAAD;AAAgB,MAAA,WAAW,EAAGN;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKL,4BAAhB,IACD,4BAAC,qBAAD,QACC,4BAAC,qBAAD,OADD,CATF,EAaGK,WAAW,KAAKN,yBAAhB,IACD,4BAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAdF,CADD,EAkBC,4BAAC,4BAAD,OAlBD,EAmBC,4BAAC,0BAAD,OAnBD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cog } from '@wordpress/icons';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport NavigationMenuSidebar from './navigation-menu-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport TemplateCard from './template-card';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst { sidebar, isEditorSidebarOpened, hasBlockSelection } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _sidebar = select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( STORE_NAME );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tSIDEBAR_BLOCK,\n\t\t\t\tSIDEBAR_TEMPLATE,\n\t\t\t].includes( _sidebar );\n\t\t\treturn {\n\t\t\t\tsidebar: _sidebar,\n\t\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\t\thasBlockSelection: !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) return;\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\t// Conditionally include NavMenu sidebar in Plugin only.\n\t// Optimise for dead code elimination.\n\t// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.\n\tlet MaybeNavigationMenuSidebar = 'Fragment';\n\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\tMaybeNavigationMenuSidebar = NavigationMenuSidebar;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ cog }\n\t\t\t\tcloseLabel={ __( 'Close settings sidebar' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t<GlobalStylesSidebar />\n\t\t\t<MaybeNavigationMenuSidebar />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = NavigationMenuSidebar;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
var _icons = require("@wordpress/icons");
|
|
17
|
+
|
|
18
|
+
var _defaultSidebar = _interopRequireDefault(require("../default-sidebar"));
|
|
19
|
+
|
|
20
|
+
var _navigationInspector = _interopRequireDefault(require("./navigation-inspector"));
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
29
|
+
function NavigationMenuSidebar() {
|
|
30
|
+
return (0, _element.createElement)(_defaultSidebar.default, {
|
|
31
|
+
className: "edit-site-navigation-menu-sidebar",
|
|
32
|
+
identifier: "edit-site/navigation-menu",
|
|
33
|
+
title: (0, _i18n.__)('Navigation Menus'),
|
|
34
|
+
icon: _icons.navigation,
|
|
35
|
+
closeLabel: (0, _i18n.__)('Close navigation menu sidebar'),
|
|
36
|
+
panelClassName: "edit-site-navigation-menu-sidebar__panel",
|
|
37
|
+
header: (0, _element.createElement)(_components.Flex, null, (0, _element.createElement)(_components.FlexBlock, null, (0, _element.createElement)("strong", null, (0, _i18n.__)('Navigation Menus'))))
|
|
38
|
+
}, (0, _element.createElement)(_navigationInspector.default, null));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/navigation-menu-sidebar/index.js"],"names":["NavigationMenuSidebar","navigation"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIe,SAASA,qBAAT,GAAiC;AAC/C,SACC,4BAAC,uBAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,UAAU,EAAC,2BAFZ;AAGC,IAAA,KAAK,EAAG,cAAI,kBAAJ,CAHT;AAIC,IAAA,IAAI,EAAGC,iBAJR;AAKC,IAAA,UAAU,EAAG,cAAI,+BAAJ,CALd;AAMC,IAAA,cAAc,EAAC,0CANhB;AAOC,IAAA,MAAM,EACL,4BAAC,gBAAD,QACC,4BAAC,qBAAD,QACC,4CAAU,cAAI,kBAAJ,CAAV,CADD,CADD;AARF,KAeC,4BAAC,4BAAD,OAfD,CADD;AAmBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexBlock, Flex } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from '../default-sidebar';\nimport NavigationInspector from './navigation-inspector';\n\nexport default function NavigationMenuSidebar() {\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-navigation-menu-sidebar\"\n\t\t\tidentifier=\"edit-site/navigation-menu\"\n\t\t\ttitle={ __( 'Navigation Menus' ) }\n\t\t\ticon={ navigation }\n\t\t\tcloseLabel={ __( 'Close navigation menu sidebar' ) }\n\t\t\tpanelClassName=\"edit-site-navigation-menu-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<strong>{ __( 'Navigation Menus' ) }</strong>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<NavigationInspector />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
|