@wordpress/edit-site 4.4.0 → 4.5.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 +1 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/global-styles/context-menu.js +3 -3
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/header.js +15 -11
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +4 -4
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +3 -3
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-root.js +13 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +1 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/build-module/components/block-editor/index.js +2 -2
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +4 -4
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/header.js +16 -11
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +3 -3
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -2
- package/build-module/components/global-styles/palette.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 +4 -4
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +15 -5
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +2 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +19 -29
- package/build-style/style.css +19 -29
- package/package.json +29 -29
- package/src/components/block-editor/index.js +2 -2
- package/src/components/global-styles/context-menu.js +7 -7
- package/src/components/global-styles/header.js +20 -17
- package/src/components/global-styles/navigation-button.js +3 -3
- package/src/components/global-styles/palette.js +3 -3
- package/src/components/global-styles/screen-block-list.js +3 -3
- package/src/components/global-styles/screen-colors.js +7 -7
- package/src/components/global-styles/screen-root.js +34 -24
- package/src/components/global-styles/screen-typography.js +3 -3
- package/src/components/header/style.scss +14 -29
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/src/components/sidebar/index.js +2 -2
- package/src/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -7
- package/src/components/sidebar/style.scss +6 -0
- package/src/index.js +0 -1
|
@@ -16,7 +16,7 @@ import { useMemo } from '@wordpress/element';
|
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
18
|
import Subtitle from './subtitle';
|
|
19
|
-
import {
|
|
19
|
+
import { NavigationButtonAsItem } from './navigation-button';
|
|
20
20
|
import { useSetting } from './hooks';
|
|
21
21
|
import ColorIndicatorWrapper from './color-indicator-wrapper';
|
|
22
22
|
|
|
@@ -58,7 +58,7 @@ function Palette( { name } ) {
|
|
|
58
58
|
<VStack spacing={ 3 }>
|
|
59
59
|
<Subtitle>{ __( 'Palette' ) }</Subtitle>
|
|
60
60
|
<ItemGroup isBordered isSeparated>
|
|
61
|
-
<
|
|
61
|
+
<NavigationButtonAsItem path={ screenPath }>
|
|
62
62
|
<HStack
|
|
63
63
|
direction={
|
|
64
64
|
colors.length === 0 ? 'row-reverse' : 'row'
|
|
@@ -73,7 +73,7 @@ function Palette( { name } ) {
|
|
|
73
73
|
</ZStack>
|
|
74
74
|
<FlexItem>{ paletteButtonText }</FlexItem>
|
|
75
75
|
</HStack>
|
|
76
|
-
</
|
|
76
|
+
</NavigationButtonAsItem>
|
|
77
77
|
</ItemGroup>
|
|
78
78
|
</VStack>
|
|
79
79
|
);
|
|
@@ -22,7 +22,7 @@ import { useHasColorPanel } from './color-utils';
|
|
|
22
22
|
import { useHasDimensionsPanel } from './dimensions-panel';
|
|
23
23
|
import { useHasTypographyPanel } from './typography-panel';
|
|
24
24
|
import ScreenHeader from './header';
|
|
25
|
-
import {
|
|
25
|
+
import { NavigationButtonAsItem } from './navigation-button';
|
|
26
26
|
|
|
27
27
|
function useSortedBlockTypes() {
|
|
28
28
|
const blockItems = useSelect(
|
|
@@ -61,12 +61,12 @@ function BlockMenuItem( { block } ) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
|
-
<
|
|
64
|
+
<NavigationButtonAsItem path={ '/blocks/' + block.name }>
|
|
65
65
|
<HStack justify="flex-start">
|
|
66
66
|
<BlockIcon icon={ block.icon } />
|
|
67
67
|
<FlexItem>{ block.title }</FlexItem>
|
|
68
68
|
</HStack>
|
|
69
|
-
</
|
|
69
|
+
</NavigationButtonAsItem>
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
*/
|
|
16
16
|
import ScreenHeader from './header';
|
|
17
17
|
import Palette from './palette';
|
|
18
|
-
import {
|
|
18
|
+
import { NavigationButtonAsItem } from './navigation-button';
|
|
19
19
|
import { getSupportedGlobalStylesPanels, useStyle } from './hooks';
|
|
20
20
|
import Subtitle from './subtitle';
|
|
21
21
|
import ColorIndicatorWrapper from './color-indicator-wrapper';
|
|
@@ -33,7 +33,7 @@ function BackgroundColorItem( { name, parentMenu } ) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<
|
|
36
|
+
<NavigationButtonAsItem path={ parentMenu + '/colors/background' }>
|
|
37
37
|
<HStack justify="flex-start">
|
|
38
38
|
<ColorIndicatorWrapper expanded={ false }>
|
|
39
39
|
<ColorIndicator
|
|
@@ -42,7 +42,7 @@ function BackgroundColorItem( { name, parentMenu } ) {
|
|
|
42
42
|
</ColorIndicatorWrapper>
|
|
43
43
|
<FlexItem>{ __( 'Background' ) }</FlexItem>
|
|
44
44
|
</HStack>
|
|
45
|
-
</
|
|
45
|
+
</NavigationButtonAsItem>
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -56,14 +56,14 @@ function TextColorItem( { name, parentMenu } ) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
<
|
|
59
|
+
<NavigationButtonAsItem path={ parentMenu + '/colors/text' }>
|
|
60
60
|
<HStack justify="flex-start">
|
|
61
61
|
<ColorIndicatorWrapper expanded={ false }>
|
|
62
62
|
<ColorIndicator colorValue={ color } />
|
|
63
63
|
</ColorIndicatorWrapper>
|
|
64
64
|
<FlexItem>{ __( 'Text' ) }</FlexItem>
|
|
65
65
|
</HStack>
|
|
66
|
-
</
|
|
66
|
+
</NavigationButtonAsItem>
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -77,14 +77,14 @@ function LinkColorItem( { name, parentMenu } ) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
|
-
<
|
|
80
|
+
<NavigationButtonAsItem path={ parentMenu + '/colors/link' }>
|
|
81
81
|
<HStack justify="flex-start">
|
|
82
82
|
<ColorIndicatorWrapper expanded={ false }>
|
|
83
83
|
<ColorIndicator colorValue={ color } />
|
|
84
84
|
</ColorIndicatorWrapper>
|
|
85
85
|
<FlexItem>{ __( 'Links' ) }</FlexItem>
|
|
86
86
|
</HStack>
|
|
87
|
-
</
|
|
87
|
+
</NavigationButtonAsItem>
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
|
-
__experimentalItem as Item,
|
|
7
6
|
__experimentalHStack as HStack,
|
|
7
|
+
__experimentalSpacer as Spacer,
|
|
8
8
|
__experimentalVStack as VStack,
|
|
9
9
|
FlexItem,
|
|
10
10
|
CardBody,
|
|
@@ -21,7 +21,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
23
|
import { IconWithCurrentColor } from './icon-with-current-color';
|
|
24
|
-
import {
|
|
24
|
+
import { NavigationButtonAsItem } from './navigation-button';
|
|
25
25
|
import ContextMenu from './context-menu';
|
|
26
26
|
import StylesPreview from './preview';
|
|
27
27
|
|
|
@@ -37,48 +37,58 @@ function ScreenRoot() {
|
|
|
37
37
|
return (
|
|
38
38
|
<Card size="small">
|
|
39
39
|
<CardBody>
|
|
40
|
-
<VStack spacing={
|
|
40
|
+
<VStack spacing={ 4 }>
|
|
41
41
|
<Card>
|
|
42
42
|
<CardMedia>
|
|
43
43
|
<StylesPreview />
|
|
44
44
|
</CardMedia>
|
|
45
45
|
</Card>
|
|
46
46
|
{ !! variations?.length && (
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
<ItemGroup>
|
|
48
|
+
<NavigationButtonAsItem path="/variations">
|
|
49
|
+
<HStack justify="space-between">
|
|
50
|
+
<FlexItem>
|
|
51
|
+
{ __( 'Browse styles' ) }
|
|
52
|
+
</FlexItem>
|
|
53
|
+
<IconWithCurrentColor
|
|
54
|
+
icon={
|
|
55
|
+
isRTL() ? chevronLeft : chevronRight
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
</HStack>
|
|
59
|
+
</NavigationButtonAsItem>
|
|
60
|
+
</ItemGroup>
|
|
57
61
|
) }
|
|
62
|
+
<ContextMenu />
|
|
58
63
|
</VStack>
|
|
59
64
|
</CardBody>
|
|
60
65
|
|
|
61
|
-
<CardBody>
|
|
62
|
-
<ContextMenu />
|
|
63
|
-
</CardBody>
|
|
64
|
-
|
|
65
66
|
<CardDivider />
|
|
66
67
|
|
|
67
68
|
<CardBody>
|
|
69
|
+
<Spacer
|
|
70
|
+
as="p"
|
|
71
|
+
paddingTop={ 2 }
|
|
72
|
+
/*
|
|
73
|
+
* 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).
|
|
74
|
+
* This is an ad hoc override for this particular instance only and should be reconsidered before making into a pattern.
|
|
75
|
+
*/
|
|
76
|
+
paddingX="13px"
|
|
77
|
+
marginBottom={ 4 }
|
|
78
|
+
>
|
|
79
|
+
{ __(
|
|
80
|
+
'Customize the appearance of specific blocks for the whole site.'
|
|
81
|
+
) }
|
|
82
|
+
</Spacer>
|
|
68
83
|
<ItemGroup>
|
|
69
|
-
<
|
|
70
|
-
{ __(
|
|
71
|
-
'Customize the appearance of specific blocks for the whole site.'
|
|
72
|
-
) }
|
|
73
|
-
</Item>
|
|
74
|
-
<NavigationButton path="/blocks">
|
|
84
|
+
<NavigationButtonAsItem path="/blocks">
|
|
75
85
|
<HStack justify="space-between">
|
|
76
86
|
<FlexItem>{ __( 'Blocks' ) }</FlexItem>
|
|
77
87
|
<IconWithCurrentColor
|
|
78
88
|
icon={ isRTL() ? chevronLeft : chevronRight }
|
|
79
89
|
/>
|
|
80
90
|
</HStack>
|
|
81
|
-
</
|
|
91
|
+
</NavigationButtonAsItem>
|
|
82
92
|
</ItemGroup>
|
|
83
93
|
</CardBody>
|
|
84
94
|
</Card>
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import ScreenHeader from './header';
|
|
16
|
-
import {
|
|
16
|
+
import { NavigationButtonAsItem } from './navigation-button';
|
|
17
17
|
import { useStyle } from './hooks';
|
|
18
18
|
import Subtitle from './subtitle';
|
|
19
19
|
import TypographyPanel from './typography-panel';
|
|
@@ -44,7 +44,7 @@ function Item( { name, parentMenu, element, label } ) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<
|
|
47
|
+
<NavigationButtonAsItem path={ parentMenu + '/typography/' + element }>
|
|
48
48
|
<HStack justify="flex-start">
|
|
49
49
|
<FlexItem
|
|
50
50
|
className="edit-site-global-styles-screen-typography__indicator"
|
|
@@ -62,7 +62,7 @@ function Item( { name, parentMenu, element, label } ) {
|
|
|
62
62
|
</FlexItem>
|
|
63
63
|
<FlexItem>{ label }</FlexItem>
|
|
64
64
|
</HStack>
|
|
65
|
-
</
|
|
65
|
+
</NavigationButtonAsItem>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -104,8 +104,9 @@ body.is-navigation-sidebar-open {
|
|
|
104
104
|
margin: 0 -6px 0;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
|
|
107
108
|
/**
|
|
108
|
-
* Buttons
|
|
109
|
+
* Buttons on the right side
|
|
109
110
|
*/
|
|
110
111
|
|
|
111
112
|
.edit-site-header__actions {
|
|
@@ -113,36 +114,23 @@ body.is-navigation-sidebar-open {
|
|
|
113
114
|
align-items: center;
|
|
114
115
|
padding-right: $grid-unit-05;
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
@include break-medium() {
|
|
120
|
-
display: inline-flex;
|
|
121
|
-
}
|
|
117
|
+
@include break-small () {
|
|
118
|
+
padding-right: $grid-unit-20 - ($grid-unit-15 * 0.5);
|
|
122
119
|
}
|
|
123
120
|
|
|
124
|
-
|
|
125
|
-
.editor-post-saved-state,
|
|
126
|
-
.components-button.components-button {
|
|
127
|
-
margin-right: $grid-unit-05;
|
|
128
|
-
|
|
129
|
-
@include break-small() {
|
|
130
|
-
margin-right: $grid-unit-15;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
121
|
+
gap: $grid-unit-05;
|
|
133
122
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
padding: 0 #{$grid-unit-15 * 0.5};
|
|
123
|
+
@include break-small() {
|
|
124
|
+
gap: $grid-unit-10;
|
|
137
125
|
}
|
|
138
126
|
|
|
139
|
-
|
|
140
|
-
.interface-pinned-items
|
|
141
|
-
|
|
142
|
-
}
|
|
127
|
+
// Pinned items.
|
|
128
|
+
.interface-pinned-items {
|
|
129
|
+
display: none;
|
|
143
130
|
|
|
144
|
-
|
|
145
|
-
|
|
131
|
+
@include break-medium() {
|
|
132
|
+
display: inline-flex;
|
|
133
|
+
}
|
|
146
134
|
}
|
|
147
135
|
}
|
|
148
136
|
|
|
@@ -192,11 +180,8 @@ body.is-navigation-sidebar-open {
|
|
|
192
180
|
.edit-site-save-button__button {
|
|
193
181
|
padding-left: 6px;
|
|
194
182
|
padding-right: 6px;
|
|
195
|
-
margin-right: $grid-unit-05;
|
|
196
|
-
}
|
|
197
|
-
.block-editor-post-preview__button-toggle {
|
|
198
|
-
margin-right: $grid-unit-05;
|
|
199
183
|
}
|
|
184
|
+
|
|
200
185
|
// The inserter and the template details toggle have custom labels, different from their aria-label, so we don't want to display both.
|
|
201
186
|
.edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle,
|
|
202
187
|
.edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { createSlotFill, PanelBody } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { cog } from '@wordpress/icons';
|
|
7
|
-
import { useEffect } from '@wordpress/element';
|
|
7
|
+
import { useEffect, Fragment } from '@wordpress/element';
|
|
8
8
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
9
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
10
10
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -62,7 +62,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
62
62
|
// Conditionally include NavMenu sidebar in Plugin only.
|
|
63
63
|
// Optimise for dead code elimination.
|
|
64
64
|
// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
|
|
65
|
-
let MaybeNavigationMenuSidebar =
|
|
65
|
+
let MaybeNavigationMenuSidebar = Fragment;
|
|
66
66
|
|
|
67
67
|
if ( process.env.IS_GUTENBERG_PLUGIN ) {
|
|
68
68
|
MaybeNavigationMenuSidebar = NavigationMenuSidebar;
|
|
@@ -50,13 +50,7 @@ export default function NavigationMenu( { innerBlocks, id } ) {
|
|
|
50
50
|
}, [ updateBlockListSettings, innerBlocks ] );
|
|
51
51
|
return (
|
|
52
52
|
<>
|
|
53
|
-
<ListView
|
|
54
|
-
id={ id }
|
|
55
|
-
showNestedBlocks
|
|
56
|
-
expandNested={ false }
|
|
57
|
-
__experimentalFeatures
|
|
58
|
-
__experimentalPersistentListViewFeatures
|
|
59
|
-
/>
|
|
53
|
+
<ListView id={ id } />
|
|
60
54
|
</>
|
|
61
55
|
);
|
|
62
56
|
}
|
package/src/index.js
CHANGED
|
@@ -103,7 +103,6 @@ export function initializeEditor( id, settings ) {
|
|
|
103
103
|
settings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>
|
|
104
104
|
fetchLinkSuggestions( search, searchOptions, settings );
|
|
105
105
|
settings.__experimentalFetchRichUrlData = fetchUrlData;
|
|
106
|
-
settings.__experimentalSpotlightEntityBlocks = [ 'core/template-part' ];
|
|
107
106
|
|
|
108
107
|
const target = document.getElementById( id );
|
|
109
108
|
|