@wordpress/edit-site 3.0.17 → 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/block-editor/resizable-editor.js +1 -0
- package/build/components/block-editor/resizable-editor.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/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-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/list/actions/index.js +1 -0
- package/build/components/list/actions/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/sidebar/default-sidebar.js +4 -2
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +1 -0
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/plugins/site-export.js +7 -1
- package/build/plugins/site-export.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/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/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-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/list/actions/index.js +1 -0
- package/build-module/components/list/actions/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/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 +1 -0
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/plugins/site-export.js +7 -1
- package/build-module/plugins/site-export.js.map +1 -1
- package/build-style/style-rtl.css +35 -55
- package/build-style/style.css +35 -55
- package/package.json +28 -28
- package/src/components/block-editor/resizable-editor.js +1 -0
- package/src/components/block-editor/style.scss +10 -18
- package/src/components/global-styles/border-panel.js +106 -42
- 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-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/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/navigation-sidebar/navigation-toggle/index.js +2 -0
- package/src/components/sidebar/default-sidebar.js +2 -0
- package/src/components/sidebar/global-styles-sidebar.js +1 -0
- package/src/components/sidebar/style.scss +21 -14
- package/src/plugins/site-export.js +5 -1
|
@@ -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 />
|
|
@@ -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 {
|
|
@@ -79,6 +79,8 @@ function NavigationToggle( { icon } ) {
|
|
|
79
79
|
<Button
|
|
80
80
|
className="edit-site-navigation-toggle__button has-icon"
|
|
81
81
|
label={ __( 'Toggle navigation' ) }
|
|
82
|
+
// isPressed will add unwanted styles.
|
|
83
|
+
aria-pressed={ isNavigationOpen }
|
|
82
84
|
onClick={ toggleNavigationPanel }
|
|
83
85
|
showTooltip
|
|
84
86
|
>
|
|
@@ -15,6 +15,7 @@ export default function DefaultSidebar( {
|
|
|
15
15
|
closeLabel,
|
|
16
16
|
header,
|
|
17
17
|
headerClassName,
|
|
18
|
+
panelClassName,
|
|
18
19
|
} ) {
|
|
19
20
|
return (
|
|
20
21
|
<>
|
|
@@ -27,6 +28,7 @@ export default function DefaultSidebar( {
|
|
|
27
28
|
closeLabel={ closeLabel }
|
|
28
29
|
header={ header }
|
|
29
30
|
headerClassName={ headerClassName }
|
|
31
|
+
panelClassName={ panelClassName }
|
|
30
32
|
>
|
|
31
33
|
{ children }
|
|
32
34
|
</ComplementaryArea>
|
|
@@ -17,6 +17,23 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
.edit-site-global-styles-sidebar {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
height: 100%;
|
|
24
|
+
|
|
25
|
+
&__panel,
|
|
26
|
+
&__navigator-provider {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
flex: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__navigator-screen {
|
|
33
|
+
flex: 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
20
37
|
.edit-site-global-styles-sidebar .interface-complementary-area-header .components-button.has-icon {
|
|
21
38
|
margin-left: 0;
|
|
22
39
|
}
|
|
@@ -25,20 +42,6 @@
|
|
|
25
42
|
margin-left: auto;
|
|
26
43
|
}
|
|
27
44
|
|
|
28
|
-
.edit-site-global-styles-sidebar__border-controls-row {
|
|
29
|
-
display: flex;
|
|
30
|
-
justify-content: space-between;
|
|
31
|
-
margin-bottom: $grid-unit-15;
|
|
32
|
-
|
|
33
|
-
> * {
|
|
34
|
-
width: calc(50% - #{ $grid-unit-10 });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.components-border-style-control__buttons {
|
|
38
|
-
margin-bottom: 0;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
45
|
.edit-site-global-styles-sidebar .components-navigation__menu-title-heading {
|
|
43
46
|
font-size: $default-font-size * 1.2;
|
|
44
47
|
font-weight: 500;
|
|
@@ -53,6 +56,10 @@
|
|
|
53
56
|
border: 0;
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
.edit-site-global-styles-sidebar .components-tools-panel-item.single-column {
|
|
60
|
+
grid-column: span 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
56
63
|
.edit-site-global-styles-sidebar__blocks-group {
|
|
57
64
|
padding-top: $grid-unit-30;
|
|
58
65
|
border-top: $border-width solid $gray-200;
|
|
@@ -25,7 +25,11 @@ export default function SiteExport() {
|
|
|
25
25
|
const blob = await response.blob();
|
|
26
26
|
|
|
27
27
|
downloadjs( blob, 'edit-site-export.zip', 'application/zip' );
|
|
28
|
-
} catch (
|
|
28
|
+
} catch ( errorResponse ) {
|
|
29
|
+
let error = {};
|
|
30
|
+
try {
|
|
31
|
+
error = await errorResponse.json();
|
|
32
|
+
} catch ( e ) {}
|
|
29
33
|
const errorMessage =
|
|
30
34
|
error.message && error.code !== 'unknown_error'
|
|
31
35
|
? error.message
|