@wordpress/edit-site 6.0.0 → 6.0.2

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.
Files changed (145) hide show
  1. package/build/components/add-new-page/index.js +2 -1
  2. package/build/components/add-new-page/index.js.map +1 -1
  3. package/build/components/block-editor/inserter-media-categories.js +1 -1
  4. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  5. package/build/components/editor/index.js +54 -60
  6. package/build/components/editor/index.js.map +1 -1
  7. package/build/components/editor/use-editor-title.js +39 -0
  8. package/build/components/editor/use-editor-title.js.map +1 -0
  9. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  10. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  11. package/build/components/global-styles/screen-css.js +1 -1
  12. package/build/components/global-styles/screen-css.js.map +1 -1
  13. package/build/components/global-styles/screen-revisions/index.js +4 -23
  14. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  15. package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  16. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  17. package/build/components/global-styles/shadows-edit-panel.js +1 -0
  18. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  19. package/build/components/global-styles/variations/variation.js +11 -16
  20. package/build/components/global-styles/variations/variation.js.map +1 -1
  21. package/build/components/global-styles/variations/variations-color.js +2 -1
  22. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  23. package/build/components/global-styles/variations/variations-typography.js +1 -0
  24. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  25. package/build/components/global-styles-sidebar/index.js +2 -0
  26. package/build/components/global-styles-sidebar/index.js.map +1 -1
  27. package/build/components/layout/index.js +16 -59
  28. package/build/components/layout/index.js.map +1 -1
  29. package/build/components/page-patterns/index.js +5 -5
  30. package/build/components/page-patterns/index.js.map +1 -1
  31. package/build/components/pagination/index.js +17 -8
  32. package/build/components/pagination/index.js.map +1 -1
  33. package/build/components/sidebar-dataviews/dataview-item.js +6 -2
  34. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  35. package/build/components/sidebar-navigation-screen/index.js +1 -1
  36. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  37. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  38. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  39. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
  40. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  41. package/build/components/sidebar-navigation-screen-patterns/category-item.js +1 -1
  42. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  43. package/build/components/sidebar-navigation-screen-patterns/index.js +1 -1
  44. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  45. package/build/components/site-hub/index.js +38 -128
  46. package/build/components/site-hub/index.js.map +1 -1
  47. package/build/deprecated.js +11 -0
  48. package/build/deprecated.js.map +1 -1
  49. package/build/hooks/push-changes-to-global-styles/index.js +3 -2
  50. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  51. package/build/lock-unlock.js +1 -1
  52. package/build/lock-unlock.js.map +1 -1
  53. package/build/store/private-actions.js +33 -18
  54. package/build/store/private-actions.js.map +1 -1
  55. package/build-module/components/add-new-page/index.js +2 -1
  56. package/build-module/components/add-new-page/index.js.map +1 -1
  57. package/build-module/components/block-editor/inserter-media-categories.js +1 -1
  58. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  59. package/build-module/components/editor/index.js +54 -60
  60. package/build-module/components/editor/index.js.map +1 -1
  61. package/build-module/components/editor/use-editor-title.js +31 -0
  62. package/build-module/components/editor/use-editor-title.js.map +1 -0
  63. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  64. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  65. package/build-module/components/global-styles/screen-css.js +1 -1
  66. package/build-module/components/global-styles/screen-css.js.map +1 -1
  67. package/build-module/components/global-styles/screen-revisions/index.js +4 -23
  68. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  69. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  70. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  71. package/build-module/components/global-styles/shadows-edit-panel.js +1 -0
  72. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  73. package/build-module/components/global-styles/variations/variation.js +11 -16
  74. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  75. package/build-module/components/global-styles/variations/variations-color.js +3 -2
  76. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  77. package/build-module/components/global-styles/variations/variations-typography.js +1 -0
  78. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  79. package/build-module/components/global-styles-sidebar/index.js +2 -0
  80. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  81. package/build-module/components/layout/index.js +18 -61
  82. package/build-module/components/layout/index.js.map +1 -1
  83. package/build-module/components/page-patterns/index.js +5 -5
  84. package/build-module/components/page-patterns/index.js.map +1 -1
  85. package/build-module/components/pagination/index.js +17 -8
  86. package/build-module/components/pagination/index.js.map +1 -1
  87. package/build-module/components/sidebar-dataviews/dataview-item.js +6 -2
  88. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  89. package/build-module/components/sidebar-navigation-screen/index.js +1 -1
  90. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  91. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  92. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  93. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
  94. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  95. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +2 -2
  96. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  97. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -1
  98. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  99. package/build-module/components/site-hub/index.js +40 -130
  100. package/build-module/components/site-hub/index.js.map +1 -1
  101. package/build-module/deprecated.js +11 -0
  102. package/build-module/deprecated.js.map +1 -1
  103. package/build-module/hooks/push-changes-to-global-styles/index.js +3 -2
  104. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  105. package/build-module/lock-unlock.js +1 -1
  106. package/build-module/lock-unlock.js.map +1 -1
  107. package/build-module/store/private-actions.js +33 -18
  108. package/build-module/store/private-actions.js.map +1 -1
  109. package/build-style/style-rtl.css +43 -85
  110. package/build-style/style.css +43 -85
  111. package/package.json +41 -41
  112. package/src/components/add-new-page/index.js +2 -1
  113. package/src/components/block-editor/inserter-media-categories.js +1 -3
  114. package/src/components/block-editor/style.scss +11 -0
  115. package/src/components/editor/index.js +69 -96
  116. package/src/components/editor/style.scss +1 -5
  117. package/src/components/editor/use-editor-title.js +35 -0
  118. package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  119. package/src/components/global-styles/screen-css.js +1 -1
  120. package/src/components/global-styles/screen-revisions/index.js +4 -24
  121. package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  122. package/src/components/global-styles/screen-revisions/style.scss +4 -8
  123. package/src/components/global-styles/shadows-edit-panel.js +1 -0
  124. package/src/components/global-styles/variations/variation.js +14 -19
  125. package/src/components/global-styles/variations/variations-color.js +12 -4
  126. package/src/components/global-styles/variations/variations-typography.js +5 -1
  127. package/src/components/global-styles-sidebar/index.js +2 -0
  128. package/src/components/layout/index.js +17 -67
  129. package/src/components/layout/style.scss +18 -58
  130. package/src/components/page-patterns/index.js +15 -12
  131. package/src/components/pagination/index.js +21 -16
  132. package/src/components/sidebar-dataviews/dataview-item.js +6 -2
  133. package/src/components/sidebar-navigation-screen/index.js +1 -1
  134. package/src/components/sidebar-navigation-screen/style.scss +2 -2
  135. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  136. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
  137. package/src/components/sidebar-navigation-screen-patterns/category-item.js +11 -2
  138. package/src/components/sidebar-navigation-screen-patterns/index.js +5 -1
  139. package/src/components/site-hub/index.js +55 -146
  140. package/src/components/site-hub/style.scss +1 -4
  141. package/src/components/site-icon/style.scss +0 -4
  142. package/src/deprecated.js +14 -0
  143. package/src/hooks/push-changes-to-global-styles/index.js +3 -2
  144. package/src/lock-unlock.js +1 -1
  145. package/src/store/private-actions.js +58 -30
@@ -0,0 +1,35 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __, sprintf } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import useEditedEntityRecord from '../use-edited-entity-record';
10
+ import useTitle from '../routes/use-title';
11
+ import { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';
12
+
13
+ function useEditorTitle() {
14
+ const {
15
+ record: editedPost,
16
+ getTitle,
17
+ isLoaded: hasLoadedPost,
18
+ } = useEditedEntityRecord();
19
+ let title;
20
+ if ( hasLoadedPost ) {
21
+ title = sprintf(
22
+ // translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).
23
+ __( '%1$s ‹ %2$s' ),
24
+ getTitle(),
25
+ POST_TYPE_LABELS[ editedPost.type ] ??
26
+ POST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]
27
+ );
28
+ }
29
+
30
+ // Only announce the title once the editor is ready to prevent "Replace"
31
+ // action in <URLQueryController> from double-announcing.
32
+ useTitle( hasLoadedPost && title );
33
+ }
34
+
35
+ export default useEditorTitle;
@@ -382,6 +382,7 @@ function ConfirmDeleteDialog( {
382
382
  confirmButtonText={ __( 'Delete' ) }
383
383
  onCancel={ handleCancelUninstall }
384
384
  onConfirm={ handleConfirmUninstall }
385
+ size="medium"
385
386
  >
386
387
  { font &&
387
388
  sprintf(
@@ -34,7 +34,7 @@ function ScreenCSS() {
34
34
  <>
35
35
  { description }
36
36
  <ExternalLink
37
- href="https://wordpress.org/documentation/article/css/"
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' ) }
@@ -81,28 +81,11 @@ function ScreenRevisions() {
81
81
  };
82
82
 
83
83
  const restoreRevision = ( revision ) => {
84
- setUserConfig( () => ( {
85
- styles: revision?.styles,
86
- settings: revision?.settings,
87
- _links: revision?._links,
88
- } ) );
84
+ setUserConfig( () => revision );
89
85
  setIsLoadingRevisionWithUnsavedChanges( false );
90
86
  onCloseRevisions();
91
87
  };
92
88
 
93
- const selectRevision = ( revision ) => {
94
- setCurrentlySelectedRevision( {
95
- /*
96
- * The default must be an empty object so that
97
- * `mergeBaseAndUserConfigs()` can merge them correctly.
98
- */
99
- styles: revision?.styles || {},
100
- settings: revision?.settings || {},
101
- _links: revision?._links || {},
102
- id: revision?.id,
103
- } );
104
- };
105
-
106
89
  useEffect( () => {
107
90
  if (
108
91
  ! editorCanvasContainerView ||
@@ -134,11 +117,7 @@ function ScreenRevisions() {
134
117
  * See: https://github.com/WordPress/gutenberg/issues/55866
135
118
  */
136
119
  if ( shouldSelectFirstItem ) {
137
- setCurrentlySelectedRevision( {
138
- styles: firstRevision?.styles || {},
139
- settings: firstRevision?.settings || {},
140
- id: firstRevision?.id,
141
- } );
120
+ setCurrentlySelectedRevision( firstRevision );
142
121
  }
143
122
  }, [ shouldSelectFirstItem, firstRevision ] );
144
123
 
@@ -186,7 +165,7 @@ function ScreenRevisions() {
186
165
  />
187
166
  ) ) }
188
167
  <RevisionsButtons
189
- onChange={ selectRevision }
168
+ onChange={ setCurrentlySelectedRevision }
190
169
  selectedRevisionId={ currentlySelectedRevisionId }
191
170
  userRevisions={ currentRevisions }
192
171
  canApplyRevision={ isLoadButtonEnabled }
@@ -219,6 +198,7 @@ function ScreenRevisions() {
219
198
  onCancel={ () =>
220
199
  setIsLoadingRevisionWithUnsavedChanges( false )
221
200
  }
201
+ size="medium"
222
202
  >
223
203
  { __(
224
204
  'Are you sure you want to apply this revision? Any unsaved changes will be lost.'
@@ -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
- .components-button.is-tertiary:disabled {
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 {
@@ -201,6 +201,7 @@ export default function ShadowsEditPanel() {
201
201
  setIsConfirmDialogVisible( false );
202
202
  } }
203
203
  confirmButtonText={ __( 'Delete' ) }
204
+ size="medium"
204
205
  >
205
206
  { sprintf(
206
207
  // translators: %s: name of the shadow
@@ -15,6 +15,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
+ import { filterObjectByProperty } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
18
19
  import { unlock } from '../../../lock-unlock';
19
20
 
20
21
  const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
@@ -22,30 +23,24 @@ const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
22
23
  blockEditorPrivateApis
23
24
  );
24
25
 
25
- export default function Variation( { variation, children, isPill } ) {
26
+ export default function Variation( { variation, children, isPill, property } ) {
26
27
  const [ isFocused, setIsFocused ] = useState( false );
27
28
  const { base, user, setUserConfig } = useContext( GlobalStylesContext );
28
- const context = useMemo(
29
- () => ( {
30
- user: {
31
- settings: variation.settings ?? {},
32
- styles: variation.styles ?? {},
33
- _links: variation._links ?? {},
34
- },
29
+
30
+ const context = useMemo( () => {
31
+ let merged = mergeBaseAndUserConfigs( base, variation );
32
+ if ( property ) {
33
+ merged = filterObjectByProperty( merged, property );
34
+ }
35
+ return {
36
+ user: variation,
35
37
  base,
36
- merged: mergeBaseAndUserConfigs( base, variation ),
38
+ merged,
37
39
  setUserConfig: () => {},
38
- } ),
39
- [ variation, base ]
40
- );
40
+ };
41
+ }, [ variation, base, property ] );
41
42
 
42
- const selectVariation = () => {
43
- setUserConfig( () => ( {
44
- settings: variation.settings,
45
- styles: variation.styles,
46
- _links: variation._links,
47
- } ) );
48
- };
43
+ const selectVariation = () => setUserConfig( variation );
49
44
 
50
45
  const selectOnEnter = ( event ) => {
51
46
  if ( event.keyCode === ENTER ) {
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __experimentalVStack as VStack } from '@wordpress/components';
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,18 @@ export default function ColorVariations( { title, gap = 2 } ) {
22
25
  return (
23
26
  <VStack spacing={ 3 }>
24
27
  { title && <Subtitle level={ 3 }>{ title }</Subtitle> }
25
- <VStack spacing={ gap }>
28
+ <Grid spacing={ gap }>
26
29
  { colorVariations.map( ( variation, index ) => (
27
- <Variation key={ index } variation={ variation } isPill>
30
+ <Variation
31
+ key={ index }
32
+ variation={ variation }
33
+ isPill
34
+ property="color"
35
+ >
28
36
  { () => <StylesPreviewColors /> }
29
37
  </Variation>
30
38
  ) ) }
31
- </VStack>
39
+ </Grid>
32
40
  </VStack>
33
41
  );
34
42
  }
@@ -35,7 +35,11 @@ export default function TypographyVariations( { title, gap = 2 } ) {
35
35
  { typographyVariations &&
36
36
  typographyVariations.length &&
37
37
  typographyVariations.map( ( variation, index ) => (
38
- <Variation key={ index } variation={ variation }>
38
+ <Variation
39
+ key={ index }
40
+ variation={ variation }
41
+ property="typography"
42
+ >
39
43
  { ( isFocused ) => (
40
44
  <PreviewIframe
41
45
  label={ variation?.title }
@@ -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
- .edit-site-layout__header-container:has(+ .edit-site-layout__content > .edit-site-layout__mobile>.edit-site-page) {
30
- margin-bottom: $header-height;
31
- @include break-medium {
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', 'Option that shows all synchronized patterns' ),
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
- { SYNC_FILTERS.find(
302
- ( { value } ) => value === item.syncStatus
303
- )?.label ||
304
- SYNC_FILTERS.find(
305
- ( { value } ) =>
306
- value === PATTERN_SYNC_TYPES.unsynced
307
- ).label }
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
- aria-label={ __( 'First page' ) }
51
- >
52
- «
53
- </Button>
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
- aria-label={ __( 'Previous page' ) }
59
- >
60
-
61
- </Button>
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
- aria-label={ __( 'Next page' ) }
77
- >
78
-
79
- </Button>
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
- aria-label={ __( 'Last page' ) }
85
- >
86
- »
87
- </Button>
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: isCustom ? customViewId : slug,
42
- isCustom: isCustom ? 'true' : 'false',
45
+ activeView,
46
+ isCustom: isCustom ? 'true' : undefined,
43
47
  } );
44
48
  return (
45
49
  <HStack
@@ -76,7 +76,7 @@ export default function SidebarNavigationScreen( {
76
76
  justify="flex-start"
77
77
  >
78
78
  <HStack
79
- spacing={ 4 }
79
+ spacing={ 3 }
80
80
  alignment="flex-start"
81
81
  className="edit-site-sidebar-navigation-screen__title-icon"
82
82
  >