@wordpress/edit-site 3.0.14 → 3.0.18-next.33ec3857e2.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/build/components/add-new-template/new-template-part.js +29 -18
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +30 -23
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +51 -0
- package/build/components/app/index.js.map +1 -0
- package/build/components/block-editor/back-button.js +8 -20
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/index.js +2 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +1 -0
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +0 -2
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js +20 -8
- package/build/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build/components/editor/index.js +11 -30
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +81 -22
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +10 -10
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +9 -10
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +1 -1
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +6 -10
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +8 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +6 -10
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/ui.js +27 -14
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/header/document-actions/index.js +3 -6
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/list/actions/index.js +1 -0
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/index.js +17 -15
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +4 -4
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +12 -13
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +26 -24
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +3 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build/components/routes/index.js +60 -0
- package/build/components/routes/index.js.map +1 -0
- package/build/components/routes/link.js +65 -0
- package/build/components/routes/link.js.map +1 -0
- package/build/components/routes/use-title.js +57 -0
- package/build/components/routes/use-title.js.map +1 -0
- package/build/components/sidebar/default-sidebar.js +4 -2
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +11 -0
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/template-card/template-areas.js +7 -4
- package/build/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build/components/template-details/index.js +12 -10
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +27 -10
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +7 -12
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/url-query-controller/index.js +41 -50
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +6 -0
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/index.js +1 -28
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/styles.js +18 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/index.js +29 -35
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +3 -23
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/site-export.js +67 -0
- package/build/plugins/site-export.js.map +1 -0
- package/build/plugins/welcome-guide-menu-item.js +1 -7
- package/build/plugins/welcome-guide-menu-item.js.map +1 -1
- package/build/store/actions.js +0 -27
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -14
- package/build/store/constants.js.map +1 -1
- package/build/store/reducer.js +7 -16
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -31
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +23 -0
- package/build/utils/get-is-list-page.js.map +1 -0
- package/build/utils/history.js +35 -0
- package/build/utils/history.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +27 -16
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +28 -18
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +35 -0
- package/build-module/components/app/index.js.map +1 -0
- package/build-module/components/block-editor/back-button.js +8 -19
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/index.js +2 -1
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +1 -0
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +0 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js +17 -9
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build-module/components/editor/index.js +13 -33
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +82 -23
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +10 -10
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +9 -11
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -11
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +9 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +7 -11
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/ui.js +26 -14
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +3 -6
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +1 -0
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/index.js +15 -15
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +4 -4
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +13 -13
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +24 -24
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +3 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build-module/components/routes/index.js +47 -0
- package/build-module/components/routes/index.js.map +1 -0
- package/build-module/components/routes/link.js +51 -0
- package/build-module/components/routes/link.js.map +1 -0
- package/build-module/components/routes/use-title.js +44 -0
- package/build-module/components/routes/use-title.js.map +1 -0
- package/build-module/components/sidebar/default-sidebar.js +4 -2
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +9 -0
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-areas.js +8 -4
- package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build-module/components/template-details/index.js +10 -9
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +24 -9
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +7 -12
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +40 -49
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +7 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -26
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +18 -2
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/index.js +28 -33
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +2 -18
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/site-export.js +51 -0
- package/build-module/plugins/site-export.js.map +1 -0
- package/build-module/plugins/welcome-guide-menu-item.js +2 -7
- package/build-module/plugins/welcome-guide-menu-item.js.map +1 -1
- package/build-module/store/actions.js +0 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -11
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/reducer.js +7 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +1 -27
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +16 -0
- package/build-module/utils/get-is-list-page.js.map +1 -0
- package/build-module/utils/history.js +25 -0
- package/build-module/utils/history.js.map +1 -0
- package/build-style/style-rtl.css +36 -61
- package/build-style/style.css +36 -61
- package/package.json +29 -28
- package/src/components/add-new-template/new-template-part.js +29 -11
- package/src/components/add-new-template/new-template.js +26 -12
- package/src/components/app/index.js +47 -0
- package/src/components/block-editor/back-button.js +6 -14
- package/src/components/block-editor/index.js +1 -0
- package/src/components/block-editor/resizable-editor.js +1 -0
- package/src/components/block-editor/style.scss +10 -18
- package/src/components/create-template-part-modal/index.js +0 -2
- package/src/components/edit-template-part-menu-button/index.js +16 -5
- package/src/components/editor/index.js +105 -131
- package/src/components/global-styles/border-panel.js +106 -42
- package/src/components/global-styles/gradients-palette-panel.js +12 -12
- package/src/components/global-styles/screen-background-color.js +7 -10
- package/src/components/global-styles/screen-colors.js +1 -1
- package/src/components/global-styles/screen-link-color.js +6 -14
- package/src/components/global-styles/screen-root.js +17 -7
- package/src/components/global-styles/screen-text-color.js +6 -14
- package/src/components/global-styles/style.scss +6 -17
- package/src/components/global-styles/test/use-global-styles-output.js +7 -1
- package/src/components/global-styles/ui.js +50 -25
- package/src/components/global-styles/use-global-styles-output.js +0 -1
- package/src/components/header/document-actions/index.js +3 -9
- package/src/components/header/document-actions/style.scss +1 -9
- package/src/components/header/style.scss +2 -1
- package/src/components/list/actions/index.js +1 -0
- package/src/components/list/index.js +11 -12
- package/src/components/list/style.scss +6 -11
- package/src/components/list/table.js +5 -5
- package/src/components/navigation-sidebar/index.js +18 -17
- package/src/components/navigation-sidebar/navigation-panel/index.js +16 -22
- package/src/components/navigation-sidebar/navigation-toggle/index.js +2 -0
- package/src/components/routes/index.js +53 -0
- package/src/components/routes/link.js +44 -0
- package/src/components/routes/use-title.js +56 -0
- package/src/components/sidebar/default-sidebar.js +2 -0
- package/src/components/sidebar/global-styles-sidebar.js +9 -0
- package/src/components/sidebar/style.scss +21 -14
- package/src/components/sidebar/template-card/template-areas.js +16 -4
- package/src/components/template-details/index.js +8 -6
- package/src/components/template-details/template-areas.js +31 -8
- package/src/components/template-part-converter/convert-to-template-part.js +4 -2
- package/src/components/url-query-controller/index.js +34 -45
- package/src/components/welcome-guide/editor.js +10 -1
- package/src/components/welcome-guide/index.js +6 -25
- package/src/components/welcome-guide/styles.js +20 -2
- package/src/index.js +33 -36
- package/src/plugins/index.js +2 -32
- package/src/plugins/site-export.js +52 -0
- package/src/plugins/welcome-guide-menu-item.js +2 -16
- package/src/store/actions.js +0 -23
- package/src/store/constants.js +0 -12
- package/src/store/reducer.js +12 -26
- package/src/store/selectors.js +1 -27
- package/src/store/test/reducer.js +22 -39
- package/src/store/test/selectors.js +3 -34
- package/src/utils/get-is-list-page.js +11 -0
- package/src/utils/history.js +35 -0
|
@@ -53,18 +53,6 @@ export default function GradientPalettePanel( { name } ) {
|
|
|
53
53
|
className="edit-site-global-styles-gradient-palette-panel"
|
|
54
54
|
spacing={ 10 }
|
|
55
55
|
>
|
|
56
|
-
<div>
|
|
57
|
-
<Heading className="edit-site-global-styles-gradient-palette-panel__duotone-heading">
|
|
58
|
-
{ __( 'Duotone' ) }
|
|
59
|
-
</Heading>
|
|
60
|
-
<DuotonePicker
|
|
61
|
-
duotonePalette={ duotonePalette }
|
|
62
|
-
disableCustomDuotone={ true }
|
|
63
|
-
disableCustomColors={ true }
|
|
64
|
-
clearable={ false }
|
|
65
|
-
onChange={ noop }
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
56
|
{ !! themeGradients && !! themeGradients.length && (
|
|
69
57
|
<PaletteEdit
|
|
70
58
|
canReset={ themeGradients !== baseThemeGradients }
|
|
@@ -94,6 +82,18 @@ export default function GradientPalettePanel( { name } ) {
|
|
|
94
82
|
) }
|
|
95
83
|
slugPrefix="custom-"
|
|
96
84
|
/>
|
|
85
|
+
<div>
|
|
86
|
+
<Heading className="edit-site-global-styles-gradient-palette-panel__duotone-heading">
|
|
87
|
+
{ __( 'Duotone' ) }
|
|
88
|
+
</Heading>
|
|
89
|
+
<DuotonePicker
|
|
90
|
+
duotonePalette={ duotonePalette }
|
|
91
|
+
disableCustomDuotone={ true }
|
|
92
|
+
disableCustomColors={ true }
|
|
93
|
+
clearable={ false }
|
|
94
|
+
onChange={ noop }
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
97
|
</VStack>
|
|
98
98
|
);
|
|
99
99
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -55,7 +55,6 @@ function ScreenBackgroundColor( { name } ) {
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const settings = [];
|
|
59
58
|
let backgroundSettings = {};
|
|
60
59
|
if ( hasBackgroundColor ) {
|
|
61
60
|
backgroundSettings = {
|
|
@@ -79,11 +78,10 @@ function ScreenBackgroundColor( { name } ) {
|
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
const controlProps = {
|
|
83
82
|
...backgroundSettings,
|
|
84
83
|
...gradientSettings,
|
|
85
|
-
|
|
86
|
-
} );
|
|
84
|
+
};
|
|
87
85
|
|
|
88
86
|
return (
|
|
89
87
|
<>
|
|
@@ -91,13 +89,11 @@ function ScreenBackgroundColor( { name } ) {
|
|
|
91
89
|
back={ parentMenu + '/colors' }
|
|
92
90
|
title={ __( 'Background' ) }
|
|
93
91
|
description={ __(
|
|
94
|
-
'Set a background color or gradient for the whole
|
|
92
|
+
'Set a background color or gradient for the whole site.'
|
|
95
93
|
) }
|
|
96
94
|
/>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
title={ __( 'Color' ) }
|
|
100
|
-
settings={ settings }
|
|
95
|
+
<ColorGradientControl
|
|
96
|
+
className="edit-site-screen-background-color__control"
|
|
101
97
|
colors={ colorsPerOrigin }
|
|
102
98
|
gradients={ gradientsPerOrigin }
|
|
103
99
|
disableCustomColors={ ! areCustomSolidsEnabled }
|
|
@@ -106,6 +102,7 @@ function ScreenBackgroundColor( { name } ) {
|
|
|
106
102
|
showTitle={ false }
|
|
107
103
|
enableAlpha
|
|
108
104
|
__experimentalIsRenderedInSidebar
|
|
105
|
+
{ ...controlProps }
|
|
109
106
|
/>
|
|
110
107
|
</>
|
|
111
108
|
);
|
|
@@ -96,7 +96,7 @@ function ScreenColors( { name } ) {
|
|
|
96
96
|
back={ parentMenu ? parentMenu : '/' }
|
|
97
97
|
title={ __( 'Colors' ) }
|
|
98
98
|
description={ __(
|
|
99
|
-
'Manage palettes and the default color of different global elements on the
|
|
99
|
+
'Manage palettes and the default color of different global elements on the site.'
|
|
100
100
|
) }
|
|
101
101
|
/>
|
|
102
102
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -44,15 +44,6 @@ function ScreenLinkColor( { name } ) {
|
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const settings = [
|
|
48
|
-
{
|
|
49
|
-
colorValue: linkColor,
|
|
50
|
-
onColorChange: setLinkColor,
|
|
51
|
-
label: __( 'Link color' ),
|
|
52
|
-
clearable: linkColor === userLinkColor,
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
|
|
56
47
|
return (
|
|
57
48
|
<>
|
|
58
49
|
<ScreenHeader
|
|
@@ -62,16 +53,17 @@ function ScreenLinkColor( { name } ) {
|
|
|
62
53
|
'Set the default color used for links across the site.'
|
|
63
54
|
) }
|
|
64
55
|
/>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
title={ __( 'Color' ) }
|
|
68
|
-
settings={ settings }
|
|
56
|
+
<ColorGradientControl
|
|
57
|
+
className="edit-site-screen-link-color__control"
|
|
69
58
|
colors={ colorsPerOrigin }
|
|
70
59
|
disableCustomColors={ ! areCustomSolidsEnabled }
|
|
71
60
|
__experimentalHasMultipleOrigins
|
|
72
61
|
showTitle={ false }
|
|
73
62
|
enableAlpha
|
|
74
63
|
__experimentalIsRenderedInSidebar
|
|
64
|
+
colorValue={ linkColor }
|
|
65
|
+
onColorChange={ setLinkColor }
|
|
66
|
+
clearable={ linkColor === userLinkColor }
|
|
75
67
|
/>
|
|
76
68
|
</>
|
|
77
69
|
);
|
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
import {
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
6
|
__experimentalItem as Item,
|
|
7
|
+
__experimentalHStack as HStack,
|
|
8
|
+
FlexItem,
|
|
7
9
|
CardBody,
|
|
8
10
|
Card,
|
|
9
11
|
CardDivider,
|
|
10
12
|
} from '@wordpress/components';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
13
|
+
import { isRTL, __ } from '@wordpress/i18n';
|
|
14
|
+
import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* Internal dependencies
|
|
@@ -33,14 +36,21 @@ function ScreenRoot() {
|
|
|
33
36
|
<CardBody>
|
|
34
37
|
<ItemGroup>
|
|
35
38
|
<Item>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
) }
|
|
40
|
-
</p>
|
|
39
|
+
{ __(
|
|
40
|
+
'Customize the appearance of specific blocks for the whole site.'
|
|
41
|
+
) }
|
|
41
42
|
</Item>
|
|
42
43
|
<NavigationButton path="/blocks">
|
|
43
|
-
|
|
44
|
+
<HStack justify="space-between">
|
|
45
|
+
<FlexItem>{ __( 'Blocks' ) }</FlexItem>
|
|
46
|
+
<FlexItem>
|
|
47
|
+
<Icon
|
|
48
|
+
icon={
|
|
49
|
+
isRTL() ? chevronLeft : chevronRight
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
</FlexItem>
|
|
53
|
+
</HStack>
|
|
44
54
|
</NavigationButton>
|
|
45
55
|
</ItemGroup>
|
|
46
56
|
</CardBody>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -36,15 +36,6 @@ function ScreenTextColor( { name } ) {
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const settings = [
|
|
40
|
-
{
|
|
41
|
-
colorValue: color,
|
|
42
|
-
onColorChange: setColor,
|
|
43
|
-
label: __( 'Text color' ),
|
|
44
|
-
clearable: color === userColor,
|
|
45
|
-
},
|
|
46
|
-
];
|
|
47
|
-
|
|
48
39
|
return (
|
|
49
40
|
<>
|
|
50
41
|
<ScreenHeader
|
|
@@ -54,16 +45,17 @@ function ScreenTextColor( { name } ) {
|
|
|
54
45
|
'Set the default color used for text across the site.'
|
|
55
46
|
) }
|
|
56
47
|
/>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
title={ __( 'Color' ) }
|
|
60
|
-
settings={ settings }
|
|
48
|
+
<ColorGradientControl
|
|
49
|
+
className="edit-site-screen-text-color__control"
|
|
61
50
|
colors={ colorsPerOrigin }
|
|
62
51
|
disableCustomColors={ ! areCustomSolidsEnabled }
|
|
63
52
|
__experimentalHasMultipleOrigins
|
|
64
53
|
showTitle={ false }
|
|
65
54
|
enableAlpha
|
|
66
55
|
__experimentalIsRenderedInSidebar
|
|
56
|
+
colorValue={ color }
|
|
57
|
+
onColorChange={ setColor }
|
|
58
|
+
clearable={ color === userColor }
|
|
67
59
|
/>
|
|
68
60
|
</>
|
|
69
61
|
);
|
|
@@ -4,15 +4,6 @@
|
|
|
4
4
|
justify-content: center;
|
|
5
5
|
min-height: 152px;
|
|
6
6
|
line-height: 1;
|
|
7
|
-
|
|
8
|
-
.component-color-indicator {
|
|
9
|
-
border-radius: 50%;
|
|
10
|
-
border: 0;
|
|
11
|
-
height: 36px;
|
|
12
|
-
width: 36px;
|
|
13
|
-
margin-left: 0;
|
|
14
|
-
padding: 0;
|
|
15
|
-
}
|
|
16
7
|
}
|
|
17
8
|
|
|
18
9
|
.edit-site-typography-panel__preview {
|
|
@@ -43,14 +34,6 @@
|
|
|
43
34
|
margin: $grid-unit-20;
|
|
44
35
|
|
|
45
36
|
.component-color-indicator {
|
|
46
|
-
margin-left: 0;
|
|
47
|
-
display: block;
|
|
48
|
-
border-radius: 50%;
|
|
49
|
-
height: 24px;
|
|
50
|
-
width: 24px;
|
|
51
|
-
padding: 0;
|
|
52
|
-
border: $border-width solid $gray-300;
|
|
53
|
-
|
|
54
37
|
// Show a diagonal line (crossed out) for empty swatches.
|
|
55
38
|
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
56
39
|
}
|
|
@@ -83,3 +66,9 @@ h2.edit-site-global-styles-gradient-palette-panel__duotone-heading.components-he
|
|
|
83
66
|
font-size: 11px;
|
|
84
67
|
margin-bottom: $grid-unit-10;
|
|
85
68
|
}
|
|
69
|
+
|
|
70
|
+
.edit-site-screen-text-color__control,
|
|
71
|
+
.edit-site-screen-link-color__control,
|
|
72
|
+
.edit-site-screen-background-color__control {
|
|
73
|
+
padding: $grid-unit-20;
|
|
74
|
+
}
|
|
@@ -217,10 +217,16 @@ describe( 'global styles renderer', () => {
|
|
|
217
217
|
slug: 'black',
|
|
218
218
|
color: 'black',
|
|
219
219
|
},
|
|
220
|
+
{
|
|
221
|
+
name: 'White to Black',
|
|
222
|
+
slug: 'white2black',
|
|
223
|
+
color: 'value',
|
|
224
|
+
},
|
|
220
225
|
],
|
|
221
226
|
},
|
|
222
227
|
},
|
|
223
228
|
custom: {
|
|
229
|
+
white2black: 'value',
|
|
224
230
|
'font-primary': 'value',
|
|
225
231
|
'line-height': {
|
|
226
232
|
body: 1.7,
|
|
@@ -257,7 +263,7 @@ describe( 'global styles renderer', () => {
|
|
|
257
263
|
};
|
|
258
264
|
|
|
259
265
|
expect( toCustomProperties( tree, blockSelectors ) ).toEqual(
|
|
260
|
-
'body{--wp--preset--color--white: white;--wp--preset--color--black: black;--wp--custom--font-primary: value;--wp--custom--line-height--body: 1.7;--wp--custom--line-height--heading: 1.3;}h1,h2,h3,h4,h5,h6{--wp--preset--font-size--small: 12px;--wp--preset--font-size--medium: 23px;}'
|
|
266
|
+
'body{--wp--preset--color--white: white;--wp--preset--color--black: black;--wp--preset--color--white-2-black: value;--wp--custom--white-2-black: value;--wp--custom--font-primary: value;--wp--custom--line-height--body: 1.7;--wp--custom--line-height--heading: 1.3;}h1,h2,h3,h4,h5,h6{--wp--preset--font-size--small: 12px;--wp--preset--font-size--medium: 23px;}'
|
|
261
267
|
);
|
|
262
268
|
} );
|
|
263
269
|
} );
|
|
@@ -22,46 +22,68 @@ import ScreenTextColor from './screen-text-color';
|
|
|
22
22
|
import ScreenLinkColor from './screen-link-color';
|
|
23
23
|
import ScreenLayout from './screen-layout';
|
|
24
24
|
|
|
25
|
+
function GlobalStylesNavigationScreen( { className, ...props } ) {
|
|
26
|
+
return (
|
|
27
|
+
<NavigatorScreen
|
|
28
|
+
className={ [
|
|
29
|
+
'edit-site-global-styles-sidebar__navigator-screen',
|
|
30
|
+
className,
|
|
31
|
+
]
|
|
32
|
+
.filter( Boolean )
|
|
33
|
+
.join( ' ' ) }
|
|
34
|
+
{ ...props }
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
25
39
|
function ContextScreens( { name } ) {
|
|
26
40
|
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
27
41
|
|
|
28
42
|
return (
|
|
29
43
|
<>
|
|
30
|
-
<
|
|
44
|
+
<GlobalStylesNavigationScreen path={ parentMenu + '/typography' }>
|
|
31
45
|
<ScreenTypography name={ name } />
|
|
32
|
-
</
|
|
46
|
+
</GlobalStylesNavigationScreen>
|
|
33
47
|
|
|
34
|
-
<
|
|
48
|
+
<GlobalStylesNavigationScreen
|
|
49
|
+
path={ parentMenu + '/typography/text' }
|
|
50
|
+
>
|
|
35
51
|
<ScreenTypographyElement name={ name } element="text" />
|
|
36
|
-
</
|
|
52
|
+
</GlobalStylesNavigationScreen>
|
|
37
53
|
|
|
38
|
-
<
|
|
54
|
+
<GlobalStylesNavigationScreen
|
|
55
|
+
path={ parentMenu + '/typography/link' }
|
|
56
|
+
>
|
|
39
57
|
<ScreenTypographyElement name={ name } element="link" />
|
|
40
|
-
</
|
|
58
|
+
</GlobalStylesNavigationScreen>
|
|
41
59
|
|
|
42
|
-
<
|
|
60
|
+
<GlobalStylesNavigationScreen path={ parentMenu + '/colors' }>
|
|
43
61
|
<ScreenColors name={ name } />
|
|
44
|
-
</
|
|
62
|
+
</GlobalStylesNavigationScreen>
|
|
45
63
|
|
|
46
|
-
<
|
|
64
|
+
<GlobalStylesNavigationScreen
|
|
65
|
+
path={ parentMenu + '/colors/palette' }
|
|
66
|
+
>
|
|
47
67
|
<ScreenColorPalette name={ name } />
|
|
48
|
-
</
|
|
68
|
+
</GlobalStylesNavigationScreen>
|
|
49
69
|
|
|
50
|
-
<
|
|
70
|
+
<GlobalStylesNavigationScreen
|
|
71
|
+
path={ parentMenu + '/colors/background' }
|
|
72
|
+
>
|
|
51
73
|
<ScreenBackgroundColor name={ name } />
|
|
52
|
-
</
|
|
74
|
+
</GlobalStylesNavigationScreen>
|
|
53
75
|
|
|
54
|
-
<
|
|
76
|
+
<GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>
|
|
55
77
|
<ScreenTextColor name={ name } />
|
|
56
|
-
</
|
|
78
|
+
</GlobalStylesNavigationScreen>
|
|
57
79
|
|
|
58
|
-
<
|
|
80
|
+
<GlobalStylesNavigationScreen path={ parentMenu + '/colors/link' }>
|
|
59
81
|
<ScreenLinkColor name={ name } />
|
|
60
|
-
</
|
|
82
|
+
</GlobalStylesNavigationScreen>
|
|
61
83
|
|
|
62
|
-
<
|
|
84
|
+
<GlobalStylesNavigationScreen path={ parentMenu + '/layout' }>
|
|
63
85
|
<ScreenLayout name={ name } />
|
|
64
|
-
</
|
|
86
|
+
</GlobalStylesNavigationScreen>
|
|
65
87
|
</>
|
|
66
88
|
);
|
|
67
89
|
}
|
|
@@ -70,22 +92,25 @@ function GlobalStylesUI() {
|
|
|
70
92
|
const blocks = getBlockTypes();
|
|
71
93
|
|
|
72
94
|
return (
|
|
73
|
-
<NavigatorProvider
|
|
74
|
-
|
|
95
|
+
<NavigatorProvider
|
|
96
|
+
className="edit-site-global-styles-sidebar__navigator-provider"
|
|
97
|
+
initialPath="/"
|
|
98
|
+
>
|
|
99
|
+
<GlobalStylesNavigationScreen path="/">
|
|
75
100
|
<ScreenRoot />
|
|
76
|
-
</
|
|
101
|
+
</GlobalStylesNavigationScreen>
|
|
77
102
|
|
|
78
|
-
<
|
|
103
|
+
<GlobalStylesNavigationScreen path="/blocks">
|
|
79
104
|
<ScreenBlockList />
|
|
80
|
-
</
|
|
105
|
+
</GlobalStylesNavigationScreen>
|
|
81
106
|
|
|
82
107
|
{ blocks.map( ( block ) => (
|
|
83
|
-
<
|
|
108
|
+
<GlobalStylesNavigationScreen
|
|
84
109
|
key={ 'menu-block-' + block.name }
|
|
85
110
|
path={ '/blocks/' + block.name }
|
|
86
111
|
>
|
|
87
112
|
<ScreenBlock name={ block.name } />
|
|
88
|
-
</
|
|
113
|
+
</GlobalStylesNavigationScreen>
|
|
89
114
|
) ) }
|
|
90
115
|
|
|
91
116
|
<ContextScreens />
|
|
@@ -106,22 +106,16 @@ export default function DocumentActions( {
|
|
|
106
106
|
>
|
|
107
107
|
<Text
|
|
108
108
|
size="body"
|
|
109
|
-
className="edit-site-document-actions__title
|
|
109
|
+
className="edit-site-document-actions__title"
|
|
110
|
+
as="h1"
|
|
110
111
|
>
|
|
111
112
|
<VisuallyHidden as="span">
|
|
112
113
|
{ sprintf(
|
|
113
114
|
/* translators: %s: the entity being edited, like "template"*/
|
|
114
|
-
__( 'Editing %s:' ),
|
|
115
|
+
__( 'Editing %s: ' ),
|
|
115
116
|
entityLabel
|
|
116
117
|
) }
|
|
117
118
|
</VisuallyHidden>
|
|
118
|
-
</Text>
|
|
119
|
-
|
|
120
|
-
<Text
|
|
121
|
-
size="body"
|
|
122
|
-
className="edit-site-document-actions__title"
|
|
123
|
-
as="h1"
|
|
124
|
-
>
|
|
125
119
|
{ entityTitle }
|
|
126
120
|
</Text>
|
|
127
121
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
justify-content: center;
|
|
5
|
+
padding: 0 $grid-unit;
|
|
5
6
|
height: 100%;
|
|
6
7
|
// Flex items will, by default, refuse to shrink below a minimum
|
|
7
8
|
// intrinsic width. In order to shrink this flexbox item, and
|
|
@@ -40,15 +41,6 @@
|
|
|
40
41
|
white-space: nowrap;
|
|
41
42
|
overflow: hidden;
|
|
42
43
|
text-overflow: ellipsis;
|
|
43
|
-
max-width: 120px;
|
|
44
|
-
|
|
45
|
-
@include break-medium() {
|
|
46
|
-
max-width: 75px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@include break-xlarge() {
|
|
50
|
-
max-width: 180px;
|
|
51
|
-
}
|
|
52
44
|
}
|
|
53
45
|
|
|
54
46
|
.edit-site-document-actions__secondary-item {
|
|
@@ -25,6 +25,8 @@ $header-toolbar-min-width: 335px;
|
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
height: 100%;
|
|
28
|
+
flex-grow: 1;
|
|
29
|
+
justify-content: center;
|
|
28
30
|
// Flex items will, by default, refuse to shrink below a minimum
|
|
29
31
|
// intrinsic width. In order to shrink this flexbox item, and
|
|
30
32
|
// subsequently truncate child text, we set an explicit min-width.
|
|
@@ -109,7 +111,6 @@ body.is-navigation-sidebar-open {
|
|
|
109
111
|
.edit-site-header__actions {
|
|
110
112
|
display: inline-flex;
|
|
111
113
|
align-items: center;
|
|
112
|
-
flex-wrap: wrap;
|
|
113
114
|
padding-right: $grid-unit-05;
|
|
114
115
|
|
|
115
116
|
.interface-pinned-items {
|
|
@@ -21,8 +21,14 @@ import Header from './header';
|
|
|
21
21
|
import NavigationSidebar from '../navigation-sidebar';
|
|
22
22
|
import Table from './table';
|
|
23
23
|
import { store as editSiteStore } from '../../store';
|
|
24
|
+
import { useLocation } from '../routes';
|
|
25
|
+
import useTitle from '../routes/use-title';
|
|
26
|
+
|
|
27
|
+
export default function List() {
|
|
28
|
+
const {
|
|
29
|
+
params: { postType: templateType },
|
|
30
|
+
} = useLocation();
|
|
24
31
|
|
|
25
|
-
export default function List( { templateType } ) {
|
|
26
32
|
useRegisterShortcuts();
|
|
27
33
|
|
|
28
34
|
const { previousShortcut, nextShortcut, isNavigationOpen } = useSelect(
|
|
@@ -47,6 +53,8 @@ export default function List( { templateType } ) {
|
|
|
47
53
|
[ templateType ]
|
|
48
54
|
);
|
|
49
55
|
|
|
56
|
+
useTitle( postType?.labels?.name );
|
|
57
|
+
|
|
50
58
|
// `postType` could load in asynchronously. Only provide the detailed region labels if
|
|
51
59
|
// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.
|
|
52
60
|
const itemsListLabel = postType?.labels?.items_list;
|
|
@@ -75,18 +83,9 @@ export default function List( { templateType } ) {
|
|
|
75
83
|
...detailedRegionLabels,
|
|
76
84
|
} }
|
|
77
85
|
header={ <Header templateType={ templateType } /> }
|
|
78
|
-
drawer={
|
|
79
|
-
<NavigationSidebar
|
|
80
|
-
activeTemplateType={ templateType }
|
|
81
|
-
isDefaultOpen
|
|
82
|
-
/>
|
|
83
|
-
}
|
|
86
|
+
drawer={ <NavigationSidebar.Slot /> }
|
|
84
87
|
notices={ <EditorSnackbars /> }
|
|
85
|
-
content={
|
|
86
|
-
<main className="edit-site-list-main">
|
|
87
|
-
<Table templateType={ templateType } />
|
|
88
|
-
</main>
|
|
89
|
-
}
|
|
88
|
+
content={ <Table templateType={ templateType } /> }
|
|
90
89
|
shortcuts={ {
|
|
91
90
|
previous: previousShortcut,
|
|
92
91
|
next: nextShortcut,
|
|
@@ -44,18 +44,13 @@
|
|
|
44
44
|
|
|
45
45
|
.interface-interface-skeleton__content {
|
|
46
46
|
background: $white;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: $grid-unit-20;
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
padding: $grid-unit-20;
|
|
56
|
-
|
|
57
|
-
@include break-medium() {
|
|
58
|
-
padding: $grid-unit * 9;
|
|
50
|
+
@include break-medium() {
|
|
51
|
+
padding: $grid-unit * 9;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
56
|
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
VisuallyHidden,
|
|
9
9
|
__experimentalHeading as Heading,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Internal dependencies
|
|
15
14
|
*/
|
|
15
|
+
import Link from '../routes/link';
|
|
16
16
|
import Actions from './actions';
|
|
17
17
|
import AddedBy from './added-by';
|
|
18
18
|
|
|
@@ -92,15 +92,15 @@ export default function Table( { templateType } ) {
|
|
|
92
92
|
>
|
|
93
93
|
<td className="edit-site-list-table-column" role="cell">
|
|
94
94
|
<Heading level={ 4 }>
|
|
95
|
-
<
|
|
96
|
-
|
|
95
|
+
<Link
|
|
96
|
+
params={ {
|
|
97
97
|
postId: template.id,
|
|
98
98
|
postType: template.type,
|
|
99
|
-
}
|
|
99
|
+
} }
|
|
100
100
|
>
|
|
101
101
|
{ template.title?.rendered ||
|
|
102
102
|
template.slug }
|
|
103
|
-
</
|
|
103
|
+
</Link>
|
|
104
104
|
</Heading>
|
|
105
105
|
{ template.description }
|
|
106
106
|
</td>
|
|
@@ -18,30 +18,31 @@ export const {
|
|
|
18
18
|
Slot: NavigationPanelPreviewSlot,
|
|
19
19
|
} = createSlotFill( 'EditSiteNavigationPanelPreview' );
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} )
|
|
21
|
+
const {
|
|
22
|
+
Fill: NavigationSidebarFill,
|
|
23
|
+
Slot: NavigationSidebarSlot,
|
|
24
|
+
} = createSlotFill( 'EditSiteNavigationSidebar' );
|
|
25
|
+
|
|
26
|
+
function NavigationSidebar( { isDefaultOpen = false, activeTemplateType } ) {
|
|
25
27
|
const isDesktopViewport = useViewportMatch( 'medium' );
|
|
26
28
|
const { setIsNavigationPanelOpened } = useDispatch( editSiteStore );
|
|
27
29
|
|
|
28
|
-
useEffect(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// When transitioning to mobile/tablet, close the navigation.
|
|
35
|
-
if ( ! isDesktopViewport ) {
|
|
36
|
-
setIsNavigationPanelOpened( false );
|
|
37
|
-
}
|
|
38
|
-
}, [ isDefaultOpen, isDesktopViewport, setIsNavigationPanelOpened ] );
|
|
30
|
+
useEffect(
|
|
31
|
+
function autoOpenNavigationPanelOnViewportChange() {
|
|
32
|
+
setIsNavigationPanelOpened( isDefaultOpen && isDesktopViewport );
|
|
33
|
+
},
|
|
34
|
+
[ isDefaultOpen, isDesktopViewport, setIsNavigationPanelOpened ]
|
|
35
|
+
);
|
|
39
36
|
|
|
40
37
|
return (
|
|
41
|
-
|
|
38
|
+
<NavigationSidebarFill>
|
|
42
39
|
<NavigationToggle />
|
|
43
40
|
<NavigationPanel activeItem={ activeTemplateType } />
|
|
44
41
|
<NavigationPanelPreviewSlot />
|
|
45
|
-
|
|
42
|
+
</NavigationSidebarFill>
|
|
46
43
|
);
|
|
47
44
|
}
|
|
45
|
+
|
|
46
|
+
NavigationSidebar.Slot = NavigationSidebarSlot;
|
|
47
|
+
|
|
48
|
+
export default NavigationSidebar;
|