@wordpress/edit-site 5.12.6 → 5.12.7

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 (152) hide show
  1. package/build/components/block-editor/use-site-editor-settings.js +10 -5
  2. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  3. package/build/components/create-pattern-modal/index.js +1 -1
  4. package/build/components/create-pattern-modal/index.js.map +1 -1
  5. package/build/components/global-styles/palette.js +1 -1
  6. package/build/components/global-styles/palette.js.map +1 -1
  7. package/build/components/header-edit-mode/index.js +6 -2
  8. package/build/components/header-edit-mode/index.js.map +1 -1
  9. package/build/components/layout/index.js +1 -1
  10. package/build/components/layout/index.js.map +1 -1
  11. package/build/components/page/header.js +1 -1
  12. package/build/components/page/header.js.map +1 -1
  13. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -5
  14. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  15. package/build/components/page-patterns/grid-item.js +1 -1
  16. package/build/components/page-patterns/grid-item.js.map +1 -1
  17. package/build/components/page-patterns/patterns-list.js +3 -3
  18. package/build/components/page-patterns/patterns-list.js.map +1 -1
  19. package/build/components/page-patterns/use-patterns.js +2 -10
  20. package/build/components/page-patterns/use-patterns.js.map +1 -1
  21. package/build/components/page-template-parts/index.js +1 -0
  22. package/build/components/page-template-parts/index.js.map +1 -1
  23. package/build/components/page-templates/index.js +1 -0
  24. package/build/components/page-templates/index.js.map +1 -1
  25. package/build/components/sidebar-edit-mode/page-panels/page-content.js +4 -3
  26. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  27. package/build/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  28. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  29. package/build/components/sidebar-navigation-screen-main/index.js +4 -2
  30. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  31. package/build/components/sidebar-navigation-screen-main/template-part-hint.js +45 -0
  32. package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  33. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
  34. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  35. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +6 -2
  36. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  37. package/build/components/sidebar-navigation-screen-page/status-label.js +1 -1
  38. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  39. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +3 -3
  40. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  41. package/build/components/sidebar-navigation-screen-patterns/index.js +68 -43
  42. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  43. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +20 -9
  44. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  45. package/build/components/site-hub/index.js +1 -1
  46. package/build/components/site-hub/index.js.map +1 -1
  47. package/build/components/template-actions/index.js +22 -6
  48. package/build/components/template-actions/index.js.map +1 -1
  49. package/build/components/welcome-guide/page.js +2 -2
  50. package/build/components/welcome-guide/page.js.map +1 -1
  51. package/build/components/welcome-guide/template.js +2 -2
  52. package/build/components/welcome-guide/template.js.map +1 -1
  53. package/build/hooks/commands/use-edit-mode-commands.js +1 -2
  54. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  55. package/build/store/private-actions.js +7 -1
  56. package/build/store/private-actions.js.map +1 -1
  57. package/build-module/components/block-editor/use-site-editor-settings.js +10 -5
  58. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  59. package/build-module/components/create-pattern-modal/index.js +1 -1
  60. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  61. package/build-module/components/global-styles/palette.js +1 -1
  62. package/build-module/components/global-styles/palette.js.map +1 -1
  63. package/build-module/components/header-edit-mode/index.js +6 -2
  64. package/build-module/components/header-edit-mode/index.js.map +1 -1
  65. package/build-module/components/layout/index.js +1 -1
  66. package/build-module/components/layout/index.js.map +1 -1
  67. package/build-module/components/page/header.js +1 -1
  68. package/build-module/components/page/header.js.map +1 -1
  69. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -3
  70. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  71. package/build-module/components/page-patterns/grid-item.js +1 -1
  72. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  73. package/build-module/components/page-patterns/patterns-list.js +3 -3
  74. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  75. package/build-module/components/page-patterns/use-patterns.js +2 -10
  76. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  77. package/build-module/components/page-template-parts/index.js +1 -0
  78. package/build-module/components/page-template-parts/index.js.map +1 -1
  79. package/build-module/components/page-templates/index.js +1 -0
  80. package/build-module/components/page-templates/index.js.map +1 -1
  81. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +5 -2
  82. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  83. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  84. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  85. package/build-module/components/sidebar-navigation-screen-main/index.js +4 -3
  86. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  87. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +33 -0
  88. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  89. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
  90. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  91. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +6 -3
  92. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  93. package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -1
  94. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  95. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +3 -3
  96. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  97. package/build-module/components/sidebar-navigation-screen-patterns/index.js +71 -44
  98. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  99. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +18 -9
  100. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  101. package/build-module/components/site-hub/index.js +1 -1
  102. package/build-module/components/site-hub/index.js.map +1 -1
  103. package/build-module/components/template-actions/index.js +24 -7
  104. package/build-module/components/template-actions/index.js.map +1 -1
  105. package/build-module/components/welcome-guide/page.js +2 -2
  106. package/build-module/components/welcome-guide/page.js.map +1 -1
  107. package/build-module/components/welcome-guide/template.js +2 -2
  108. package/build-module/components/welcome-guide/template.js.map +1 -1
  109. package/build-module/hooks/commands/use-edit-mode-commands.js +1 -2
  110. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  111. package/build-module/store/private-actions.js +7 -1
  112. package/build-module/store/private-actions.js.map +1 -1
  113. package/build-style/style-rtl.css +48 -7
  114. package/build-style/style.css +48 -7
  115. package/package.json +19 -19
  116. package/src/components/block-editor/use-site-editor-settings.js +8 -4
  117. package/src/components/create-pattern-modal/index.js +1 -1
  118. package/src/components/global-styles/palette.js +10 -9
  119. package/src/components/header-edit-mode/document-actions/style.scss +8 -0
  120. package/src/components/header-edit-mode/index.js +17 -9
  121. package/src/components/layout/index.js +1 -1
  122. package/src/components/layout/style.scss +0 -11
  123. package/src/components/page/header.js +1 -1
  124. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
  125. package/src/components/page-patterns/grid-item.js +6 -1
  126. package/src/components/page-patterns/patterns-list.js +3 -3
  127. package/src/components/page-patterns/use-patterns.js +3 -9
  128. package/src/components/page-template-parts/index.js +1 -1
  129. package/src/components/page-templates/index.js +1 -1
  130. package/src/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  131. package/src/components/sidebar-navigation-screen/style.scss +19 -1
  132. package/src/components/sidebar-navigation-screen-global-styles/index.js +56 -39
  133. package/src/components/sidebar-navigation-screen-main/index.js +44 -40
  134. package/src/components/sidebar-navigation-screen-main/template-part-hint.js +36 -0
  135. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
  136. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +10 -6
  137. package/src/components/sidebar-navigation-screen-page/status-label.js +1 -1
  138. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +3 -3
  139. package/src/components/sidebar-navigation-screen-patterns/index.js +85 -75
  140. package/src/components/sidebar-navigation-screen-patterns/style.scss +26 -1
  141. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +31 -9
  142. package/src/components/site-hub/index.js +1 -1
  143. package/src/components/template-actions/index.js +38 -8
  144. package/src/components/welcome-guide/page.js +2 -2
  145. package/src/components/welcome-guide/template.js +2 -2
  146. package/src/hooks/commands/use-edit-mode-commands.js +0 -1
  147. package/src/store/private-actions.js +5 -1
  148. package/build/components/page-content-focus-manager/constants.js +0 -9
  149. package/build/components/page-content-focus-manager/constants.js.map +0 -1
  150. package/build-module/components/page-content-focus-manager/constants.js +0 -2
  151. package/build-module/components/page-content-focus-manager/constants.js.map +0 -1
  152. package/src/components/page-content-focus-manager/constants.js +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.12.6",
3
+ "version": "5.12.7",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,40 +29,40 @@
29
29
  "@babel/runtime": "^7.16.0",
30
30
  "@wordpress/a11y": "^3.35.1",
31
31
  "@wordpress/api-fetch": "^6.32.1",
32
- "@wordpress/block-editor": "^12.3.4",
33
- "@wordpress/block-library": "^8.12.6",
34
- "@wordpress/blocks": "^12.12.2",
35
- "@wordpress/commands": "^0.6.4",
36
- "@wordpress/components": "^25.1.4",
32
+ "@wordpress/block-editor": "^12.3.5",
33
+ "@wordpress/block-library": "^8.12.7",
34
+ "@wordpress/blocks": "^12.12.3",
35
+ "@wordpress/commands": "^0.6.5",
36
+ "@wordpress/components": "^25.1.5",
37
37
  "@wordpress/compose": "^6.12.1",
38
- "@wordpress/core-commands": "^0.4.4",
39
- "@wordpress/core-data": "^6.12.4",
40
- "@wordpress/data": "^9.5.2",
38
+ "@wordpress/core-commands": "^0.4.5",
39
+ "@wordpress/core-data": "^6.12.5",
40
+ "@wordpress/data": "^9.5.3",
41
41
  "@wordpress/date": "^4.35.1",
42
42
  "@wordpress/deprecated": "^3.35.1",
43
43
  "@wordpress/dom": "^3.35.1",
44
- "@wordpress/editor": "^13.12.4",
44
+ "@wordpress/editor": "^13.12.5",
45
45
  "@wordpress/element": "^5.12.1",
46
46
  "@wordpress/escape-html": "^2.35.1",
47
47
  "@wordpress/hooks": "^3.35.1",
48
48
  "@wordpress/html-entities": "^3.35.1",
49
49
  "@wordpress/i18n": "^4.35.1",
50
50
  "@wordpress/icons": "^9.26.2",
51
- "@wordpress/interface": "^5.12.4",
52
- "@wordpress/keyboard-shortcuts": "^4.12.2",
51
+ "@wordpress/interface": "^5.12.5",
52
+ "@wordpress/keyboard-shortcuts": "^4.12.3",
53
53
  "@wordpress/keycodes": "^3.35.1",
54
54
  "@wordpress/media-utils": "^4.26.1",
55
- "@wordpress/notices": "^4.3.2",
56
- "@wordpress/plugins": "^6.3.4",
57
- "@wordpress/preferences": "^3.12.4",
55
+ "@wordpress/notices": "^4.3.3",
56
+ "@wordpress/plugins": "^6.3.5",
57
+ "@wordpress/preferences": "^3.12.5",
58
58
  "@wordpress/primitives": "^3.33.1",
59
59
  "@wordpress/private-apis": "^0.17.1",
60
- "@wordpress/reusable-blocks": "^4.12.4",
60
+ "@wordpress/reusable-blocks": "^4.12.5",
61
61
  "@wordpress/router": "^0.4.1",
62
62
  "@wordpress/style-engine": "^1.18.1",
63
63
  "@wordpress/url": "^3.36.1",
64
- "@wordpress/viewport": "^5.12.2",
65
- "@wordpress/widgets": "^3.12.4",
64
+ "@wordpress/viewport": "^5.12.3",
65
+ "@wordpress/widgets": "^3.12.5",
66
66
  "@wordpress/wordcount": "^3.35.1",
67
67
  "change-case": "^4.1.2",
68
68
  "classnames": "^2.3.1",
@@ -84,5 +84,5 @@
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  },
87
- "gitHead": "65fb4cd5187a47ca274c24c04a220bcdb2ddfa67"
87
+ "gitHead": "3eeb607ebb76c3bf06cb8acb462f0dc068f340f9"
88
88
  }
@@ -12,11 +12,13 @@ import { unlock } from '../../lock-unlock';
12
12
  import inserterMediaCategories from './inserter-media-categories';
13
13
 
14
14
  export default function useSiteEditorSettings( templateType ) {
15
- const { storedSettings } = useSelect( ( select ) => {
16
- const { getSettings } = unlock( select( editSiteStore ) );
17
-
15
+ const { storedSettings, canvasMode } = useSelect( ( select ) => {
16
+ const { getSettings, getCanvasMode } = unlock(
17
+ select( editSiteStore )
18
+ );
18
19
  return {
19
20
  storedSettings: getSettings(),
21
+ canvasMode: getCanvasMode(),
20
22
  };
21
23
  }, [] );
22
24
 
@@ -70,6 +72,7 @@ export default function useSiteEditorSettings( templateType ) {
70
72
  const {
71
73
  __experimentalAdditionalBlockPatterns,
72
74
  __experimentalAdditionalBlockPatternCategories,
75
+ focusMode,
73
76
  ...restStoredSettings
74
77
  } = storedSettings;
75
78
 
@@ -86,6 +89,7 @@ export default function useSiteEditorSettings( templateType ) {
86
89
  // active for all entities.
87
90
  templateLock: false,
88
91
  template: false,
92
+ focusMode: canvasMode === 'view' && focusMode ? false : focusMode,
89
93
  };
90
- }, [ storedSettings, blockPatterns, blockPatternCategories ] );
94
+ }, [ storedSettings, blockPatterns, blockPatternCategories, canvasMode ] );
91
95
  }
@@ -56,7 +56,7 @@ export default function CreatePatternModal( {
56
56
  status: 'publish',
57
57
  meta:
58
58
  syncType === SYNC_TYPES.unsynced
59
- ? { sync_status: syncType }
59
+ ? { wp_pattern_sync_status: syncType }
60
60
  : undefined,
61
61
  },
62
62
  { throwOnError: true }
@@ -91,15 +91,16 @@ function Palette( { name } ) {
91
91
  </HStack>
92
92
  </NavigationButtonAsItem>
93
93
  </ItemGroup>
94
- { themeColors?.length > 0 && (
95
- <Button
96
- variant="secondary"
97
- icon={ shuffle }
98
- onClick={ randomizeThemeColors }
99
- >
100
- { __( 'Randomize colors' ) }
101
- </Button>
102
- ) }
94
+ { window.__experimentalEnableColorRandomizer &&
95
+ themeColors?.length > 0 && (
96
+ <Button
97
+ variant="secondary"
98
+ icon={ shuffle }
99
+ onClick={ randomizeThemeColors }
100
+ >
101
+ { __( 'Randomize colors' ) }
102
+ </Button>
103
+ ) }
103
104
  </VStack>
104
105
  );
105
106
  }
@@ -16,6 +16,14 @@
16
16
  color: currentColor;
17
17
  background: $gray-200;
18
18
  }
19
+
20
+ @include break-medium() {
21
+ width: 50%;
22
+ }
23
+
24
+ @include break-large() {
25
+ width: min(100%, 450px);
26
+ }
19
27
  }
20
28
 
21
29
  .edit-site-document-actions__command {
@@ -108,6 +108,9 @@ export default function HeaderEditMode() {
108
108
  };
109
109
  }, [] );
110
110
 
111
+ const { get: getPreference } = useSelect( preferencesStore );
112
+ const hasFixedToolbar = getPreference( editSiteStore.name, 'fixedToolbar' );
113
+
111
114
  const {
112
115
  __experimentalSetPreviewDeviceType: setPreviewDeviceType,
113
116
  setIsInserterOpened,
@@ -213,14 +216,18 @@ export default function HeaderEditMode() {
213
216
  ) }
214
217
  { isLargeViewport && (
215
218
  <>
216
- <ToolbarItem
217
- as={ ToolSelector }
218
- showTooltip={ ! showIconLabels }
219
- variant={
220
- showIconLabels ? 'tertiary' : undefined
221
- }
222
- disabled={ ! isVisualMode }
223
- />
219
+ { ! hasFixedToolbar && (
220
+ <ToolbarItem
221
+ as={ ToolSelector }
222
+ showTooltip={ ! showIconLabels }
223
+ variant={
224
+ showIconLabels
225
+ ? 'tertiary'
226
+ : undefined
227
+ }
228
+ disabled={ ! isVisualMode }
229
+ />
230
+ ) }
224
231
  <ToolbarItem
225
232
  as={ UndoButton }
226
233
  showTooltip={ ! showIconLabels }
@@ -257,7 +264,8 @@ export default function HeaderEditMode() {
257
264
  />
258
265
  ) }
259
266
  { isZoomedOutViewExperimentEnabled &&
260
- ! isDistractionFree && (
267
+ ! isDistractionFree &&
268
+ ! hasFixedToolbar && (
261
269
  <ToolbarItem
262
270
  as={ Button }
263
271
  className="edit-site-header-edit-mode__zoom-out-view-toggle"
@@ -143,7 +143,7 @@ export default function Layout() {
143
143
  headerAnimationState = canvasMode; // edit, view, init
144
144
  }
145
145
 
146
- // Sets the right context for the command center
146
+ // Sets the right context for the command palette
147
147
  const commandContext =
148
148
  canvasMode === 'edit' && isEditorPage
149
149
  ? 'site-editor-edit'
@@ -4,17 +4,6 @@
4
4
  color: $gray-400;
5
5
  display: flex;
6
6
  flex-direction: column;
7
-
8
- // Expand the fixed block toolbar to cover the document title control.
9
- .block-editor-block-contextual-toolbar {
10
- @include break-medium() {
11
- &.is-fixed {
12
- // the combined with of the tools at the right of the header and the margin left
13
- width: calc(100% - 240px - #{$grid-unit-80} - #{$grid-unit-70});
14
- }
15
- }
16
- }
17
-
18
7
  }
19
8
 
20
9
  .edit-site-layout__hub {
@@ -18,7 +18,7 @@ export default function Header( { title, subTitle, actions } ) {
18
18
  <HStack as="header" alignment="left" className="edit-site-page-header">
19
19
  <FlexBlock className="edit-site-page-header__page-title">
20
20
  <Heading
21
- as="h1"
21
+ as="h2"
22
22
  level={ 4 }
23
23
  className="edit-site-page-header__title"
24
24
  >
@@ -10,16 +10,22 @@ import { useEffect } from '@wordpress/element';
10
10
  * Internal dependencies
11
11
  */
12
12
  import { unlock } from '../../lock-unlock';
13
- import { PAGE_CONTENT_BLOCK_TYPES } from './constants';
14
13
 
15
14
  const { useBlockEditingMode } = unlock( blockEditorPrivateApis );
16
15
 
16
+ const PAGE_CONTENT_BLOCK_TYPES = [
17
+ 'core/post-title',
18
+ 'core/post-featured-image',
19
+ 'core/post-content',
20
+ ];
21
+
17
22
  /**
18
23
  * Component that when rendered, makes it so that the site editor allows only
19
24
  * page content to be edited.
20
25
  */
21
26
  export default function DisableNonPageContentBlocks() {
22
27
  useDisableNonPageContentBlocks();
28
+ return null;
23
29
  }
24
30
 
25
31
  /**
@@ -43,8 +49,11 @@ export function useDisableNonPageContentBlocks() {
43
49
 
44
50
  const withDisableNonPageContentBlocks = createHigherOrderComponent(
45
51
  ( BlockEdit ) => ( props ) => {
46
- const isContent = PAGE_CONTENT_BLOCK_TYPES.includes( props.name );
47
- const mode = isContent ? 'contentOnly' : undefined;
52
+ const isDescendentOfQueryLoop = !! props.context.queryId;
53
+ const isPageContent =
54
+ PAGE_CONTENT_BLOCK_TYPES.includes( props.name ) &&
55
+ ! isDescendentOfQueryLoop;
56
+ const mode = isPageContent ? 'contentOnly' : undefined;
48
57
  useBlockEditingMode( mode );
49
58
  return <BlockEdit { ...props } />;
50
59
  },
@@ -122,7 +122,12 @@ export default function GridItem( { categoryId, composite, icon, item } ) {
122
122
  aria-label={ item.title }
123
123
  aria-describedby={
124
124
  ariaDescriptions.length
125
- ? ariaDescriptions.join( ' ' )
125
+ ? ariaDescriptions
126
+ .map(
127
+ ( _, index ) =>
128
+ `${ descriptionId }-${ index }`
129
+ )
130
+ .join( ' ' )
126
131
  : undefined
127
132
  }
128
133
  >
@@ -79,14 +79,14 @@ export default function PatternsList( { categoryId, type } ) {
79
79
  <Heading level={ 4 }>{ __( 'Synced' ) }</Heading>
80
80
  <Text variant="muted" as="p">
81
81
  { __(
82
- 'Patterns that are kept in sync across your site'
82
+ 'Patterns that are kept in sync across the site'
83
83
  ) }
84
84
  </Text>
85
85
  </VStack>
86
86
  <Grid
87
87
  icon={ symbol }
88
88
  categoryId={ categoryId }
89
- label={ __( 'Synced patterns' ) }
89
+ label={ __( 'Synced' ) }
90
90
  items={ syncedPatterns }
91
91
  />
92
92
  </>
@@ -97,7 +97,7 @@ export default function PatternsList( { categoryId, type } ) {
97
97
  <Heading level={ 4 }>{ __( 'Standard' ) }</Heading>
98
98
  <Text variant="muted" as="p">
99
99
  { __(
100
- 'Patterns that can be changed freely without affecting your site'
100
+ 'Patterns that can be changed freely without affecting the site'
101
101
  ) }
102
102
  </Text>
103
103
  </VStack>
@@ -38,14 +38,8 @@ const templatePartToPattern = ( templatePart ) => ( {
38
38
  templatePart,
39
39
  } );
40
40
 
41
- const templatePartCategories = [ 'header', 'footer', 'sidebar' ];
42
- const templatePartHasCategory = ( item, category ) => {
43
- if ( category === 'uncategorized' ) {
44
- return ! templatePartCategories.includes( item.templatePart.area );
45
- }
46
-
47
- return item.templatePart.area === category;
48
- };
41
+ const templatePartHasCategory = ( item, category ) =>
42
+ item.templatePart.area === category;
49
43
 
50
44
  const useTemplatePartsAsPatterns = (
51
45
  categoryId,
@@ -154,7 +148,7 @@ const reusableBlockToPattern = ( reusableBlock ) => ( {
154
148
  categories: reusableBlock.wp_pattern,
155
149
  id: reusableBlock.id,
156
150
  name: reusableBlock.slug,
157
- syncStatus: reusableBlock.meta?.sync_status || SYNC_TYPES.full,
151
+ syncStatus: reusableBlock.wp_pattern_sync_status || SYNC_TYPES.full,
158
152
  title: reusableBlock.title.raw,
159
153
  type: reusableBlock.type,
160
154
  reusableBlock,
@@ -45,7 +45,7 @@ export default function PageTemplateParts() {
45
45
  header: __( 'Template Part' ),
46
46
  cell: ( templatePart ) => (
47
47
  <VStack>
48
- <Heading level={ 5 }>
48
+ <Heading as="h3" level={ 5 }>
49
49
  <Link
50
50
  params={ {
51
51
  postId: templatePart.id,
@@ -46,7 +46,7 @@ export default function PageTemplates() {
46
46
  header: __( 'Template' ),
47
47
  cell: ( template ) => (
48
48
  <VStack>
49
- <Heading level={ 5 }>
49
+ <Heading as="h3" level={ 5 }>
50
50
  <Link
51
51
  params={ {
52
52
  postId: template.id,
@@ -6,22 +6,24 @@ import {
6
6
  store as blockEditorStore,
7
7
  privateApis as blockEditorPrivateApis,
8
8
  } from '@wordpress/block-editor';
9
+ import { useMemo } from '@wordpress/element';
9
10
 
10
11
  /**
11
12
  * Internal dependencies
12
13
  */
13
- import { PAGE_CONTENT_BLOCK_TYPES } from '../../page-content-focus-manager/constants';
14
14
  import { unlock } from '../../../lock-unlock';
15
15
 
16
16
  const { BlockQuickNavigation } = unlock( blockEditorPrivateApis );
17
17
 
18
18
  export default function PageContent() {
19
- const clientIds = useSelect(
19
+ const clientIdsTree = useSelect(
20
20
  ( select ) =>
21
- select( blockEditorStore ).__experimentalGetGlobalBlocksByName(
22
- PAGE_CONTENT_BLOCK_TYPES
23
- ),
21
+ unlock( select( blockEditorStore ) ).getEnabledClientIdsTree(),
24
22
  []
25
23
  );
24
+ const clientIds = useMemo(
25
+ () => clientIdsTree.map( ( { clientId } ) => clientId ),
26
+ [ clientIdsTree ]
27
+ );
26
28
  return <BlockQuickNavigation clientIds={ clientIds } />;
27
29
  }
@@ -98,6 +98,20 @@
98
98
  border-top: 1px solid $gray-800;
99
99
  }
100
100
 
101
+ .edit-site-sidebar__notice {
102
+ background: $gray-800;
103
+ color: $gray-300;
104
+ margin: $grid-unit-30 0;
105
+ &.is-dismissible {
106
+ padding-right: $grid-unit-10;
107
+ }
108
+ .components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):focus,
109
+ .components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):active,
110
+ .components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):hover {
111
+ color: $gray-100;
112
+ }
113
+ }
114
+
101
115
  /* In general style overrides are discouraged.
102
116
  * This is a temporary solution to override the InputControl component's styles.
103
117
  * The `Theme` component will potentially be the more appropriate approach
@@ -107,7 +121,11 @@
107
121
  .edit-site-sidebar-navigation-screen__input-control {
108
122
  width: 100%;
109
123
  .components-input-control__container {
110
- background: transparent;
124
+ background: $gray-800;
125
+
126
+ .components-button {
127
+ color: $gray-200 !important;
128
+ }
111
129
  }
112
130
  .components-input-control__input {
113
131
  color: $gray-200 !important;
@@ -37,17 +37,27 @@ export function SidebarNavigationItemGlobalStyles( props ) {
37
37
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
38
38
  const { createNotice } = useDispatch( noticesStore );
39
39
  const { set: setPreference } = useDispatch( preferencesStore );
40
- const { hasGlobalStyleVariations, isDistractionFree } = useSelect(
41
- ( select ) => ( {
42
- hasGlobalStyleVariations:
43
- !! select(
44
- coreStore
45
- ).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,
46
- isDistractionFree: select( preferencesStore ).get(
47
- editSiteStore.name,
48
- 'distractionFree'
49
- ),
50
- } ),
40
+ const { get: getPrefference } = useSelect( preferencesStore );
41
+
42
+ const turnOffDistractionFreeMode = useCallback( () => {
43
+ const isDistractionFree = getPrefference(
44
+ editSiteStore.name,
45
+ 'distractionFree'
46
+ );
47
+ if ( ! isDistractionFree ) {
48
+ return;
49
+ }
50
+ setPreference( editSiteStore.name, 'distractionFree', false );
51
+ createNotice( 'info', __( 'Distraction free mode turned off' ), {
52
+ isDismissible: true,
53
+ type: 'snackbar',
54
+ } );
55
+ }, [ createNotice, setPreference, getPrefference ] );
56
+ const hasGlobalStyleVariations = useSelect(
57
+ ( select ) =>
58
+ !! select(
59
+ coreStore
60
+ ).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,
51
61
  []
52
62
  );
53
63
  if ( hasGlobalStyleVariations ) {
@@ -63,19 +73,7 @@ export function SidebarNavigationItemGlobalStyles( props ) {
63
73
  <SidebarNavigationItem
64
74
  { ...props }
65
75
  onClick={ () => {
66
- // Disable distraction free mode.
67
- if ( isDistractionFree ) {
68
- setPreference(
69
- editSiteStore.name,
70
- 'distractionFree',
71
- false
72
- );
73
- createNotice(
74
- 'info',
75
- __( 'Distraction free mode turned off.' ),
76
- { type: 'snackbar' }
77
- );
78
- }
76
+ turnOffDistractionFreeMode();
79
77
  // Switch to edit mode.
80
78
  setCanvasMode( 'edit' );
81
79
  // Open global styles sidebar.
@@ -170,22 +168,41 @@ export default function SidebarNavigationScreenGlobalStyles() {
170
168
  const { setCanvasMode, setEditorCanvasContainerView } = unlock(
171
169
  useDispatch( editSiteStore )
172
170
  );
171
+ const { createNotice } = useDispatch( noticesStore );
172
+ const { set: setPreference } = useDispatch( preferencesStore );
173
+ const { get: getPrefference } = useSelect( preferencesStore );
174
+ const { isViewMode, isStyleBookOpened } = useSelect( ( select ) => {
175
+ const { getCanvasMode, getEditorCanvasContainerView } = unlock(
176
+ select( editSiteStore )
177
+ );
178
+ return {
179
+ isViewMode: 'view' === getCanvasMode(),
180
+ isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
181
+ };
182
+ }, [] );
173
183
 
174
- const isStyleBookOpened = useSelect(
175
- ( select ) =>
176
- 'style-book' ===
177
- unlock( select( editSiteStore ) ).getEditorCanvasContainerView(),
178
- []
179
- );
184
+ const turnOffDistractionFreeMode = useCallback( () => {
185
+ const isDistractionFree = getPrefference(
186
+ editSiteStore.name,
187
+ 'distractionFree'
188
+ );
189
+ if ( ! isDistractionFree ) {
190
+ return;
191
+ }
192
+ setPreference( editSiteStore.name, 'distractionFree', false );
193
+ createNotice( 'info', __( 'Distraction free mode turned off' ), {
194
+ isDismissible: true,
195
+ type: 'snackbar',
196
+ } );
197
+ }, [ createNotice, setPreference, getPrefference ] );
180
198
 
181
- const openGlobalStyles = useCallback(
182
- async () =>
183
- Promise.all( [
184
- setCanvasMode( 'edit' ),
185
- openGeneralSidebar( 'edit-site/global-styles' ),
186
- ] ),
187
- [ setCanvasMode, openGeneralSidebar ]
188
- );
199
+ const openGlobalStyles = useCallback( async () => {
200
+ turnOffDistractionFreeMode();
201
+ return Promise.all( [
202
+ setCanvasMode( 'edit' ),
203
+ openGeneralSidebar( 'edit-site/global-styles' ),
204
+ ] );
205
+ }, [ setCanvasMode, openGeneralSidebar, turnOffDistractionFreeMode ] );
189
206
 
190
207
  const openStyleBook = useCallback( async () => {
191
208
  await openGlobalStyles();
@@ -246,7 +263,7 @@ export default function SidebarNavigationScreenGlobalStyles() {
246
263
  </>
247
264
  }
248
265
  />
249
- { isStyleBookOpened && ! isMobileViewport && (
266
+ { isStyleBookOpened && ! isMobileViewport && isViewMode && (
250
267
  <StyleBook
251
268
  enableResizing={ false }
252
269
  isSelected={ () => false }
@@ -20,6 +20,7 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
20
20
  import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
21
21
  import { unlock } from '../../lock-unlock';
22
22
  import { store as editSiteStore } from '../../store';
23
+ import TemplatePartHint from './template-part-hint';
23
24
 
24
25
  export default function SidebarNavigationScreenMain() {
25
26
  const { location } = useNavigator();
@@ -42,46 +43,49 @@ export default function SidebarNavigationScreenMain() {
42
43
  'Customize the appearance of your website using the block editor.'
43
44
  ) }
44
45
  content={
45
- <ItemGroup>
46
- <NavigatorButton
47
- as={ SidebarNavigationItem }
48
- path="/navigation"
49
- withChevron
50
- icon={ navigation }
51
- >
52
- { __( 'Navigation' ) }
53
- </NavigatorButton>
54
- <SidebarNavigationItemGlobalStyles
55
- withChevron
56
- icon={ styles }
57
- >
58
- { __( 'Styles' ) }
59
- </SidebarNavigationItemGlobalStyles>
60
- <NavigatorButton
61
- as={ SidebarNavigationItem }
62
- path="/page"
63
- withChevron
64
- icon={ page }
65
- >
66
- { __( 'Pages' ) }
67
- </NavigatorButton>
68
- <NavigatorButton
69
- as={ SidebarNavigationItem }
70
- path="/wp_template"
71
- withChevron
72
- icon={ layout }
73
- >
74
- { __( 'Templates' ) }
75
- </NavigatorButton>
76
- <NavigatorButton
77
- as={ SidebarNavigationItem }
78
- path="/patterns"
79
- withChevron
80
- icon={ symbol }
81
- >
82
- { __( 'Patterns' ) }
83
- </NavigatorButton>
84
- </ItemGroup>
46
+ <>
47
+ <ItemGroup>
48
+ <NavigatorButton
49
+ as={ SidebarNavigationItem }
50
+ path="/navigation"
51
+ withChevron
52
+ icon={ navigation }
53
+ >
54
+ { __( 'Navigation' ) }
55
+ </NavigatorButton>
56
+ <SidebarNavigationItemGlobalStyles
57
+ withChevron
58
+ icon={ styles }
59
+ >
60
+ { __( 'Styles' ) }
61
+ </SidebarNavigationItemGlobalStyles>
62
+ <NavigatorButton
63
+ as={ SidebarNavigationItem }
64
+ path="/page"
65
+ withChevron
66
+ icon={ page }
67
+ >
68
+ { __( 'Pages' ) }
69
+ </NavigatorButton>
70
+ <NavigatorButton
71
+ as={ SidebarNavigationItem }
72
+ path="/wp_template"
73
+ withChevron
74
+ icon={ layout }
75
+ >
76
+ { __( 'Templates' ) }
77
+ </NavigatorButton>
78
+ <NavigatorButton
79
+ as={ SidebarNavigationItem }
80
+ path="/patterns"
81
+ withChevron
82
+ icon={ symbol }
83
+ >
84
+ { __( 'Patterns' ) }
85
+ </NavigatorButton>
86
+ </ItemGroup>
87
+ <TemplatePartHint />
88
+ </>
85
89
  }
86
90
  />
87
91
  );