@wordpress/edit-site 5.3.6 → 5.3.8

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-template/new-template.js +16 -10
  2. package/build/components/add-new-template/new-template.js.map +1 -1
  3. package/build/components/block-editor/editor-canvas.js +2 -1
  4. package/build/components/block-editor/editor-canvas.js.map +1 -1
  5. package/build/components/layout/index.js +6 -0
  6. package/build/components/layout/index.js.map +1 -1
  7. package/build/components/list/index.js +2 -1
  8. package/build/components/list/index.js.map +1 -1
  9. package/build/components/routes/link.js +4 -1
  10. package/build/components/routes/link.js.map +1 -1
  11. package/build/components/save-button/index.js +2 -5
  12. package/build/components/save-button/index.js.map +1 -1
  13. package/build/components/save-hub/index.js +82 -0
  14. package/build/components/save-hub/index.js.map +1 -0
  15. package/build/components/sidebar/index.js +2 -4
  16. package/build/components/sidebar/index.js.map +1 -1
  17. package/build/components/sidebar-navigation-screen/index.js +5 -2
  18. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  19. package/build/components/sidebar-navigation-screen-main/index.js +1 -0
  20. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  21. package/build/components/sidebar-navigation-screen-navigation-item/index.js +9 -14
  22. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  23. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +100 -11
  24. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  25. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +19 -0
  26. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
  27. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +77 -0
  28. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
  29. package/build/components/sidebar-navigation-screen-template/index.js +18 -4
  30. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  31. package/build/components/sidebar-navigation-screen-templates/index.js +5 -2
  32. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  33. package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -3
  34. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  35. package/build/components/style-book/index.js +134 -19
  36. package/build/components/style-book/index.js.map +1 -1
  37. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +24 -8
  38. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  39. package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -7
  40. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  41. package/build/components/template-details/index.js +0 -3
  42. package/build/components/template-details/index.js.map +1 -1
  43. package/build/components/use-edited-entity-record/index.js +6 -6
  44. package/build/components/use-edited-entity-record/index.js.map +1 -1
  45. package/build/index.js +3 -0
  46. package/build/index.js.map +1 -1
  47. package/build/utils/history.js +8 -2
  48. package/build/utils/history.js.map +1 -1
  49. package/build-module/components/add-new-template/new-template.js +18 -11
  50. package/build-module/components/add-new-template/new-template.js.map +1 -1
  51. package/build-module/components/block-editor/editor-canvas.js +2 -1
  52. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  53. package/build-module/components/layout/index.js +6 -0
  54. package/build-module/components/layout/index.js.map +1 -1
  55. package/build-module/components/list/index.js +2 -1
  56. package/build-module/components/list/index.js.map +1 -1
  57. package/build-module/components/routes/link.js +5 -2
  58. package/build-module/components/routes/link.js.map +1 -1
  59. package/build-module/components/save-button/index.js +2 -5
  60. package/build-module/components/save-button/index.js.map +1 -1
  61. package/build-module/components/save-hub/index.js +68 -0
  62. package/build-module/components/save-hub/index.js.map +1 -0
  63. package/build-module/components/sidebar/index.js +2 -4
  64. package/build-module/components/sidebar/index.js.map +1 -1
  65. package/build-module/components/sidebar-navigation-screen/index.js +5 -2
  66. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  67. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -0
  68. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  69. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +13 -18
  70. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  71. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +94 -11
  72. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  73. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +11 -0
  74. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
  75. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +66 -0
  76. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
  77. package/build-module/components/sidebar-navigation-screen-template/index.js +18 -5
  78. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  79. package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -2
  80. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  81. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -3
  82. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  83. package/build-module/components/style-book/index.js +135 -22
  84. package/build-module/components/style-book/index.js.map +1 -1
  85. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +24 -8
  86. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  87. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -7
  88. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  89. package/build-module/components/template-details/index.js +0 -3
  90. package/build-module/components/template-details/index.js.map +1 -1
  91. package/build-module/components/use-edited-entity-record/index.js +6 -6
  92. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  93. package/build-module/index.js +4 -1
  94. package/build-module/index.js.map +1 -1
  95. package/build-module/utils/history.js +9 -3
  96. package/build-module/utils/history.js.map +1 -1
  97. package/build-style/style-rtl.css +96 -111
  98. package/build-style/style.css +96 -111
  99. package/package.json +10 -10
  100. package/src/components/add-new-template/new-template.js +57 -32
  101. package/src/components/add-new-template/style.scss +12 -1
  102. package/src/components/block-editor/editor-canvas.js +2 -1
  103. package/src/components/layout/index.js +14 -0
  104. package/src/components/layout/style.scss +1 -3
  105. package/src/components/list/index.js +3 -1
  106. package/src/components/routes/link.js +9 -2
  107. package/src/components/save-button/index.js +2 -2
  108. package/src/components/save-hub/index.js +78 -0
  109. package/src/components/save-hub/style.scss +15 -0
  110. package/src/components/sidebar/index.js +2 -3
  111. package/src/components/sidebar/style.scss +4 -3
  112. package/src/components/sidebar-button/style.scss +2 -1
  113. package/src/components/sidebar-navigation-item/style.scss +0 -20
  114. package/src/components/sidebar-navigation-screen/index.js +6 -0
  115. package/src/components/sidebar-navigation-screen/style.scss +15 -0
  116. package/src/components/sidebar-navigation-screen-main/index.js +3 -0
  117. package/src/components/sidebar-navigation-screen-navigation-item/index.js +30 -21
  118. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +104 -10
  119. package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +9 -0
  120. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +78 -0
  121. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +59 -4
  122. package/src/components/sidebar-navigation-screen-template/index.js +21 -7
  123. package/src/components/sidebar-navigation-screen-templates/index.js +7 -0
  124. package/src/components/sidebar-navigation-screen-templates-browse/index.js +12 -1
  125. package/src/components/site-hub/style.scss +1 -1
  126. package/src/components/style-book/index.js +209 -54
  127. package/src/components/style-book/style.scss +1 -45
  128. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +38 -8
  129. package/src/components/sync-state-with-url/use-sync-path-with-url.js +12 -7
  130. package/src/components/template-details/index.js +0 -3
  131. package/src/components/use-edited-entity-record/index.js +26 -18
  132. package/src/index.js +5 -1
  133. package/src/style.scss +1 -1
  134. package/src/utils/history.js +13 -9
  135. package/build/components/navigation-inspector/index.js +0 -190
  136. package/build/components/navigation-inspector/index.js.map +0 -1
  137. package/build/components/navigation-inspector/navigation-menu.js +0 -62
  138. package/build/components/navigation-inspector/navigation-menu.js.map +0 -1
  139. package/build-module/components/navigation-inspector/index.js +0 -173
  140. package/build-module/components/navigation-inspector/index.js.map +0 -1
  141. package/build-module/components/navigation-inspector/navigation-menu.js +0 -52
  142. package/build-module/components/navigation-inspector/navigation-menu.js.map +0 -1
  143. package/src/components/navigation-inspector/index.js +0 -223
  144. package/src/components/navigation-inspector/navigation-menu.js +0 -66
  145. package/src/components/navigation-inspector/style.scss +0 -46
@@ -2,20 +2,84 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { useCallback } from '@wordpress/element';
5
+ import { useCallback, useMemo } from '@wordpress/element';
6
+ import { useSelect } from '@wordpress/data';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+ import { BlockEditorProvider } from '@wordpress/block-editor';
9
+ import { createBlock } from '@wordpress/blocks';
6
10
 
7
11
  /**
8
12
  * Internal dependencies
9
13
  */
10
14
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
11
- import NavigationInspector from '../navigation-inspector';
12
15
  import { useHistory } from '../routes';
16
+ import NavigationMenuContent from './navigation-menu-content';
17
+ import { NavigationMenuLoader } from './loader';
18
+ import { unlock } from '../../private-apis';
19
+ import { store as editSiteStore } from '../../store';
20
+
21
+ const noop = () => {};
22
+ const NAVIGATION_MENUS_QUERY = { per_page: -1, status: 'publish' };
23
+
24
+ function SidebarNavigationScreenWrapper( { children, actions } ) {
25
+ return (
26
+ <SidebarNavigationScreen
27
+ title={ __( 'Navigation' ) }
28
+ actions={ actions }
29
+ description={ __(
30
+ 'Browse your site, edit pages, and manage your primary navigation menu.'
31
+ ) }
32
+ content={ children }
33
+ />
34
+ );
35
+ }
13
36
 
14
37
  export default function SidebarNavigationScreenNavigationMenus() {
15
38
  const history = useHistory();
39
+ const { navigationMenus, hasResolvedNavigationMenus, storedSettings } =
40
+ useSelect( ( select ) => {
41
+ const { getSettings } = unlock( select( editSiteStore ) );
42
+ const { getEntityRecords, hasFinishedResolution } =
43
+ select( coreStore );
44
+
45
+ const navigationMenusQuery = [
46
+ 'postType',
47
+ 'wp_navigation',
48
+ NAVIGATION_MENUS_QUERY,
49
+ ];
50
+ return {
51
+ storedSettings: getSettings( false ),
52
+ navigationMenus: getEntityRecords( ...navigationMenusQuery ),
53
+ hasResolvedNavigationMenus: hasFinishedResolution(
54
+ 'getEntityRecords',
55
+ navigationMenusQuery
56
+ ),
57
+ };
58
+ }, [] );
59
+
60
+ // Sort navigation menus by date.
61
+ const orderedNavigationMenus = useMemo(
62
+ () =>
63
+ navigationMenus?.sort( ( menuA, menuB ) => {
64
+ const menuADate = new Date( menuA.date );
65
+ const menuBDate = new Date( menuB.date );
66
+ return menuADate.getTime() > menuBDate.getTime();
67
+ } ),
68
+ [ navigationMenus ]
69
+ );
70
+ const firstNavigationMenu = orderedNavigationMenus?.[ 0 ]?.id;
71
+ const blocks = useMemo( () => {
72
+ return [
73
+ createBlock( 'core/navigation', { ref: firstNavigationMenu } ),
74
+ ];
75
+ }, [ firstNavigationMenu ] );
76
+
77
+ const isLoading = ! hasResolvedNavigationMenus;
78
+ const hasNavigationMenus = !! navigationMenus?.length;
79
+
16
80
  const onSelect = useCallback(
17
81
  ( selectedBlock ) => {
18
- const { attributes } = selectedBlock;
82
+ const { attributes, name } = selectedBlock;
19
83
  if (
20
84
  attributes.kind === 'post-type' &&
21
85
  attributes.id &&
@@ -27,17 +91,47 @@ export default function SidebarNavigationScreenNavigationMenus() {
27
91
  postId: attributes.id,
28
92
  } );
29
93
  }
94
+ if ( name === 'core/page-list-item' && attributes.id && history ) {
95
+ history.push( {
96
+ postType: 'page',
97
+ postId: attributes.id,
98
+ } );
99
+ }
30
100
  },
31
101
  [ history ]
32
102
  );
103
+
104
+ if ( hasResolvedNavigationMenus && ! hasNavigationMenus ) {
105
+ return (
106
+ <SidebarNavigationScreenWrapper>
107
+ { __( 'There are no Navigation Menus.' ) }
108
+ </SidebarNavigationScreenWrapper>
109
+ );
110
+ }
111
+
112
+ if ( ! hasResolvedNavigationMenus || isLoading ) {
113
+ return (
114
+ <SidebarNavigationScreenWrapper>
115
+ <NavigationMenuLoader />
116
+ </SidebarNavigationScreenWrapper>
117
+ );
118
+ }
119
+
33
120
  return (
34
- <SidebarNavigationScreen
35
- title={ __( 'Navigation' ) }
36
- content={
37
- <div className="edit-site-sidebar-navigation-screen-navigation-menus">
38
- <NavigationInspector onSelect={ onSelect } />
121
+ <BlockEditorProvider
122
+ settings={ storedSettings }
123
+ value={ blocks }
124
+ onChange={ noop }
125
+ onInput={ noop }
126
+ >
127
+ <SidebarNavigationScreenWrapper>
128
+ <div className="edit-site-sidebar-navigation-screen-navigation-menus__content">
129
+ <NavigationMenuContent
130
+ rootClientId={ blocks[ 0 ].clientId }
131
+ onSelect={ onSelect }
132
+ />
39
133
  </div>
40
- }
41
- />
134
+ </SidebarNavigationScreenWrapper>
135
+ </BlockEditorProvider>
42
136
  );
43
137
  }
@@ -0,0 +1,9 @@
1
+ export function NavigationMenuLoader() {
2
+ return (
3
+ <>
4
+ <div className="edit-site-sidebar-navigation-screen-navigation-menus__placeholder" />
5
+ <div className="edit-site-sidebar-navigation-screen-navigation-menus__placeholder" />
6
+ <div className="edit-site-sidebar-navigation-screen-navigation-menus__placeholder" />
7
+ </>
8
+ );
9
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ privateApis as blockEditorPrivateApis,
6
+ store as blockEditorStore,
7
+ BlockList,
8
+ BlockTools,
9
+ } from '@wordpress/block-editor';
10
+ import { useDispatch, useSelect } from '@wordpress/data';
11
+ import { createBlock } from '@wordpress/blocks';
12
+ import { useCallback } from '@wordpress/element';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import { unlock } from '../../private-apis';
18
+ import { NavigationMenuLoader } from './loader';
19
+
20
+ export default function NavigationMenuContent( { rootClientId, onSelect } ) {
21
+ const { clientIdsTree, isLoading } = useSelect(
22
+ ( select ) => {
23
+ const { __unstableGetClientIdsTree, areInnerBlocksControlled } =
24
+ select( blockEditorStore );
25
+ return {
26
+ clientIdsTree: __unstableGetClientIdsTree( rootClientId ),
27
+
28
+ // This is a small hack to wait for the navigation block
29
+ // to actually load its inner blocks.
30
+ isLoading: ! areInnerBlocksControlled( rootClientId ),
31
+ };
32
+ },
33
+ [ rootClientId ]
34
+ );
35
+ const { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =
36
+ useDispatch( blockEditorStore );
37
+
38
+ const { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );
39
+
40
+ const offCanvasOnselect = useCallback(
41
+ ( block ) => {
42
+ if (
43
+ block.name === 'core/navigation-link' &&
44
+ ! block.attributes.url
45
+ ) {
46
+ __unstableMarkNextChangeAsNotPersistent();
47
+ replaceBlock(
48
+ block.clientId,
49
+ createBlock( 'core/navigation-link', block.attributes )
50
+ );
51
+ } else {
52
+ onSelect( block );
53
+ }
54
+ },
55
+ [ onSelect, __unstableMarkNextChangeAsNotPersistent, replaceBlock ]
56
+ );
57
+
58
+ // The hidden block is needed because it makes block edit side effects trigger.
59
+ // For example a navigation page list load its items has an effect on edit to load its items.
60
+ return (
61
+ <>
62
+ { isLoading && <NavigationMenuLoader /> }
63
+ { ! isLoading && (
64
+ <OffCanvasEditor
65
+ blocks={ clientIdsTree }
66
+ onSelect={ offCanvasOnselect }
67
+ LeafMoreMenu={ LeafMoreMenu }
68
+ showAppender={ false }
69
+ />
70
+ ) }
71
+ <div style={ { visibility: 'hidden' } }>
72
+ <BlockTools>
73
+ <BlockList />
74
+ </BlockTools>
75
+ </div>
76
+ </>
77
+ );
78
+ }
@@ -1,12 +1,67 @@
1
- .edit-site-sidebar-navigation-screen-navigation-menus {
2
- .block-editor-list-view-block__menu-edit,
3
- .edit-site-navigation-inspector__select-menu {
4
- display: none;
1
+ .edit-site-sidebar-navigation-screen__description {
2
+ margin: 0 0 $grid-unit-40 $grid-unit-20;
3
+ }
4
+
5
+ .edit-site-sidebar-navigation-screen-navigation-menus__placeholder {
6
+ padding: $grid-unit-10;
7
+ margin: $grid-unit-10;
8
+ background-color: $gray-100;
9
+ animation: loadingpulse 1s linear infinite;
10
+ animation-delay: 0.5s; // avoid animating for fast network responses
11
+ }
12
+
13
+ @keyframes loadingpulse {
14
+ 0% {
15
+ opacity: 1;
16
+ }
17
+ 50% {
18
+ opacity: 0.5;
5
19
  }
20
+ 100% {
21
+ opacity: 1;
22
+ }
23
+ }
24
+
25
+ .edit-site-sidebar-navigation-screen-navigation-menus__content {
6
26
  .offcanvas-editor-list-view-leaf {
7
27
  max-width: calc(100% - #{ $grid-unit-05 });
28
+ border-radius: $radius-block-ui;
29
+ &:hover,
30
+ &:focus,
31
+ &[aria-current] {
32
+ background: $gray-800;
33
+ }
34
+ .block-editor-list-view-block__menu {
35
+ margin-left: -$grid-unit-10;
36
+ }
8
37
  }
38
+
9
39
  .block-editor-list-view-leaf .block-editor-list-view-block__contents-cell {
10
40
  width: 100%;
11
41
  }
42
+
43
+ .block-editor-list-view-leaf .block-editor-list-view-block-contents {
44
+ white-space: normal;
45
+ }
46
+
47
+ .block-editor-list-view-block__title {
48
+ margin-top: 3px;
49
+ }
50
+
51
+ .block-editor-list-view-block__menu-cell {
52
+ padding-right: 0;
53
+ }
54
+
55
+ .components-button {
56
+ color: $gray-600;
57
+ &:hover,
58
+ &:focus,
59
+ &[aria-current] {
60
+ color: $white;
61
+ }
62
+ }
63
+ }
64
+
65
+ .edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu {
66
+ display: none;
12
67
  }
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __ } from '@wordpress/i18n';
4
+ import { __, sprintf } from '@wordpress/i18n';
5
5
  import { useDispatch } from '@wordpress/data';
6
6
  import { pencil } from '@wordpress/icons';
7
+ import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -15,13 +16,26 @@ import { store as editSiteStore } from '../../store';
15
16
  import SidebarButton from '../sidebar-button';
16
17
 
17
18
  export default function SidebarNavigationScreenTemplate() {
19
+ const { params } = useNavigator();
20
+ const { postType, postId } = params;
18
21
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
19
- const { getDescription, getTitle, record } = useEditedEntityRecord();
22
+ const { getDescription, getTitle, record } = useEditedEntityRecord(
23
+ postType,
24
+ postId
25
+ );
20
26
  let description = getDescription();
21
- if ( ! description && record.is_custom ) {
22
- description = __(
23
- 'This is a custom template that can be applied manually to any Post or Page.'
24
- );
27
+ if ( ! description ) {
28
+ if ( record.type === 'wp_template' && record.is_custom ) {
29
+ description = __(
30
+ 'This is a custom template that can be applied manually to any Post or Page.'
31
+ );
32
+ } else if ( record.type === 'wp_template_part' ) {
33
+ description = sprintf(
34
+ // translators: %s: template part title e.g: "Header".
35
+ __( 'This is your %s template part.' ),
36
+ getTitle()
37
+ );
38
+ }
25
39
  }
26
40
 
27
41
  return (
@@ -34,7 +48,7 @@ export default function SidebarNavigationScreenTemplate() {
34
48
  icon={ pencil }
35
49
  />
36
50
  }
37
- content={ description ? <p>{ description }</p> : undefined }
51
+ description={ description }
38
52
  />
39
53
  );
40
54
  }
@@ -29,6 +29,9 @@ const config = {
29
29
  loading: __( 'Loading templates' ),
30
30
  notFound: __( 'No templates found' ),
31
31
  manage: __( 'Manage all templates' ),
32
+ description: __(
33
+ 'Express the layout of your site with templates.'
34
+ ),
32
35
  },
33
36
  },
34
37
  wp_template_part: {
@@ -37,6 +40,9 @@ const config = {
37
40
  loading: __( 'Loading template parts' ),
38
41
  notFound: __( 'No template parts found' ),
39
42
  manage: __( 'Manage all template parts' ),
43
+ description: __(
44
+ 'Template Parts are small pieces of a layout that can be reused across multiple templates and always appear the same way. Common template parts include the site header, footer, or sidebar.'
45
+ ),
40
46
  },
41
47
  },
42
48
  };
@@ -80,6 +86,7 @@ export default function SidebarNavigationScreenTemplates() {
80
86
  <SidebarNavigationScreen
81
87
  isRoot={ isTemplatePartsMode }
82
88
  title={ config[ postType ].labels.title }
89
+ description={ config[ postType ].labels.description }
83
90
  actions={
84
91
  canCreate && (
85
92
  <AddNewTemplate
@@ -12,9 +12,15 @@ import SidebarNavigationScreen from '../sidebar-navigation-screen';
12
12
  const config = {
13
13
  wp_template: {
14
14
  title: __( 'All templates' ),
15
+ description: __(
16
+ 'Create new templates, or reset any customizations made to the templates supplied by your theme.'
17
+ ),
15
18
  },
16
19
  wp_template_part: {
17
20
  title: __( 'All template parts' ),
21
+ description: __(
22
+ 'Create new template parts, or reset any customisations made to the template parts supplied by your theme.'
23
+ ),
18
24
  },
19
25
  };
20
26
 
@@ -22,5 +28,10 @@ export default function SidebarNavigationScreenTemplatesBrowse() {
22
28
  const {
23
29
  params: { postType },
24
30
  } = useNavigator();
25
- return <SidebarNavigationScreen title={ config[ postType ].title } />;
31
+ return (
32
+ <SidebarNavigationScreen
33
+ title={ config[ postType ].title }
34
+ description={ config[ postType ].description }
35
+ />
36
+ );
26
37
  }
@@ -11,7 +11,7 @@
11
11
 
12
12
  .edit-site-site-hub__view-mode-toggle-container {
13
13
  height: $header-height;
14
- width: $header-height + 4px;
14
+ width: $header-height;
15
15
  flex-shrink: 0;
16
16
  background: $gray-900;
17
17
  }