@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.3.6",
3
+ "version": "5.3.8",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,33 +29,33 @@
29
29
  "@babel/runtime": "^7.16.0",
30
30
  "@wordpress/a11y": "^3.26.1",
31
31
  "@wordpress/api-fetch": "^6.23.1",
32
- "@wordpress/block-editor": "^11.3.6",
33
- "@wordpress/block-library": "^8.3.6",
32
+ "@wordpress/block-editor": "^11.3.8",
33
+ "@wordpress/block-library": "^8.3.8",
34
34
  "@wordpress/blocks": "^12.3.3",
35
- "@wordpress/components": "^23.3.5",
35
+ "@wordpress/components": "^23.3.6",
36
36
  "@wordpress/compose": "^6.3.3",
37
37
  "@wordpress/core-data": "^6.3.3",
38
38
  "@wordpress/data": "^8.3.3",
39
39
  "@wordpress/deprecated": "^3.26.1",
40
- "@wordpress/editor": "^13.3.6",
40
+ "@wordpress/editor": "^13.3.8",
41
41
  "@wordpress/element": "^5.3.2",
42
42
  "@wordpress/hooks": "^3.26.1",
43
43
  "@wordpress/html-entities": "^3.26.1",
44
44
  "@wordpress/i18n": "^4.26.1",
45
45
  "@wordpress/icons": "^9.17.2",
46
- "@wordpress/interface": "^5.3.6",
46
+ "@wordpress/interface": "^5.3.7",
47
47
  "@wordpress/keyboard-shortcuts": "^4.3.3",
48
48
  "@wordpress/keycodes": "^3.26.2",
49
49
  "@wordpress/media-utils": "^4.17.2",
50
50
  "@wordpress/notices": "^3.26.3",
51
51
  "@wordpress/plugins": "^5.3.3",
52
- "@wordpress/preferences": "^3.3.5",
52
+ "@wordpress/preferences": "^3.3.6",
53
53
  "@wordpress/private-apis": "^0.8.1",
54
- "@wordpress/reusable-blocks": "^4.3.6",
54
+ "@wordpress/reusable-blocks": "^4.3.8",
55
55
  "@wordpress/style-engine": "^1.9.1",
56
56
  "@wordpress/url": "^3.27.1",
57
57
  "@wordpress/viewport": "^5.3.3",
58
- "@wordpress/widgets": "^3.3.6",
58
+ "@wordpress/widgets": "^3.3.8",
59
59
  "classnames": "^2.3.1",
60
60
  "colord": "^2.9.2",
61
61
  "downloadjs": "^1.4.7",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "35f10c183655e9196d4ea12b8fa499a8ecbb7b6a"
76
+ "gitHead": "446428841b54f47e5373d6e9723ef7ec24cf11b3"
77
77
  }
@@ -7,7 +7,8 @@ import {
7
7
  DropdownMenu,
8
8
  MenuGroup,
9
9
  MenuItem,
10
- NavigableMenu,
10
+ Tooltip,
11
+ VisuallyHidden,
11
12
  } from '@wordpress/components';
12
13
  import { useState } from '@wordpress/element';
13
14
  import { useDispatch } from '@wordpress/data';
@@ -179,6 +180,11 @@ export default function NewTemplate( {
179
180
  if ( ! missingTemplates.length ) {
180
181
  return null;
181
182
  }
183
+
184
+ const customTemplateDescription = __(
185
+ 'A custom template can be manually applied to any post or page.'
186
+ );
187
+
182
188
  return (
183
189
  <>
184
190
  <DropdownMenu
@@ -196,7 +202,7 @@ export default function NewTemplate( {
196
202
  { isCreatingTemplate && (
197
203
  <TemplateActionsLoadingScreen />
198
204
  ) }
199
- <NavigableMenu className="edit-site-new-template-dropdown__popover">
205
+ <div className="edit-site-new-template-dropdown__menu-groups">
200
206
  <MenuGroup label={ postType.labels.add_new_item }>
201
207
  { missingTemplates.map( ( template ) => {
202
208
  const {
@@ -207,44 +213,63 @@ export default function NewTemplate( {
207
213
  icon,
208
214
  } = template;
209
215
  return (
210
- <MenuItem
211
- icon={
212
- icon ||
213
- TEMPLATE_ICONS[ slug ] ||
214
- post
215
- }
216
- iconPosition="left"
217
- info={ description }
216
+ <Tooltip
218
217
  key={ slug }
219
- onClick={ () =>
220
- onClick
221
- ? onClick( template )
222
- : createTemplate( template )
223
- }
218
+ position="top right"
219
+ text={ description }
220
+ className="edit-site-new-template-dropdown__menu-item-tooltip"
224
221
  >
225
- { title }
226
- </MenuItem>
222
+ <MenuItem
223
+ icon={
224
+ icon ||
225
+ TEMPLATE_ICONS[ slug ] ||
226
+ post
227
+ }
228
+ iconPosition="left"
229
+ onClick={ () =>
230
+ onClick
231
+ ? onClick( template )
232
+ : createTemplate(
233
+ template
234
+ )
235
+ }
236
+ >
237
+ { title }
238
+ { /* TODO: This probably won't be needed if the <Tooltip> component is accessible.
239
+ * @see https://github.com/WordPress/gutenberg/issues/48222 */ }
240
+ <VisuallyHidden>
241
+ { description }
242
+ </VisuallyHidden>
243
+ </MenuItem>
244
+ </Tooltip>
227
245
  );
228
246
  } ) }
229
247
  </MenuGroup>
230
248
  <MenuGroup>
231
- <MenuItem
232
- icon={ customGenericTemplateIcon }
233
- iconPosition="left"
234
- info={ __(
235
- 'Custom templates can be applied to any post or page.'
236
- ) }
237
- key="custom-template"
238
- onClick={ () =>
239
- setShowCustomGenericTemplateModal(
240
- true
241
- )
242
- }
249
+ <Tooltip
250
+ position="top right"
251
+ text={ customTemplateDescription }
252
+ className="edit-site-new-template-dropdown__menu-item-tooltip"
243
253
  >
244
- { __( 'Custom template' ) }
245
- </MenuItem>
254
+ <MenuItem
255
+ icon={ customGenericTemplateIcon }
256
+ iconPosition="left"
257
+ onClick={ () =>
258
+ setShowCustomGenericTemplateModal(
259
+ true
260
+ )
261
+ }
262
+ >
263
+ { __( 'Custom template' ) }
264
+ { /* TODO: This probably won't be needed if the <Tooltip> component is accessible.
265
+ * @see https://github.com/WordPress/gutenberg/issues/48222 */ }
266
+ <VisuallyHidden>
267
+ { customTemplateDescription }
268
+ </VisuallyHidden>
269
+ </MenuItem>
270
+ </Tooltip>
246
271
  </MenuGroup>
247
- </NavigableMenu>
272
+ </div>
248
273
  </>
249
274
  ) }
250
275
  </DropdownMenu>
@@ -1,9 +1,20 @@
1
1
  .edit-site-new-template-dropdown {
2
- .edit-site-new-template-dropdown__popover {
2
+ .edit-site-new-template-dropdown__menu-groups {
3
3
  @include break-small() {
4
4
  min-width: 300px;
5
5
  }
6
6
  }
7
+
8
+ // The specificity is needed to override the default tooltip styles.
9
+ &__menu-item-tooltip.components-tooltip .components-popover__content {
10
+ max-width: 320px;
11
+ padding: $grid-unit-10 $grid-unit-15;
12
+ border-radius: 2px;
13
+ white-space: pre-wrap;
14
+ min-width: 0;
15
+ width: auto;
16
+ text-align: left;
17
+ }
7
18
  }
8
19
 
9
20
  .edit-site-custom-template-modal {
@@ -43,7 +43,8 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
43
43
  // Forming a "block formatting context" to prevent margin collapsing.
44
44
  // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
45
45
  `.is-root-container { display: flow-root; }
46
- body { position: relative; }`
46
+ body { position: relative;
47
+ ${ canvasMode === 'view' ? 'cursor: pointer;' : '' }}}`
47
48
  }</style>
48
49
  { enableResizing && (
49
50
  <style>
@@ -277,6 +277,20 @@ export default function Layout() {
277
277
  { canvasResizer }
278
278
  { !! canvasSize.width && (
279
279
  <motion.div
280
+ whileHover={
281
+ isEditorPage && canvasMode === 'view'
282
+ ? {
283
+ scale: 1.01,
284
+ transition: {
285
+ duration:
286
+ disableMotion ||
287
+ isResizing
288
+ ? 0
289
+ : 0.2,
290
+ },
291
+ }
292
+ : {}
293
+ }
280
294
  initial={ false }
281
295
  layout="position"
282
296
  className="edit-site-layout__canvas"
@@ -49,11 +49,9 @@
49
49
  }
50
50
 
51
51
  .edit-site-layout__content {
52
+ height: 100%;
52
53
  flex-grow: 1;
53
54
  display: flex;
54
-
55
- // Hide scrollbars during the edit/view animation.
56
- overflow: hidden;
57
55
  }
58
56
 
59
57
  .edit-site-layout__sidebar {
@@ -19,8 +19,10 @@ import useTitle from '../routes/use-title';
19
19
 
20
20
  export default function List() {
21
21
  const {
22
- params: { postType: templateType },
22
+ params: { path },
23
23
  } = useLocation();
24
+ const templateType =
25
+ path === '/wp_template/all' ? 'wp_template' : 'wp_template_part';
24
26
 
25
27
  useRegisterShortcuts();
26
28
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { addQueryArgs } from '@wordpress/url';
4
+ import { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -21,8 +21,15 @@ export function useLink( params = {}, state, shouldReplace = false ) {
21
21
  }
22
22
  }
23
23
 
24
+ const currentArgs = getQueryArgs( window.location.href );
25
+ const currentUrlWithoutArgs = removeQueryArgs(
26
+ window.location.href,
27
+ ...Object.keys( currentArgs )
28
+ );
29
+ const newUrl = addQueryArgs( currentUrlWithoutArgs, params );
30
+
24
31
  return {
25
- href: addQueryArgs( window.location.href, params ),
32
+ href: newUrl,
26
33
  onClick,
27
34
  };
28
35
  }
@@ -12,7 +12,7 @@ import { displayShortcut } from '@wordpress/keycodes';
12
12
  */
13
13
  import { store as editSiteStore } from '../../store';
14
14
 
15
- export default function SaveButton( { showTooltip = true } ) {
15
+ export default function SaveButton() {
16
16
  const { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {
17
17
  const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =
18
18
  select( coreStore );
@@ -52,7 +52,7 @@ export default function SaveButton( { showTooltip = true } ) {
52
52
  * of the button that we want to avoid. By setting `showTooltip`,
53
53
  & the tooltip is always rendered even when there's no keyboard shortcut.
54
54
  */
55
- showTooltip={ showTooltip }
55
+ showTooltip
56
56
  >
57
57
  { label }
58
58
  </Button>
@@ -0,0 +1,78 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { Button, __experimentalHStack as HStack } from '@wordpress/components';
6
+ import { sprintf, __, _n } from '@wordpress/i18n';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+ import { displayShortcut } from '@wordpress/keycodes';
9
+ import { check } from '@wordpress/icons';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import { store as editSiteStore } from '../../store';
15
+
16
+ export default function SaveButton() {
17
+ const { countUnsavedChanges, isDirty, isSaving, isSaveViewOpen } =
18
+ useSelect( ( select ) => {
19
+ const {
20
+ __experimentalGetDirtyEntityRecords,
21
+ isSavingEntityRecord,
22
+ } = select( coreStore );
23
+ const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
24
+ const { isSaveViewOpened } = select( editSiteStore );
25
+ return {
26
+ isDirty: dirtyEntityRecords.length > 0,
27
+ isSaving: dirtyEntityRecords.some( ( record ) =>
28
+ isSavingEntityRecord( record.kind, record.name, record.key )
29
+ ),
30
+ isSaveViewOpen: isSaveViewOpened(),
31
+ countUnsavedChanges: dirtyEntityRecords.length,
32
+ };
33
+ }, [] );
34
+ const { setIsSaveViewOpened } = useDispatch( editSiteStore );
35
+
36
+ const disabled = ! isDirty || isSaving;
37
+
38
+ const label = disabled ? __( 'Saved' ) : __( 'Save' );
39
+
40
+ return (
41
+ <HStack className="edit-site-save-hub" alignment="right" spacing={ 4 }>
42
+ { isDirty && (
43
+ <span>
44
+ { sprintf(
45
+ // translators: %d: number of unsaved changes (number).
46
+ _n(
47
+ '%d unsaved change',
48
+ '%d unsaved changes',
49
+ countUnsavedChanges
50
+ ),
51
+ countUnsavedChanges
52
+ ) }
53
+ </span>
54
+ ) }
55
+ <Button
56
+ className="edit-site-save-hub__button"
57
+ variant={ disabled ? undefined : 'primary' }
58
+ aria-disabled={ disabled }
59
+ aria-expanded={ isSaveViewOpen }
60
+ isBusy={ isSaving }
61
+ onClick={
62
+ disabled ? undefined : () => setIsSaveViewOpened( true )
63
+ }
64
+ label={ label }
65
+ /*
66
+ * We want the tooltip to show the keyboard shortcut only when the
67
+ * button does something, i.e. when it's not disabled.
68
+ */
69
+ shortcut={
70
+ disabled ? undefined : displayShortcut.primary( 's' )
71
+ }
72
+ icon={ disabled ? check : undefined }
73
+ >
74
+ { label }
75
+ </Button>
76
+ </HStack>
77
+ );
78
+ }
@@ -0,0 +1,15 @@
1
+ .edit-site-save-hub {
2
+ color: $gray-600;
3
+ }
4
+
5
+ .edit-site-save-hub__button {
6
+ color: inherit;
7
+
8
+ &[aria-disabled="true"] {
9
+ opacity: 1;
10
+ }
11
+
12
+ &[aria-disabled="true"]:hover {
13
+ color: inherit;
14
+ }
15
+ }
@@ -18,7 +18,7 @@ import useSyncPathWithURL, {
18
18
  } from '../sync-state-with-url/use-sync-path-with-url';
19
19
  import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
20
20
  import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
21
- import SaveButton from '../save-button';
21
+ import SaveHub from '../save-hub';
22
22
  import SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';
23
23
  import { useLocation } from '../routes';
24
24
 
@@ -61,9 +61,8 @@ function Sidebar() {
61
61
  >
62
62
  <SidebarScreens />
63
63
  </NavigatorProvider>
64
-
65
64
  <div className="edit-site-sidebar__footer">
66
- <SaveButton showTooltip={ false } />
65
+ <SaveHub />
67
66
  </div>
68
67
  </>
69
68
  );
@@ -1,7 +1,10 @@
1
1
  .edit-site-sidebar__content {
2
2
  flex-grow: 1;
3
3
  overflow-y: auto;
4
- @include custom-scrollbars-on-hover;
4
+
5
+ .components-navigator-screen {
6
+ @include custom-scrollbars-on-hover;
7
+ }
5
8
  }
6
9
 
7
10
  .edit-site-sidebar__footer {
@@ -9,8 +12,6 @@
9
12
  flex-shrink: 0;
10
13
  margin: 0 $canvas-padding;
11
14
  padding: $canvas-padding 0;
12
- display: flex;
13
- justify-content: flex-end;
14
15
  }
15
16
 
16
17
  .edit-site-sidebar__content.edit-site-sidebar__content {
@@ -17,7 +17,8 @@
17
17
  &:hover,
18
18
  &:focus-visible,
19
19
  &:focus,
20
- &:not([aria-disabled="true"]):active {
20
+ &:not([aria-disabled="true"]):active,
21
+ &[aria-expanded="true"] {
21
22
  color: $white;
22
23
  }
23
24
  }
@@ -15,26 +15,6 @@
15
15
  }
16
16
  }
17
17
 
18
- .edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button {
19
- color: $gray-600;
20
- &:hover,
21
- &:focus,
22
- &[aria-current] {
23
- color: $white;
24
- }
25
- }
26
-
27
- .edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf {
28
- &:hover,
29
- &:focus,
30
- &[aria-current] {
31
- background: $gray-800;
32
- }
33
- .block-editor-list-view-block__menu {
34
- margin-left: -$grid-unit-10;
35
- }
36
- }
37
-
38
18
  .edit-site-sidebar-navigation-screen__content .block-editor-list-view-block-select-button {
39
19
  cursor: grab;
40
20
  width: calc(100% - #{ $border-width-focus });
@@ -22,6 +22,7 @@ export default function SidebarNavigationScreen( {
22
22
  title,
23
23
  actions,
24
24
  content,
25
+ description,
25
26
  } ) {
26
27
  const { dashboardLink } = useSelect( ( select ) => {
27
28
  const { getSettings } = unlock( select( editSiteStore ) );
@@ -58,6 +59,11 @@ export default function SidebarNavigationScreen( {
58
59
  </HStack>
59
60
 
60
61
  <nav className="edit-site-sidebar-navigation-screen__content">
62
+ { description && (
63
+ <p className="edit-site-sidebar-navigation-screen__description">
64
+ { description }
65
+ </p>
66
+ ) }
61
67
  { content }
62
68
  </nav>
63
69
  </VStack>
@@ -10,6 +10,21 @@
10
10
  color: $gray-600;
11
11
  }
12
12
 
13
+ .edit-site-sidebar-navigation-screen__page-link {
14
+ color: $gray-600;
15
+
16
+ &:hover,
17
+ &:focus {
18
+ color: $white;
19
+ }
20
+
21
+ .components-external-link__icon {
22
+ margin-left: $grid-unit-05;
23
+ }
24
+ margin-left: $grid-unit-20;
25
+ display: inline-block;
26
+ }
27
+
13
28
  .edit-site-sidebar-navigation-screen__title-icon {
14
29
  position: sticky;
15
30
  top: 0;
@@ -31,6 +31,9 @@ export default function SidebarNavigationScreenMain() {
31
31
  <SidebarNavigationScreen
32
32
  isRoot
33
33
  title={ __( 'Design' ) }
34
+ description={ __(
35
+ 'Customize the appearance of your website using the block editor.'
36
+ ) }
34
37
  content={
35
38
  <ItemGroup>
36
39
  { !! navigationMenus && navigationMenus.length > 0 && (
@@ -2,9 +2,12 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { useDispatch, useSelect } from '@wordpress/data';
6
- import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
7
- import { store as coreStore } from '@wordpress/core-data';
5
+ import { useDispatch } from '@wordpress/data';
6
+ import {
7
+ __experimentalUseNavigator as useNavigator,
8
+ ExternalLink,
9
+ } from '@wordpress/components';
10
+ import { useEntityRecord } from '@wordpress/core-data';
8
11
  import { decodeEntities } from '@wordpress/html-entities';
9
12
  import { pencil } from '@wordpress/icons';
10
13
 
@@ -21,26 +24,11 @@ export default function SidebarNavigationScreenNavigationItem() {
21
24
  const {
22
25
  params: { postType, postId },
23
26
  } = useNavigator();
24
-
25
- const { post } = useSelect(
26
- ( select ) => {
27
- const { getEntityRecord } = select( coreStore );
28
-
29
- // The currently selected entity to display.
30
- // Typically template or template part in the site editor.
31
- return {
32
- post:
33
- postId && postType
34
- ? getEntityRecord( 'postType', postType, postId )
35
- : null,
36
- };
37
- },
38
- [ postType, postId ]
39
- );
27
+ const { record } = useEntityRecord( 'postType', postType, postId );
40
28
 
41
29
  return (
42
30
  <SidebarNavigationScreen
43
- title={ post ? decodeEntities( post?.title?.rendered ) : null }
31
+ title={ record ? decodeEntities( record?.title?.rendered ) : null }
44
32
  actions={
45
33
  <SidebarButton
46
34
  onClick={ () => setCanvasMode( 'edit' ) }
@@ -48,8 +36,29 @@ export default function SidebarNavigationScreenNavigationItem() {
48
36
  icon={ pencil }
49
37
  />
50
38
  }
39
+ description={
40
+ postType === 'page'
41
+ ? __(
42
+ 'Pages are static and are not listed by date. Pages do not use tags or categories.'
43
+ )
44
+ : __(
45
+ 'Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'
46
+ )
47
+ }
51
48
  content={
52
- post ? decodeEntities( post?.description?.rendered ) : null
49
+ <>
50
+ { record?.link ? (
51
+ <ExternalLink
52
+ className="edit-site-sidebar-navigation-screen__page-link"
53
+ href={ record.link }
54
+ >
55
+ { record.link }
56
+ </ExternalLink>
57
+ ) : null }
58
+ { record
59
+ ? decodeEntities( record?.description?.rendered )
60
+ : null }
61
+ </>
53
62
  }
54
63
  />
55
64
  );