@wordpress/edit-site 6.50.0 → 7.0.0

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 (85) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/components/add-new-template/add-custom-template-modal-content.cjs +3 -3
  3. package/build/components/add-new-template/add-custom-template-modal-content.cjs.map +2 -2
  4. package/build/components/add-new-template/index.cjs +1 -1
  5. package/build/components/add-new-template/index.cjs.map +2 -2
  6. package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs +3 -3
  7. package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs.map +2 -2
  8. package/build/components/add-new-template-legacy/index.cjs +1 -1
  9. package/build/components/add-new-template-legacy/index.cjs.map +2 -2
  10. package/build/components/editor/index.cjs +22 -97
  11. package/build/components/editor/index.cjs.map +3 -3
  12. package/build/components/layout/index.cjs +12 -15
  13. package/build/components/layout/index.cjs.map +3 -3
  14. package/build/components/page-patterns/fields.cjs +0 -36
  15. package/build/components/page-patterns/fields.cjs.map +2 -2
  16. package/build/components/page-patterns/index.cjs +4 -15
  17. package/build/components/page-patterns/index.cjs.map +2 -2
  18. package/build/components/save-panel/index.cjs +1 -2
  19. package/build/components/save-panel/index.cjs.map +2 -2
  20. package/build/components/site-editor-routes/styles.cjs +4 -3
  21. package/build/components/site-editor-routes/styles.cjs.map +2 -2
  22. package/build/components/site-hub/index.cjs +13 -176
  23. package/build/components/site-hub/index.cjs.map +3 -3
  24. package/build/index.cjs +3 -1
  25. package/build/index.cjs.map +2 -2
  26. package/build-module/components/add-new-template/add-custom-template-modal-content.mjs +3 -3
  27. package/build-module/components/add-new-template/add-custom-template-modal-content.mjs.map +2 -2
  28. package/build-module/components/add-new-template/index.mjs +1 -1
  29. package/build-module/components/add-new-template/index.mjs.map +2 -2
  30. package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs +3 -3
  31. package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs.map +2 -2
  32. package/build-module/components/add-new-template-legacy/index.mjs +1 -1
  33. package/build-module/components/add-new-template-legacy/index.mjs.map +2 -2
  34. package/build-module/components/editor/index.mjs +25 -100
  35. package/build-module/components/editor/index.mjs.map +2 -2
  36. package/build-module/components/layout/index.mjs +12 -15
  37. package/build-module/components/layout/index.mjs.map +2 -2
  38. package/build-module/components/page-patterns/fields.mjs +2 -41
  39. package/build-module/components/page-patterns/fields.mjs.map +2 -2
  40. package/build-module/components/page-patterns/index.mjs +5 -16
  41. package/build-module/components/page-patterns/index.mjs.map +2 -2
  42. package/build-module/components/save-panel/index.mjs +1 -2
  43. package/build-module/components/save-panel/index.mjs.map +2 -2
  44. package/build-module/components/site-editor-routes/styles.mjs +4 -3
  45. package/build-module/components/site-editor-routes/styles.mjs.map +2 -2
  46. package/build-module/components/site-hub/index.mjs +17 -170
  47. package/build-module/components/site-hub/index.mjs.map +2 -2
  48. package/build-module/index.mjs +3 -1
  49. package/build-module/index.mjs.map +2 -2
  50. package/build-style/style-rtl.css +110 -330
  51. package/build-style/style.css +110 -330
  52. package/package.json +52 -52
  53. package/src/components/add-new-template/add-custom-template-modal-content.js +3 -3
  54. package/src/components/add-new-template/index.js +1 -1
  55. package/src/components/add-new-template-legacy/add-custom-template-modal-content.js +3 -3
  56. package/src/components/add-new-template-legacy/index.js +1 -1
  57. package/src/components/editor/index.js +31 -122
  58. package/src/components/editor/style.scss +0 -62
  59. package/src/components/layout/index.js +13 -18
  60. package/src/components/layout/style.scss +5 -62
  61. package/src/components/page-patterns/fields.js +2 -50
  62. package/src/components/page-patterns/index.js +5 -23
  63. package/src/components/page-patterns/style.scss +1 -1
  64. package/src/components/save-panel/index.js +1 -2
  65. package/src/components/sidebar/style.scss +2 -0
  66. package/src/components/sidebar-button/style.scss +1 -9
  67. package/src/components/sidebar-global-styles/style.scss +7 -4
  68. package/src/components/sidebar-navigation-item/style.scss +8 -4
  69. package/src/components/sidebar-navigation-screen/style.scss +1 -1
  70. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +2 -2
  71. package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
  72. package/src/components/site-editor-routes/styles.js +5 -2
  73. package/src/components/site-hub/index.js +12 -170
  74. package/src/components/site-hub/style.scss +5 -82
  75. package/src/index.js +3 -1
  76. package/src/style.scss +16 -11
  77. package/build/components/site-icon/index.cjs +0 -73
  78. package/build/components/site-icon/index.cjs.map +0 -7
  79. package/build-module/components/site-icon/index.mjs +0 -42
  80. package/build-module/components/site-icon/index.mjs.map +0 -7
  81. package/build-style/experimental-omnibar-rtl.css +0 -103
  82. package/build-style/experimental-omnibar.css +0 -103
  83. package/src/components/site-icon/index.js +0 -51
  84. package/src/components/site-icon/style.scss +0 -41
  85. package/src/experimental-omnibar.scss +0 -75
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "6.50.0",
3
+ "version": "7.0.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -20,8 +20,8 @@
20
20
  "url": "https://github.com/WordPress/gutenberg/issues"
21
21
  },
22
22
  "engines": {
23
- "node": ">=18.12.0",
24
- "npm": ">=8.19.2"
23
+ "node": "^20.19.0 || >=22.13.0",
24
+ "npm": ">=10.2.3"
25
25
  },
26
26
  "files": [
27
27
  "src",
@@ -47,52 +47,52 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@react-spring/web": "^9.4.5",
50
- "@wordpress/a11y": "^4.50.0",
51
- "@wordpress/admin-ui": "^2.5.0",
52
- "@wordpress/api-fetch": "^7.50.0",
53
- "@wordpress/base-styles": "^10.2.0",
54
- "@wordpress/blob": "^4.50.0",
55
- "@wordpress/block-editor": "^15.23.0",
56
- "@wordpress/block-library": "^10.1.0",
57
- "@wordpress/blocks": "^15.23.0",
58
- "@wordpress/commands": "^1.50.0",
59
- "@wordpress/components": "^36.1.0",
60
- "@wordpress/compose": "^8.3.0",
61
- "@wordpress/core-data": "^7.50.0",
62
- "@wordpress/data": "^10.50.0",
63
- "@wordpress/dataviews": "^17.1.0",
64
- "@wordpress/date": "^5.50.0",
65
- "@wordpress/deprecated": "^4.50.0",
66
- "@wordpress/dom": "^4.50.0",
67
- "@wordpress/editor": "^14.50.0",
68
- "@wordpress/element": "^8.2.0",
69
- "@wordpress/escape-html": "^3.50.0",
70
- "@wordpress/fields": "^0.42.0",
71
- "@wordpress/global-styles-engine": "^1.17.0",
72
- "@wordpress/global-styles-ui": "^1.17.0",
73
- "@wordpress/hooks": "^4.50.0",
74
- "@wordpress/html-entities": "^4.50.0",
75
- "@wordpress/i18n": "^6.23.0",
76
- "@wordpress/icons": "^15.1.0",
77
- "@wordpress/keyboard-shortcuts": "^5.50.0",
78
- "@wordpress/keycodes": "^4.50.0",
79
- "@wordpress/media-utils": "^5.50.0",
80
- "@wordpress/notices": "^5.50.0",
81
- "@wordpress/patterns": "^2.50.0",
82
- "@wordpress/plugins": "^7.50.0",
83
- "@wordpress/preferences": "^4.50.0",
84
- "@wordpress/primitives": "^4.50.0",
85
- "@wordpress/private-apis": "^1.50.0",
86
- "@wordpress/reusable-blocks": "^5.50.0",
87
- "@wordpress/router": "^1.50.0",
88
- "@wordpress/style-engine": "^2.50.0",
89
- "@wordpress/theme": "^0.17.0",
90
- "@wordpress/ui": "^0.17.0",
91
- "@wordpress/url": "^4.50.0",
92
- "@wordpress/viewport": "^6.50.0",
93
- "@wordpress/views": "^1.17.0",
94
- "@wordpress/widgets": "^4.50.0",
95
- "@wordpress/wordcount": "^4.50.0",
50
+ "@wordpress/a11y": "^4.51.0",
51
+ "@wordpress/admin-ui": "^2.6.0",
52
+ "@wordpress/api-fetch": "^7.51.0",
53
+ "@wordpress/base-styles": "^11.0.0",
54
+ "@wordpress/blob": "^4.51.0",
55
+ "@wordpress/block-editor": "^16.0.0",
56
+ "@wordpress/block-library": "^10.2.0",
57
+ "@wordpress/blocks": "^15.24.0",
58
+ "@wordpress/commands": "^1.51.0",
59
+ "@wordpress/components": "^37.0.0",
60
+ "@wordpress/compose": "^8.4.0",
61
+ "@wordpress/core-data": "^7.51.0",
62
+ "@wordpress/data": "^10.51.0",
63
+ "@wordpress/dataviews": "^17.2.0",
64
+ "@wordpress/date": "^5.51.0",
65
+ "@wordpress/deprecated": "^4.51.0",
66
+ "@wordpress/dom": "^4.51.0",
67
+ "@wordpress/editor": "^14.51.0",
68
+ "@wordpress/element": "^8.3.0",
69
+ "@wordpress/escape-html": "^3.51.0",
70
+ "@wordpress/fields": "^0.43.0",
71
+ "@wordpress/global-styles-engine": "^1.18.0",
72
+ "@wordpress/global-styles-ui": "^1.18.0",
73
+ "@wordpress/hooks": "^4.51.0",
74
+ "@wordpress/html-entities": "^4.51.0",
75
+ "@wordpress/i18n": "^6.24.0",
76
+ "@wordpress/icons": "^15.2.0",
77
+ "@wordpress/keyboard-shortcuts": "^5.51.0",
78
+ "@wordpress/keycodes": "^4.51.0",
79
+ "@wordpress/media-utils": "^5.51.0",
80
+ "@wordpress/notices": "^5.51.0",
81
+ "@wordpress/patterns": "^2.51.0",
82
+ "@wordpress/plugins": "^7.51.0",
83
+ "@wordpress/preferences": "^4.51.0",
84
+ "@wordpress/primitives": "^4.51.0",
85
+ "@wordpress/private-apis": "^1.51.0",
86
+ "@wordpress/reusable-blocks": "^5.51.0",
87
+ "@wordpress/router": "^1.51.0",
88
+ "@wordpress/style-engine": "^2.51.0",
89
+ "@wordpress/theme": "^1.0.0",
90
+ "@wordpress/ui": "^0.18.0",
91
+ "@wordpress/url": "^4.51.0",
92
+ "@wordpress/viewport": "^6.51.0",
93
+ "@wordpress/views": "^1.18.0",
94
+ "@wordpress/widgets": "^4.51.0",
95
+ "@wordpress/wordcount": "^4.51.0",
96
96
  "change-case": "^4.1.2",
97
97
  "clsx": "^2.1.1",
98
98
  "colord": "^2.9.3",
@@ -101,11 +101,11 @@
101
101
  "react-autosize-textarea": "^7.1.0"
102
102
  },
103
103
  "peerDependencies": {
104
- "react": "^18.0.0",
105
- "react-dom": "^18.0.0"
104
+ "react": "^18 || ^19",
105
+ "react-dom": "^18 || ^19"
106
106
  },
107
107
  "publishConfig": {
108
108
  "access": "public"
109
109
  },
110
- "gitHead": "fee6e24e8e63d36f6bbcf487c193461e9bd79753"
110
+ "gitHead": "e9a74f9c14095a34398ecd4d1f7a908e55051205"
111
111
  }
@@ -54,7 +54,7 @@ function SuggestionListItem( {
54
54
  <WCText
55
55
  size="body"
56
56
  lineHeight={ 1.53846153846 } // 20px
57
- weight={ 500 }
57
+ weight="var(--wpds-typography-font-weight-emphasis)"
58
58
  className={ `${ baseCssClass }__title` }
59
59
  >
60
60
  <TextHighlight
@@ -223,7 +223,7 @@ function AddCustomTemplateModalContent( {
223
223
  >
224
224
  <WCText
225
225
  as="span"
226
- weight={ 500 }
226
+ weight="var(--wpds-typography-font-weight-emphasis)"
227
227
  lineHeight={ 1.53846153846 } // 20px
228
228
  >
229
229
  { entityForSuggestions.labels.all_items }
@@ -247,7 +247,7 @@ function AddCustomTemplateModalContent( {
247
247
  >
248
248
  <WCText
249
249
  as="span"
250
- weight={ 500 }
250
+ weight="var(--wpds-typography-font-weight-emphasis)"
251
251
  lineHeight={ 1.53846153846 } // 20px
252
252
  >
253
253
  { entityForSuggestions.labels.singular_name }
@@ -131,7 +131,7 @@ function TemplateListItem( {
131
131
  >
132
132
  <WCText
133
133
  align="center"
134
- weight={ 500 }
134
+ weight="var(--wpds-typography-font-weight-emphasis)"
135
135
  lineHeight={ 1.53846153846 } // 20px
136
136
  >
137
137
  { title }
@@ -54,7 +54,7 @@ function SuggestionListItem( {
54
54
  <WCText
55
55
  size="body"
56
56
  lineHeight={ 1.53846153846 } // 20px
57
- weight={ 500 }
57
+ weight="var(--wpds-typography-font-weight-emphasis)"
58
58
  className={ `${ baseCssClass }__title` }
59
59
  >
60
60
  <TextHighlight
@@ -225,7 +225,7 @@ function AddCustomTemplateModalContent( {
225
225
  >
226
226
  <WCText
227
227
  as="span"
228
- weight={ 500 }
228
+ weight="var(--wpds-typography-font-weight-emphasis)"
229
229
  lineHeight={ 1.53846153846 } // 20px
230
230
  >
231
231
  { entityForSuggestions.labels.all_items }
@@ -249,7 +249,7 @@ function AddCustomTemplateModalContent( {
249
249
  >
250
250
  <WCText
251
251
  as="span"
252
- weight={ 500 }
252
+ weight="var(--wpds-typography-font-weight-emphasis)"
253
253
  lineHeight={ 1.53846153846 } // 20px
254
254
  >
255
255
  { entityForSuggestions.labels.singular_name }
@@ -132,7 +132,7 @@ function TemplateListItem( {
132
132
  >
133
133
  <WCText
134
134
  align="center"
135
- weight={ 500 }
135
+ weight="var(--wpds-typography-font-weight-emphasis)"
136
136
  lineHeight={ 1.53846153846 } // 20px
137
137
  >
138
138
  { title }
@@ -1,14 +1,9 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
4
  import { useDispatch, useSelect } from '@wordpress/data';
10
- import { Button, __unstableMotion as motion } from '@wordpress/components';
11
- import { useInstanceId, useReducedMotion } from '@wordpress/compose';
5
+ import { Button } from '@wordpress/components';
6
+ import { useInstanceId } from '@wordpress/compose';
12
7
  import {
13
8
  EditorKeyboardShortcutsRegister,
14
9
  privateApis as editorPrivateApis,
@@ -21,7 +16,7 @@ import { useCallback } from '@wordpress/element';
21
16
  import { store as noticesStore } from '@wordpress/notices';
22
17
  import { privateApis as routerPrivateApis } from '@wordpress/router';
23
18
  import { decodeEntities } from '@wordpress/html-entities';
24
- import { Icon, arrowUpLeft, arrowUpRight } from '@wordpress/icons';
19
+ import { chevronLeft, chevronRight } from '@wordpress/icons';
25
20
  import { store as blockEditorStore } from '@wordpress/block-editor';
26
21
  import { addQueryArgs } from '@wordpress/url';
27
22
 
@@ -37,7 +32,6 @@ import { isPreviewingTheme } from '../../utils/is-previewing-theme';
37
32
  import SaveButton from '../save-button';
38
33
  import SavePanel from '../save-panel';
39
34
  import SiteEditorMoreMenu from '../more-menu';
40
- import SiteIcon from '../site-icon';
41
35
  import useEditorIframeProps from '../block-editor/use-editor-iframe-props';
42
36
  import { ViewportSync } from '../block-editor/use-viewport-sync';
43
37
  import useEditorTitle from './use-editor-title';
@@ -53,30 +47,6 @@ const { Editor, BackButton } = unlock( editorPrivateApis );
53
47
  const { useHistory, useLocation } = unlock( routerPrivateApis );
54
48
  const { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );
55
49
 
56
- const toggleHomeIconVariants = {
57
- edit: {
58
- opacity: 0,
59
- scale: 0.2,
60
- },
61
- hover: {
62
- opacity: 1,
63
- scale: 1,
64
- clipPath: 'inset( 22% round 2px )',
65
- },
66
- };
67
-
68
- const siteIconVariants = {
69
- edit: {
70
- clipPath: 'inset(0% round 0px)',
71
- },
72
- hover: {
73
- clipPath: 'inset( 22% round 2px )',
74
- },
75
- tap: {
76
- clipPath: 'inset(0% round 0px)',
77
- },
78
- };
79
-
80
50
  function getListPathForPostType( postType ) {
81
51
  switch ( postType ) {
82
52
  case 'navigation':
@@ -113,7 +83,6 @@ function getNavigationPath( location, postType ) {
113
83
  }
114
84
 
115
85
  export default function EditSiteEditor( { isHomeRoute = false } ) {
116
- const disableMotion = useReducedMotion();
117
86
  const location = useLocation();
118
87
  const history = useHistory();
119
88
  const { canvas = 'view' } = location.query;
@@ -123,15 +92,10 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
123
92
  // deprecated sync state with url
124
93
  useSyncDeprecatedEntityIntoState( entity );
125
94
  const { postType, postId, context } = entity;
126
- const { isBlockBasedTheme, hasSiteIcon } = useSelect( ( select ) => {
127
- const { getCurrentTheme, getEntityRecord } = select( coreDataStore );
128
- const siteData = getEntityRecord( 'root', '__unstableBase', undefined );
129
-
130
- return {
131
- isBlockBasedTheme: getCurrentTheme()?.is_block_theme,
132
- hasSiteIcon: !! siteData?.site_icon_url,
133
- };
134
- }, [] );
95
+ const isBlockBasedTheme = useSelect(
96
+ ( select ) => select( coreDataStore ).getCurrentTheme()?.is_block_theme,
97
+ []
98
+ );
135
99
  const postWithTemplate = !! context?.postId;
136
100
  useEditorTitle(
137
101
  postWithTemplate ? context.postType : postType,
@@ -204,11 +168,6 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
204
168
  );
205
169
 
206
170
  const isReady = ! isLoading;
207
- const transition = {
208
- duration: disableMotion ? 0 : 0.2,
209
- };
210
-
211
- const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
212
171
 
213
172
  return ! isBlockBasedTheme && isHomeRoute ? (
214
173
  <SitePreview />
@@ -246,81 +205,31 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
246
205
  <BackButton>
247
206
  { ( { length } ) =>
248
207
  length <= 1 && (
249
- <motion.div
250
- className="edit-site-editor__view-mode-toggle"
251
- transition={ transition }
252
- animate="edit"
253
- initial="edit"
254
- whileHover="hover"
255
- whileTap="tap"
256
- >
257
- <Button
258
- __next40pxDefaultSize
259
- label={ __( 'Open Navigation' ) }
260
- showTooltip
261
- tooltipPosition="middle right"
262
- onClick={ () => {
263
- resetZoomLevel();
264
- setCurrentRevisionId( null );
265
- history.navigate(
266
- getNavigationPath(
267
- location,
268
- postWithTemplate
269
- ? context.postType
270
- : postType
271
- ),
272
- {
273
- transition:
274
- 'canvas-mode-view-transition',
275
- }
276
- );
277
- } }
278
- >
279
- { ! hasAdminBarInEditor && (
280
- <motion.div
281
- variants={
282
- ! disableMotion &&
283
- siteIconVariants
284
- }
285
- >
286
- <SiteIcon className="edit-site-editor__view-mode-toggle-icon" />
287
- </motion.div>
288
- ) }
289
- </Button>
290
- { hasAdminBarInEditor ? (
291
- <div className="edit-site-editor__back-icon">
292
- <Icon
293
- icon={
294
- isRTL()
295
- ? arrowUpRight
296
- : arrowUpLeft
297
- }
298
- />
299
- </div>
300
- ) : (
301
- <motion.div
302
- className={ clsx(
303
- 'edit-site-editor__back-icon',
304
- {
305
- 'has-site-icon':
306
- hasSiteIcon,
307
- }
308
- ) }
309
- variants={
310
- ! disableMotion &&
311
- toggleHomeIconVariants
208
+ <Button
209
+ size="compact"
210
+ label={ __( 'Open Navigation' ) }
211
+ showTooltip
212
+ tooltipPosition="middle right"
213
+ onClick={ () => {
214
+ resetZoomLevel();
215
+ setCurrentRevisionId( null );
216
+ history.navigate(
217
+ getNavigationPath(
218
+ location,
219
+ postWithTemplate
220
+ ? context.postType
221
+ : postType
222
+ ),
223
+ {
224
+ transition:
225
+ 'canvas-mode-view-transition',
312
226
  }
313
- >
314
- <Icon
315
- icon={
316
- isRTL()
317
- ? arrowUpRight
318
- : arrowUpLeft
319
- }
320
- />
321
- </motion.div>
322
- ) }
323
- </motion.div>
227
+ );
228
+ } }
229
+ icon={
230
+ isRTL() ? chevronRight : chevronLeft
231
+ }
232
+ />
324
233
  )
325
234
  }
326
235
  </BackButton>
@@ -22,65 +22,3 @@
22
22
  display: flex;
23
23
  justify-content: center;
24
24
  }
25
-
26
- .edit-site-editor__view-mode-toggle {
27
- /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
28
- view-transition-name: toggle;
29
- /* stylelint-enable */
30
- top: 0;
31
- left: 0;
32
- height: $header-height;
33
- width: $header-height;
34
- z-index: 100;
35
-
36
- .components-button {
37
- color: $white;
38
- height: 100%;
39
- width: 100%;
40
- border-radius: 0;
41
- overflow: hidden;
42
- padding: 0;
43
- display: flex;
44
- align-items: center;
45
- justify-content: center;
46
- &:hover,
47
- &:active {
48
- color: $white;
49
- }
50
-
51
- &:focus {
52
- box-shadow: none;
53
- }
54
- }
55
-
56
- .edit-site-editor__view-mode-toggle-icon {
57
- svg,
58
- img {
59
- background: $gray-900;
60
- display: block;
61
- }
62
- }
63
- }
64
-
65
- .edit-site-editor__back-icon {
66
- position: absolute;
67
- top: 0;
68
- left: 0;
69
- width: $header-height;
70
- height: $header-height;
71
- display: flex;
72
- align-items: center;
73
- justify-content: center;
74
- background-color: hsla(0, 0%, 80%);
75
- pointer-events: none;
76
-
77
- svg {
78
- fill: currentColor;
79
- }
80
-
81
- &.has-site-icon {
82
- background-color: hsla(0, 0%, 100%, 0.6);
83
- -webkit-backdrop-filter: saturate(180%) blur(15px);
84
- backdrop-filter: saturate(180%) blur(15px);
85
- }
86
- }
@@ -19,6 +19,7 @@ import {
19
19
  useResizeObserver,
20
20
  usePrevious,
21
21
  } from '@wordpress/compose';
22
+ import { focus } from '@wordpress/dom';
22
23
  import { __, sprintf } from '@wordpress/i18n';
23
24
  import { useState, useRef, useEffect, useMemo } from '@wordpress/element';
24
25
  import {
@@ -37,7 +38,7 @@ import { Tooltip } from '@wordpress/ui';
37
38
  /**
38
39
  * Internal dependencies
39
40
  */
40
- import { default as SiteHub, SiteHubMobile } from '../site-hub';
41
+ import { SiteHubMobile } from '../site-hub';
41
42
  import ResizableFrame from '../resizable-frame';
42
43
  import { unlock } from '../../lock-unlock';
43
44
  import SaveKeyboardShortcut from '../save-keyboard-shortcut';
@@ -57,13 +58,12 @@ function Layout() {
57
58
  const { query, name: routeKey, areas, widths } = useLocation();
58
59
  // Force canvas to 'view' on notfound route to show the error message and allow navigation.
59
60
  const canvas = routeKey === 'notfound' ? 'view' : query?.canvas ?? 'view';
60
- const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
61
- const showDesktopSiteHub = ! hasAdminBarInEditor;
62
- const showMobileSiteHub = ! hasAdminBarInEditor || routeKey !== 'home';
61
+ const showMobileSiteHub = !! areas.mobileContent;
63
62
  const hasMobileAreas =
64
63
  areas.mobileSidebar || areas.mobileContent || areas.preview;
65
64
  const isMobileViewport = useViewportMatch( 'medium', '<' );
66
- const toggleRef = useRef();
65
+ const mobileToggleRef = useRef();
66
+ const sidebarRegionRef = useRef();
67
67
  const navigateRegionsProps = useNavigateRegions();
68
68
  const disableMotion = useReducedMotion();
69
69
  const [ canvasResizer, canvasSize ] = useResizeObserver();
@@ -88,9 +88,14 @@ function Layout() {
88
88
  const previousCanvaMode = usePrevious( canvas );
89
89
  useEffect( () => {
90
90
  if ( previousCanvaMode === 'edit' ) {
91
- toggleRef.current?.focus();
91
+ const desktopToggle = sidebarRegionRef.current
92
+ ? // We're typically expecting the `<DashboardBackButton />` component as the first tabbable element.
93
+ focus.tabbable.find( sidebarRegionRef.current )[ 0 ]
94
+ : undefined;
95
+ ( desktopToggle ?? mobileToggleRef.current )?.focus();
92
96
  }
93
97
  // Should not depend on the previous canvas mode value but the next.
98
+ // eslint-disable-next-line react-hooks/exhaustive-deps
94
99
  }, [ canvas ] );
95
100
 
96
101
  return (
@@ -116,6 +121,7 @@ function Layout() {
116
121
  */ }
117
122
  { ( ! isMobileViewport || ! hasMobileAreas ) && (
118
123
  <NavigableRegion
124
+ ref={ sidebarRegionRef }
119
125
  ariaLabel={ __( 'Navigation' ) }
120
126
  className="edit-site-layout__sidebar-region"
121
127
  >
@@ -137,14 +143,6 @@ function Layout() {
137
143
  } }
138
144
  className="edit-site-layout__sidebar"
139
145
  >
140
- { showDesktopSiteHub && (
141
- <SiteHub
142
- ref={ toggleRef }
143
- isTransparent={
144
- isResizableFrameOversized
145
- }
146
- />
147
- ) }
148
146
  <SidebarNavigationProvider>
149
147
  <SidebarContent
150
148
  shouldAnimate={
@@ -176,10 +174,7 @@ function Layout() {
176
174
  <>
177
175
  { showMobileSiteHub && (
178
176
  <SiteHubMobile
179
- ref={ toggleRef }
180
- isTransparent={
181
- isResizableFrameOversized
182
- }
177
+ ref={ mobileToggleRef }
183
178
  />
184
179
  ) }
185
180
  { areas.mobileContent ? (
@@ -17,6 +17,7 @@
17
17
 
18
18
  .edit-site-layout__content {
19
19
  height: 100%;
20
+ min-height: 0;
20
21
  flex-grow: 1;
21
22
  display: flex;
22
23
  }
@@ -33,15 +34,16 @@
33
34
  // This is only necessary for the exit animation
34
35
  .edit-site-layout.is-full-canvas & {
35
36
  position: fixed !important;
36
- height: 100vh;
37
+ height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
37
38
  left: 0;
38
- top: 0;
39
+ top: var(--wp-admin--admin-bar--height, 0);
39
40
  }
40
41
 
41
42
  .edit-site-layout__sidebar {
42
43
  display: flex;
43
44
  flex-direction: column;
44
45
  height: 100%;
46
+ min-height: 0;
45
47
  }
46
48
 
47
49
  .resizable-editor__drag-handle {
@@ -163,7 +165,6 @@
163
165
  height: 100%;
164
166
  }
165
167
 
166
- /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
167
168
  html.canvas-mode-edit-transition::view-transition-group(toggle) {
168
169
  animation-delay: 255ms;
169
170
  }
@@ -175,64 +176,6 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
175
176
  animation: none !important;
176
177
  }
177
178
  }
178
- /* stylelint-enable */
179
-
180
- .edit-site-layout.is-full-canvas .edit-site-layout__sidebar-region .edit-site-layout__view-mode-toggle {
181
- display: none;
182
- }
183
-
184
- .edit-site-layout__view-mode-toggle.components-button {
185
- /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
186
- view-transition-name: toggle;
187
- /* stylelint-enable */
188
- position: relative;
189
- color: var(--wpds-color-foreground-interactive-neutral);
190
- height: $header-height;
191
- width: $header-height;
192
- overflow: hidden;
193
- padding: 0;
194
- display: flex;
195
- align-items: center;
196
- justify-content: center;
197
- background: var(--wpds-color-background-surface-neutral-weak);
198
- border-radius: 0;
199
-
200
- &:hover,
201
- &:active {
202
- color: var(--wpds-color-foreground-interactive-neutral-active);
203
- }
204
-
205
- &:focus-visible,
206
- &:focus {
207
- box-shadow: 0 0 0 3px #1e1e1e, 0 0 0 6px var(--wp-admin-theme-color);
208
- outline: 4px solid #0000;
209
- outline-offset: 4px;
210
- }
211
-
212
- &::before {
213
- content: "";
214
- display: block;
215
- position: absolute;
216
- top: $grid-unit-10 + $border-width;
217
- right: $grid-unit-10 + $border-width;
218
- bottom: $grid-unit-10 + $border-width;
219
- left: $grid-unit-20 + $border-width;
220
- border-radius: $radius-medium;
221
- box-shadow: none;
222
-
223
- @media not (prefers-reduced-motion) {
224
- transition: box-shadow 0.1s ease;
225
- }
226
- }
227
-
228
- .edit-site-layout__view-mode-toggle-icon {
229
- display: flex;
230
- height: $header-height;
231
- width: $header-height;
232
- justify-content: center;
233
- align-items: center;
234
- }
235
- }
236
179
 
237
180
  .edit-site-layout__actions {
238
181
  z-index: z-index(".edit-site-layout__actions");
@@ -254,7 +197,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
254
197
  &.is-entity-save-view-open {
255
198
  &:focus,
256
199
  &:focus-within {
257
- top: 0;
200
+ top: var(--wp-admin--admin-bar--height, 0);
258
201
  }
259
202
  }
260
203