@wordpress/edit-site 6.0.0 → 6.0.1
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/inserter-media-categories.js +1 -1
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/editor/index.js +52 -59
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +39 -0
- package/build/components/editor/use-editor-title.js.map +1 -0
- package/build/components/global-styles/screen-css.js +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +1 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +2 -0
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +16 -59
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/index.js +5 -5
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/pagination/index.js +17 -8
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +6 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +1 -1
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/site-hub/index.js +38 -128
- package/build/components/site-hub/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/store/private-actions.js +33 -18
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/editor/index.js +52 -59
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +31 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -0
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +2 -2
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -0
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +18 -61
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/index.js +5 -5
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/pagination/index.js +17 -8
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +6 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +40 -130
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/store/private-actions.js +33 -18
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +43 -85
- package/build-style/style.css +43 -85
- package/package.json +41 -41
- package/src/components/block-editor/inserter-media-categories.js +1 -3
- package/src/components/block-editor/style.scss +11 -0
- package/src/components/editor/index.js +67 -95
- package/src/components/editor/style.scss +1 -5
- package/src/components/editor/use-editor-title.js +35 -0
- package/src/components/global-styles/screen-css.js +1 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/src/components/global-styles/screen-revisions/style.scss +4 -8
- package/src/components/global-styles/variations/variations-color.js +6 -3
- package/src/components/global-styles-sidebar/index.js +2 -0
- package/src/components/layout/index.js +17 -67
- package/src/components/layout/style.scss +18 -58
- package/src/components/page-patterns/index.js +15 -12
- package/src/components/pagination/index.js +21 -16
- package/src/components/sidebar-dataviews/dataview-item.js +6 -2
- package/src/components/sidebar-navigation-screen/index.js +1 -1
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +11 -2
- package/src/components/sidebar-navigation-screen-patterns/index.js +5 -1
- package/src/components/site-hub/index.js +55 -146
- package/src/components/site-hub/style.scss +1 -4
- package/src/components/site-icon/style.scss +0 -4
- package/src/hooks/push-changes-to-global-styles/index.js +1 -0
- package/src/store/private-actions.js +58 -30
|
@@ -34,7 +34,7 @@ function ScreenCSS() {
|
|
|
34
34
|
<>
|
|
35
35
|
{ description }
|
|
36
36
|
<ExternalLink
|
|
37
|
-
href="https://wordpress.org/
|
|
37
|
+
href="https://developer.wordpress.org/advanced-administration/wordpress/css/"
|
|
38
38
|
className="edit-site-global-styles-screen-css-help-link"
|
|
39
39
|
>
|
|
40
40
|
{ __( 'Learn more about CSS' ) }
|
|
@@ -163,6 +163,7 @@ function RevisionsButtons( {
|
|
|
163
163
|
>
|
|
164
164
|
<Button
|
|
165
165
|
className="edit-site-global-styles-screen-revisions__revision-button"
|
|
166
|
+
__experimentalIsFocusable
|
|
166
167
|
disabled={ isSelected }
|
|
167
168
|
onClick={ () => {
|
|
168
169
|
onChange( revision );
|
|
@@ -219,7 +220,6 @@ function RevisionsButtons( {
|
|
|
219
220
|
</p>
|
|
220
221
|
) : (
|
|
221
222
|
<Button
|
|
222
|
-
disabled={ areStylesEqual }
|
|
223
223
|
size="compact"
|
|
224
224
|
variant="primary"
|
|
225
225
|
className="edit-site-global-styles-screen-revisions__apply-button"
|
|
@@ -173,19 +173,15 @@
|
|
|
173
173
|
// Safari from rendering the page / total text.
|
|
174
174
|
will-change: opacity;
|
|
175
175
|
}
|
|
176
|
+
|
|
176
177
|
.components-button.is-tertiary {
|
|
177
|
-
font-size: 28px;
|
|
178
|
-
font-weight: 200;
|
|
179
178
|
color: $gray-900;
|
|
180
|
-
margin-bottom: $grid-unit-05;
|
|
181
|
-
line-height: 1.2;
|
|
182
179
|
}
|
|
183
|
-
|
|
180
|
+
|
|
181
|
+
.components-button.is-tertiary:disabled,
|
|
182
|
+
.components-button.is-tertiary[aria-disabled="true"] {
|
|
184
183
|
color: $gray-600;
|
|
185
184
|
}
|
|
186
|
-
.components-button.is-tertiary:hover {
|
|
187
|
-
background: transparent;
|
|
188
|
-
}
|
|
189
185
|
}
|
|
190
186
|
|
|
191
187
|
.edit-site-global-styles-screen-revisions__footer {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
__experimentalVStack as VStack,
|
|
6
|
+
__experimentalGrid as Grid,
|
|
7
|
+
} from '@wordpress/components';
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Internal dependencies
|
|
@@ -22,13 +25,13 @@ export default function ColorVariations( { title, gap = 2 } ) {
|
|
|
22
25
|
return (
|
|
23
26
|
<VStack spacing={ 3 }>
|
|
24
27
|
{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }
|
|
25
|
-
<
|
|
28
|
+
<Grid spacing={ gap }>
|
|
26
29
|
{ colorVariations.map( ( variation, index ) => (
|
|
27
30
|
<Variation key={ index } variation={ variation } isPill>
|
|
28
31
|
{ () => <StylesPreviewColors /> }
|
|
29
32
|
</Variation>
|
|
30
33
|
) ) }
|
|
31
|
-
</
|
|
34
|
+
</Grid>
|
|
32
35
|
</VStack>
|
|
33
36
|
);
|
|
34
37
|
}
|
|
@@ -152,6 +152,7 @@ export default function GlobalStylesSidebar() {
|
|
|
152
152
|
isPressed={
|
|
153
153
|
isStyleBookOpened || isRevisionsStyleBookOpened
|
|
154
154
|
}
|
|
155
|
+
__experimentalIsFocusable
|
|
155
156
|
disabled={ shouldClearCanvasContainerView }
|
|
156
157
|
onClick={ toggleStyleBook }
|
|
157
158
|
size="compact"
|
|
@@ -162,6 +163,7 @@ export default function GlobalStylesSidebar() {
|
|
|
162
163
|
label={ __( 'Revisions' ) }
|
|
163
164
|
icon={ backup }
|
|
164
165
|
onClick={ toggleRevisions }
|
|
166
|
+
__experimentalIsFocusable
|
|
165
167
|
disabled={ ! hasRevisions }
|
|
166
168
|
isPressed={
|
|
167
169
|
isRevisionsOpened || isRevisionsStyleBookOpened
|
|
@@ -16,9 +16,10 @@ import {
|
|
|
16
16
|
useReducedMotion,
|
|
17
17
|
useViewportMatch,
|
|
18
18
|
useResizeObserver,
|
|
19
|
+
usePrevious,
|
|
19
20
|
} from '@wordpress/compose';
|
|
20
21
|
import { __ } from '@wordpress/i18n';
|
|
21
|
-
import { useState } from '@wordpress/element';
|
|
22
|
+
import { useState, useRef, useEffect } from '@wordpress/element';
|
|
22
23
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
23
24
|
import {
|
|
24
25
|
CommandMenu,
|
|
@@ -72,7 +73,7 @@ export default function Layout() {
|
|
|
72
73
|
useCommonCommands();
|
|
73
74
|
|
|
74
75
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
75
|
-
|
|
76
|
+
const toggleRef = useRef();
|
|
76
77
|
const {
|
|
77
78
|
isDistractionFree,
|
|
78
79
|
hasFixedToolbar,
|
|
@@ -80,7 +81,6 @@ export default function Layout() {
|
|
|
80
81
|
canvasMode,
|
|
81
82
|
previousShortcut,
|
|
82
83
|
nextShortcut,
|
|
83
|
-
hasBlockBreadcrumbs,
|
|
84
84
|
} = useSelect( ( select ) => {
|
|
85
85
|
const { getAllShortcutKeyCombinations } = select(
|
|
86
86
|
keyboardShortcutsStore
|
|
@@ -102,10 +102,6 @@ export default function Layout() {
|
|
|
102
102
|
'core',
|
|
103
103
|
'distractionFree'
|
|
104
104
|
),
|
|
105
|
-
hasBlockBreadcrumbs: select( preferencesStore ).get(
|
|
106
|
-
'core',
|
|
107
|
-
'showBlockBreadcrumbs'
|
|
108
|
-
),
|
|
109
105
|
hasBlockSelected:
|
|
110
106
|
select( blockEditorStore ).getBlockSelectionStart(),
|
|
111
107
|
};
|
|
@@ -125,27 +121,6 @@ export default function Layout() {
|
|
|
125
121
|
triggerAnimationOnChange: canvasMode + '__' + routeKey,
|
|
126
122
|
} );
|
|
127
123
|
|
|
128
|
-
// This determines which animation variant should apply to the header.
|
|
129
|
-
// There is also a `isDistractionFreeHovering` state that gets priority
|
|
130
|
-
// when hovering the `edit-site-layout__header-container` in distraction
|
|
131
|
-
// free mode. It's set via framer and trickles down to all the children
|
|
132
|
-
// so they can use this variant state too.
|
|
133
|
-
//
|
|
134
|
-
// TODO: The issue with this is we want to have the hover state stick when hovering
|
|
135
|
-
// a popover opened via the header. We'll probably need to lift this state to
|
|
136
|
-
// handle it ourselves. Also, focusWithin the header needs to be handled.
|
|
137
|
-
let headerAnimationState;
|
|
138
|
-
|
|
139
|
-
if ( canvasMode === 'view' ) {
|
|
140
|
-
// We need 'view' to always take priority so 'isDistractionFree'
|
|
141
|
-
// doesn't bleed over into the view (sidebar) state
|
|
142
|
-
headerAnimationState = 'view';
|
|
143
|
-
} else if ( isDistractionFree ) {
|
|
144
|
-
headerAnimationState = 'isDistractionFree';
|
|
145
|
-
} else {
|
|
146
|
-
headerAnimationState = canvasMode; // edit, view, init
|
|
147
|
-
}
|
|
148
|
-
|
|
149
124
|
// Sets the right context for the command palette
|
|
150
125
|
let commandContext = 'site-editor';
|
|
151
126
|
|
|
@@ -159,6 +134,14 @@ export default function Layout() {
|
|
|
159
134
|
|
|
160
135
|
const [ backgroundColor ] = useGlobalStyle( 'color.background' );
|
|
161
136
|
const [ gradientValue ] = useGlobalStyle( 'color.gradient' );
|
|
137
|
+
const previousCanvaMode = usePrevious( canvasMode );
|
|
138
|
+
useEffect( () => {
|
|
139
|
+
if ( previousCanvaMode === 'edit' ) {
|
|
140
|
+
toggleRef.current?.focus();
|
|
141
|
+
}
|
|
142
|
+
// Should not depend on the previous canvas mode value but the next.
|
|
143
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
144
|
+
}, [ canvasMode ] );
|
|
162
145
|
|
|
163
146
|
// Synchronizing the URL with the store value of canvasMode happens in an effect
|
|
164
147
|
// This condition ensures the component is only rendered after the synchronization happens
|
|
@@ -185,48 +168,9 @@ export default function Layout() {
|
|
|
185
168
|
'is-full-canvas': canvasMode === 'edit',
|
|
186
169
|
'has-fixed-toolbar': hasFixedToolbar,
|
|
187
170
|
'is-block-toolbar-visible': hasBlockSelected,
|
|
188
|
-
'has-block-breadcrumbs':
|
|
189
|
-
hasBlockBreadcrumbs &&
|
|
190
|
-
! isDistractionFree &&
|
|
191
|
-
canvasMode === 'edit',
|
|
192
171
|
}
|
|
193
172
|
) }
|
|
194
173
|
>
|
|
195
|
-
<motion.div
|
|
196
|
-
className="edit-site-layout__header-container"
|
|
197
|
-
variants={ {
|
|
198
|
-
isDistractionFree: {
|
|
199
|
-
opacity: 0,
|
|
200
|
-
transition: {
|
|
201
|
-
type: 'tween',
|
|
202
|
-
delay: 0.8,
|
|
203
|
-
delayChildren: 0.8,
|
|
204
|
-
}, // How long to wait before the header exits
|
|
205
|
-
},
|
|
206
|
-
isDistractionFreeHovering: {
|
|
207
|
-
opacity: 1,
|
|
208
|
-
transition: {
|
|
209
|
-
type: 'tween',
|
|
210
|
-
delay: 0.2,
|
|
211
|
-
delayChildren: 0.2,
|
|
212
|
-
}, // How long to wait before the header shows
|
|
213
|
-
},
|
|
214
|
-
view: { opacity: 1 },
|
|
215
|
-
edit: { opacity: 1 },
|
|
216
|
-
} }
|
|
217
|
-
whileHover={
|
|
218
|
-
isDistractionFree
|
|
219
|
-
? 'isDistractionFreeHovering'
|
|
220
|
-
: undefined
|
|
221
|
-
}
|
|
222
|
-
animate={ headerAnimationState }
|
|
223
|
-
>
|
|
224
|
-
<SiteHub
|
|
225
|
-
isTransparent={ isResizableFrameOversized }
|
|
226
|
-
className="edit-site-layout__hub"
|
|
227
|
-
/>
|
|
228
|
-
</motion.div>
|
|
229
|
-
|
|
230
174
|
<div className="edit-site-layout__content">
|
|
231
175
|
{ /*
|
|
232
176
|
The NavigableRegion must always be rendered and not use
|
|
@@ -255,6 +199,12 @@ export default function Layout() {
|
|
|
255
199
|
} }
|
|
256
200
|
className="edit-site-layout__sidebar"
|
|
257
201
|
>
|
|
202
|
+
<SiteHub
|
|
203
|
+
ref={ toggleRef }
|
|
204
|
+
isTransparent={
|
|
205
|
+
isResizableFrameOversized
|
|
206
|
+
}
|
|
207
|
+
/>
|
|
258
208
|
<SidebarContent routeKey={ routeKey }>
|
|
259
209
|
{ areas.sidebar }
|
|
260
210
|
</SidebarContent>
|
|
@@ -4,39 +4,13 @@
|
|
|
4
4
|
color: $gray-400;
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.edit-site-layout__hub {
|
|
10
|
-
position: fixed;
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
width: calc(100vw - #{$canvas-padding * 2});
|
|
14
|
-
height: $header-height;
|
|
15
|
-
z-index: z-index(".edit-site-layout__hub");
|
|
16
|
-
|
|
17
|
-
@include break-medium {
|
|
18
|
-
width: calc(#{$nav-sidebar-width} - #{$grid-unit-15});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.edit-site-layout.is-full-canvas & {
|
|
22
|
-
padding-right: 0;
|
|
23
|
-
border-radius: 0;
|
|
24
|
-
width: $header-height;
|
|
25
|
-
box-shadow: none;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
7
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
margin-bottom: 0;
|
|
8
|
+
// Show a dark background in "frame" mode to avoid edge artifacts.
|
|
9
|
+
&:not(.is-full-canvas) .editor-visual-editor {
|
|
10
|
+
background: $gray-900;
|
|
33
11
|
}
|
|
34
12
|
}
|
|
35
13
|
|
|
36
|
-
.edit-site-layout__header-container {
|
|
37
|
-
z-index: z-index(".edit-site-layout__header-container");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
14
|
.edit-site-layout__content {
|
|
41
15
|
height: 100%;
|
|
42
16
|
flex-grow: 1;
|
|
@@ -158,10 +132,22 @@
|
|
|
158
132
|
height: 100%;
|
|
159
133
|
}
|
|
160
134
|
|
|
135
|
+
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
136
|
+
html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
137
|
+
animation-delay: 255ms;
|
|
138
|
+
}
|
|
139
|
+
/* stylelint-enable */
|
|
140
|
+
|
|
141
|
+
.edit-site-layout.is-full-canvas .edit-site-layout__sidebar-region .edit-site-layout__view-mode-toggle {
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
161
145
|
.edit-site-layout__view-mode-toggle.components-button {
|
|
146
|
+
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
147
|
+
view-transition-name: toggle;
|
|
148
|
+
/* stylelint-enable */
|
|
162
149
|
position: relative;
|
|
163
150
|
color: $white;
|
|
164
|
-
border-radius: 0;
|
|
165
151
|
height: $header-height;
|
|
166
152
|
width: $header-height;
|
|
167
153
|
overflow: hidden;
|
|
@@ -169,6 +155,8 @@
|
|
|
169
155
|
display: flex;
|
|
170
156
|
align-items: center;
|
|
171
157
|
justify-content: center;
|
|
158
|
+
background: $gray-900;
|
|
159
|
+
border-radius: 0;
|
|
172
160
|
|
|
173
161
|
&:hover,
|
|
174
162
|
&:active {
|
|
@@ -202,7 +190,6 @@
|
|
|
202
190
|
|
|
203
191
|
.edit-site-layout__view-mode-toggle-icon {
|
|
204
192
|
display: flex;
|
|
205
|
-
border-radius: $radius-block-ui;
|
|
206
193
|
height: $grid-unit-80;
|
|
207
194
|
width: $grid-unit-80;
|
|
208
195
|
justify-content: center;
|
|
@@ -239,33 +226,6 @@
|
|
|
239
226
|
}
|
|
240
227
|
}
|
|
241
228
|
|
|
242
|
-
.edit-site-layout.is-distraction-free {
|
|
243
|
-
.edit-site-layout__header-container {
|
|
244
|
-
height: $header-height;
|
|
245
|
-
position: absolute;
|
|
246
|
-
top: 0;
|
|
247
|
-
left: 0;
|
|
248
|
-
right: 0;
|
|
249
|
-
z-index: z-index(".edit-site-layout__header-container");
|
|
250
|
-
width: 100%;
|
|
251
|
-
|
|
252
|
-
// We need ! important because we override inline styles
|
|
253
|
-
// set by the motion component.
|
|
254
|
-
&:focus-within {
|
|
255
|
-
opacity: 1 !important;
|
|
256
|
-
div {
|
|
257
|
-
transform: translateX(0) translateY(0) translateZ(0) !important;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.edit-site-site-hub {
|
|
263
|
-
position: absolute;
|
|
264
|
-
top: 0;
|
|
265
|
-
z-index: z-index(".edit-site-layout__hub");
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
229
|
.edit-site-layout__area {
|
|
270
230
|
flex-grow: 1;
|
|
271
231
|
margin: 0;
|
|
@@ -86,15 +86,12 @@ const DEFAULT_VIEW = {
|
|
|
86
86
|
const SYNC_FILTERS = [
|
|
87
87
|
{
|
|
88
88
|
value: PATTERN_SYNC_TYPES.full,
|
|
89
|
-
label: _x( 'Synced', '
|
|
89
|
+
label: _x( 'Synced', 'pattern (singular)' ),
|
|
90
90
|
description: __( 'Patterns that are kept in sync across the site.' ),
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
value: PATTERN_SYNC_TYPES.unsynced,
|
|
94
|
-
label: _x(
|
|
95
|
-
'Not synced',
|
|
96
|
-
'Option that shows all patterns that are not synchronized'
|
|
97
|
-
),
|
|
94
|
+
label: _x( 'Not synced', 'pattern (singular)' ),
|
|
98
95
|
description: __(
|
|
99
96
|
'Patterns that can be changed freely without affecting the site.'
|
|
100
97
|
),
|
|
@@ -298,13 +295,19 @@ export default function DataviewsPatterns() {
|
|
|
298
295
|
<span
|
|
299
296
|
className={ `edit-site-patterns__field-sync-status-${ item.syncStatus }` }
|
|
300
297
|
>
|
|
301
|
-
{
|
|
302
|
-
(
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
298
|
+
{
|
|
299
|
+
(
|
|
300
|
+
SYNC_FILTERS.find(
|
|
301
|
+
( { value } ) =>
|
|
302
|
+
value === item.syncStatus
|
|
303
|
+
) ||
|
|
304
|
+
SYNC_FILTERS.find(
|
|
305
|
+
( { value } ) =>
|
|
306
|
+
value ===
|
|
307
|
+
PATTERN_SYNC_TYPES.unsynced
|
|
308
|
+
)
|
|
309
|
+
).label
|
|
310
|
+
}
|
|
308
311
|
</span>
|
|
309
312
|
);
|
|
310
313
|
},
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Button,
|
|
13
13
|
} from '@wordpress/components';
|
|
14
14
|
import { __, _x, _n, sprintf } from '@wordpress/i18n';
|
|
15
|
+
import { previous, chevronLeft, chevronRight, next } from '@wordpress/icons';
|
|
15
16
|
|
|
16
17
|
export default function Pagination( {
|
|
17
18
|
currentPage,
|
|
@@ -46,19 +47,21 @@ export default function Pagination( {
|
|
|
46
47
|
<Button
|
|
47
48
|
variant={ buttonVariant }
|
|
48
49
|
onClick={ () => changePage( 1 ) }
|
|
50
|
+
__experimentalIsFocusable
|
|
49
51
|
disabled={ disabled || currentPage === 1 }
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
label={ __( 'First page' ) }
|
|
53
|
+
icon={ previous }
|
|
54
|
+
size="compact"
|
|
55
|
+
/>
|
|
54
56
|
<Button
|
|
55
57
|
variant={ buttonVariant }
|
|
56
58
|
onClick={ () => changePage( currentPage - 1 ) }
|
|
59
|
+
__experimentalIsFocusable
|
|
57
60
|
disabled={ disabled || currentPage === 1 }
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
label={ __( 'Previous page' ) }
|
|
62
|
+
icon={ chevronLeft }
|
|
63
|
+
size="compact"
|
|
64
|
+
/>
|
|
62
65
|
</HStack>
|
|
63
66
|
<Text variant="muted">
|
|
64
67
|
{ sprintf(
|
|
@@ -72,19 +75,21 @@ export default function Pagination( {
|
|
|
72
75
|
<Button
|
|
73
76
|
variant={ buttonVariant }
|
|
74
77
|
onClick={ () => changePage( currentPage + 1 ) }
|
|
78
|
+
__experimentalIsFocusable
|
|
75
79
|
disabled={ disabled || currentPage === numPages }
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
label={ __( 'Next page' ) }
|
|
81
|
+
icon={ chevronRight }
|
|
82
|
+
size="compact"
|
|
83
|
+
/>
|
|
80
84
|
<Button
|
|
81
85
|
variant={ buttonVariant }
|
|
82
86
|
onClick={ () => changePage( numPages ) }
|
|
87
|
+
__experimentalIsFocusable
|
|
83
88
|
disabled={ disabled || currentPage === numPages }
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
label={ __( 'Last page' ) }
|
|
90
|
+
icon={ next }
|
|
91
|
+
size="compact"
|
|
92
|
+
/>
|
|
88
93
|
</HStack>
|
|
89
94
|
</HStack>
|
|
90
95
|
);
|
|
@@ -35,11 +35,15 @@ export default function DataViewItem( {
|
|
|
35
35
|
const iconToUse =
|
|
36
36
|
icon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;
|
|
37
37
|
|
|
38
|
+
let activeView = isCustom ? customViewId : slug;
|
|
39
|
+
if ( activeView === 'all' ) {
|
|
40
|
+
activeView = undefined;
|
|
41
|
+
}
|
|
38
42
|
const linkInfo = useLink( {
|
|
39
43
|
postType,
|
|
40
44
|
layout,
|
|
41
|
-
activeView
|
|
42
|
-
isCustom: isCustom ? 'true' :
|
|
45
|
+
activeView,
|
|
46
|
+
isCustom: isCustom ? 'true' : undefined,
|
|
43
47
|
} );
|
|
44
48
|
return (
|
|
45
49
|
<HStack
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
position: sticky;
|
|
60
60
|
top: 0;
|
|
61
61
|
background: $gray-900;
|
|
62
|
-
padding-top: $grid-unit-60
|
|
62
|
+
padding-top: $grid-unit-60;
|
|
63
63
|
margin-bottom: $grid-unit-10;
|
|
64
64
|
padding-bottom: $grid-unit-10;
|
|
65
65
|
z-index: z-index(".edit-site-sidebar-navigation-screen__title-icon");
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
|
|
68
68
|
.edit-site-sidebar-navigation-screen__title {
|
|
69
69
|
flex-grow: 1;
|
|
70
|
-
padding: $grid-unit-15 * 0.5 0 0 0;
|
|
71
70
|
overflow-wrap: break-word;
|
|
71
|
+
padding: $grid-unit-05 * 0.5 0 0 0;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.edit-site-sidebar-navigation-screen__actions {
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
5
5
|
import { useLink } from '../routes/link';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
TEMPLATE_PART_POST_TYPE,
|
|
8
|
+
TEMPLATE_PART_ALL_AREAS_CATEGORY,
|
|
9
|
+
PATTERN_DEFAULT_CATEGORY,
|
|
10
|
+
PATTERN_TYPES,
|
|
11
|
+
} from '../../utils/constants';
|
|
7
12
|
|
|
8
13
|
export default function CategoryItem( {
|
|
9
14
|
count,
|
|
@@ -14,7 +19,11 @@ export default function CategoryItem( {
|
|
|
14
19
|
type,
|
|
15
20
|
} ) {
|
|
16
21
|
const linkInfo = useLink( {
|
|
17
|
-
categoryId:
|
|
22
|
+
categoryId:
|
|
23
|
+
id !== TEMPLATE_PART_ALL_AREAS_CATEGORY &&
|
|
24
|
+
id !== PATTERN_DEFAULT_CATEGORY
|
|
25
|
+
? id
|
|
26
|
+
: undefined,
|
|
18
27
|
postType:
|
|
19
28
|
type === TEMPLATE_PART_POST_TYPE
|
|
20
29
|
? TEMPLATE_PART_POST_TYPE
|
|
@@ -106,8 +106,12 @@ export default function SidebarNavigationScreenPatterns( { backPath } ) {
|
|
|
106
106
|
const {
|
|
107
107
|
params: { postType, categoryId },
|
|
108
108
|
} = useLocation();
|
|
109
|
-
const currentCategory = categoryId || PATTERN_DEFAULT_CATEGORY;
|
|
110
109
|
const currentType = postType || PATTERN_TYPES.user;
|
|
110
|
+
const currentCategory =
|
|
111
|
+
categoryId ||
|
|
112
|
+
( currentType === PATTERN_TYPES.user
|
|
113
|
+
? PATTERN_DEFAULT_CATEGORY
|
|
114
|
+
: TEMPLATE_PART_ALL_AREAS_CATEGORY );
|
|
111
115
|
|
|
112
116
|
const { templatePartAreas, hasTemplateParts, isLoading } =
|
|
113
117
|
useTemplatePartAreas();
|