@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
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __, _x } from '@wordpress/i18n';
4
+ import { __ } from '@wordpress/i18n';
5
5
  import { useMemo, useId } from '@wordpress/element';
6
6
  import { BlockPreview } from '@wordpress/block-editor';
7
7
  import { parse } from '@wordpress/blocks';
@@ -10,11 +10,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
- import {
14
- TEMPLATE_PART_POST_TYPE,
15
- PATTERN_SYNC_TYPES,
16
- OPERATOR_IS,
17
- } from '../../utils/constants';
13
+ import { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
18
14
  import { unlock } from '../../lock-unlock';
19
15
 
20
16
  const { useStyle } = unlock( editorPrivateApis );
@@ -65,47 +61,3 @@ export const previewField = {
65
61
  render: PreviewField,
66
62
  enableSorting: false,
67
63
  };
68
-
69
- const SYNC_FILTERS = [
70
- {
71
- value: PATTERN_SYNC_TYPES.full,
72
- label: _x( 'Synced', 'pattern (singular)' ),
73
- description: __( 'Patterns that are kept in sync across the site.' ),
74
- },
75
- {
76
- value: PATTERN_SYNC_TYPES.unsynced,
77
- label: _x( 'Not synced', 'pattern (singular)' ),
78
- description: __(
79
- 'Patterns that can be changed freely without affecting the site.'
80
- ),
81
- },
82
- ];
83
-
84
- export const patternStatusField = {
85
- label: __( 'Sync status' ),
86
- id: 'sync-status',
87
- render: ( { item } ) => {
88
- const syncStatus =
89
- 'wp_pattern_sync_status' in item
90
- ? item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full
91
- : PATTERN_SYNC_TYPES.unsynced;
92
- // User patterns can have their sync statuses checked directly.
93
- // Non-user patterns are all unsynced for the time being.
94
- return (
95
- <span
96
- className={ `edit-site-patterns__field-sync-status-${ syncStatus }` }
97
- >
98
- {
99
- SYNC_FILTERS.find( ( { value } ) => value === syncStatus )
100
- .label
101
- }
102
- </span>
103
- );
104
- },
105
- elements: SYNC_FILTERS,
106
- filterBy: {
107
- operators: [ OPERATOR_IS ],
108
- isPrimary: true,
109
- },
110
- enableSorting: false,
111
- };
@@ -26,12 +26,11 @@ import { unlock } from '../../lock-unlock';
26
26
  import usePatterns, { useAugmentPatternsWithPermissions } from './use-patterns';
27
27
  import PatternsActions from './actions';
28
28
  import { useEditPostAction } from '../dataviews-actions';
29
- import { patternStatusField, previewField } from './fields';
29
+ import { previewField } from './fields';
30
30
  import usePatternCategories from '../sidebar-navigation-screen-patterns/use-pattern-categories';
31
31
 
32
32
  const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
33
- const { usePostActions, usePostFields, patternTitleField } =
34
- unlock( editorPrivateApis );
33
+ const { usePostActions, usePostFields } = unlock( editorPrivateApis );
35
34
  const { useLocation, useHistory } = unlock( routerPrivateApis );
36
35
 
37
36
  const EMPTY_ARRAY = [];
@@ -104,27 +103,10 @@ export default function DataviewsPatterns() {
104
103
  syncStatus: viewSyncStatus,
105
104
  } );
106
105
 
107
- const templatePartFields = usePostFields( {
108
- postType: TEMPLATE_PART_POST_TYPE,
109
- } );
110
- const templatePartAuthorField = templatePartFields.find(
111
- ( field ) => field.id === 'author'
112
- );
113
-
106
+ const postTypeFields = usePostFields( { postType } );
114
107
  const fields = useMemo( () => {
115
- const _fields = [ previewField, patternTitleField ];
116
-
117
- if ( postType === PATTERN_TYPES.user ) {
118
- _fields.push( patternStatusField );
119
- } else if (
120
- postType === TEMPLATE_PART_POST_TYPE &&
121
- templatePartAuthorField
122
- ) {
123
- _fields.push( templatePartAuthorField );
124
- }
125
-
126
- return _fields;
127
- }, [ postType, templatePartAuthorField ] );
108
+ return [ previewField, ...( postTypeFields || [] ) ];
109
+ }, [ postTypeFields ] );
128
110
 
129
111
  const { data, paginationInfo } = useMemo( () => {
130
112
  // Search is managed server-side as well as filters for patterns.
@@ -67,7 +67,7 @@
67
67
 
68
68
  .edit-site-page-patterns-dataviews {
69
69
  .dataviews-view-grid__badge-fields {
70
- .dataviews-view-grid__field-value:has(.edit-site-patterns__field-sync-status-fully) {
70
+ .dataviews-view-grid__field-value:has(.fields-field__pattern-sync-status-fully) {
71
71
  background: rgba(var(--wp-block-synced-color--rgb), 0.04);
72
72
  color: var(--wp-block-synced-color);
73
73
  }
@@ -67,9 +67,8 @@ const EntitiesSavedStatesForPreview = ( {
67
67
  );
68
68
 
69
69
  const activateTheme = useActivateTheme();
70
- const onSave = async ( values ) => {
70
+ const onSave = async () => {
71
71
  await activateTheme();
72
- return values;
73
72
  };
74
73
 
75
74
  return (
@@ -4,6 +4,8 @@
4
4
 
5
5
  .edit-site-sidebar__content {
6
6
  flex-grow: 1;
7
+ flex-basis: 0;
8
+ min-height: 0;
7
9
  overflow-y: auto;
8
10
  // Prevents horizontal overflow while animating screen transitions
9
11
  overflow-x: hidden;
@@ -2,17 +2,9 @@
2
2
  color: var(--wpds-color-foreground-interactive-neutral);
3
3
  flex-shrink: 0;
4
4
 
5
- // Focus (resets default button focus and use focus-visible).
6
- &:focus:not(:disabled) {
7
- box-shadow: none;
5
+ &:focus:not(:focus-visible) {
8
6
  outline: none;
9
7
  }
10
- &:focus-visible:not(:disabled) {
11
- box-shadow:
12
- 0 0 0 var(--wp-admin-border-width-focus)
13
- var(--wp-admin-theme-color);
14
- outline: 3px solid transparent;
15
- }
16
8
 
17
9
  &:hover:not(:disabled,[aria-disabled="true"]),
18
10
  &:focus-visible,
@@ -16,11 +16,14 @@
16
16
  padding-right: 0;
17
17
 
18
18
  .global-styles-ui-sidebar__navigator-screen {
19
- padding-top: $grid-unit-15;
20
- padding-left: $grid-unit-15;
21
- padding-right: $grid-unit-15;
22
- padding-bottom: $grid-unit-15;
19
+ padding: $grid-unit-15;
23
20
  outline: none;
21
+
22
+ .global-styles-ui-color-palette__tablist-container {
23
+ margin-inline: -$grid-unit-15;
24
+ width: calc(100% + #{$grid-unit-15 * 2});
25
+ padding-inline: $grid-unit-15;
26
+ }
24
27
  }
25
28
  }
26
29
  .edit-site-sidebar-button {
@@ -1,3 +1,4 @@
1
+ @use "@wordpress/base-styles/mixins";
1
2
  @use "@wordpress/base-styles/variables" as *;
2
3
 
3
4
  .edit-site-sidebar-navigation-item.components-item {
@@ -10,21 +11,24 @@
10
11
  &:hover,
11
12
  &:focus,
12
13
  &[aria-current="true"] {
13
- color: var(--wpds-color-foreground-interactive-neutral-active);
14
+ color: var(--wpds-color-foreground-interactive-neutral-weak-active);
14
15
 
15
16
  .edit-site-sidebar-navigation-item__drilldown-indicator {
16
- fill: var(--wpds-color-foreground-interactive-neutral-active);
17
+ fill: var(--wpds-color-foreground-interactive-neutral-weak-active);
17
18
  }
18
19
  }
19
20
 
20
21
  &[aria-current="true"] {
21
22
  background: var(--wpds-color-background-interactive-neutral-weak-active);
22
- color: var(--wpds-color-foreground-interactive-neutral-active);
23
- font-weight: $font-weight-medium;
23
+ color: var(--wpds-color-foreground-interactive-neutral-weak-active);
24
+ font-weight: var(--wpds-typography-font-weight-emphasis);
24
25
  }
25
26
 
26
27
  // Make sure the focus style is drawn on top of the current item background.
27
28
  &:focus-visible {
29
+ // TODO: remove once the <Item> component has migrated to the WPDS focus color token.
30
+ --wp-components-color-accent: var(--wpds-color-stroke-focus);
31
+
28
32
  transform: translateZ(0);
29
33
  }
30
34
 
@@ -35,7 +35,7 @@
35
35
  position: sticky;
36
36
  top: 0;
37
37
  background: var(--wpds-color-background-surface-neutral-weak);
38
- padding-top: $grid-unit-60;
38
+ padding-top: $grid-unit-40;
39
39
  margin-bottom: $grid-unit-10;
40
40
  padding-bottom: $grid-unit-10;
41
41
  // Title needs to appear above other UI in the section content.
@@ -27,7 +27,7 @@
27
27
  &:hover,
28
28
  &:focus,
29
29
  &[aria-current] {
30
- color: var(--wpds-color-foreground-interactive-neutral-active);
30
+ color: var(--wpds-color-foreground-interactive-neutral-weak-active);
31
31
  }
32
32
  }
33
33
 
@@ -35,7 +35,7 @@
35
35
  color: var(--wpds-color-foreground-interactive-neutral-weak);
36
36
  &:hover,
37
37
  &:focus {
38
- color: var(--wpds-color-foreground-interactive-neutral-active);
38
+ color: var(--wpds-color-foreground-interactive-neutral-weak-active);
39
39
  }
40
40
  }
41
41
 
@@ -21,7 +21,7 @@
21
21
 
22
22
  h2 {
23
23
  font-size: 11px;
24
- font-weight: $font-weight-medium;
24
+ font-weight: var(--wpds-typography-font-weight-emphasis);
25
25
  text-transform: uppercase;
26
26
  }
27
27
  }
@@ -16,7 +16,7 @@ import SidebarGlobalStyles from '../sidebar-global-styles';
16
16
  const { useLocation, useHistory } = unlock( routerPrivateApis );
17
17
  const { StyleBookPreview } = unlock( editorPrivateApis );
18
18
 
19
- function StylesPreviewArea() {
19
+ function StylesPreviewArea( { siteData } ) {
20
20
  const { path, query } = useLocation();
21
21
  const history = useHistory();
22
22
  const isStylebook = query.preview === 'stylebook';
@@ -36,6 +36,7 @@ function StylesPreviewArea() {
36
36
  <StyleBookPreview
37
37
  path={ section }
38
38
  onPathChange={ onChangeSection }
39
+ settings={ siteData.editorSettings }
39
40
  />
40
41
  );
41
42
  }
@@ -49,7 +50,9 @@ export const stylesRoute = {
49
50
  areas: {
50
51
  content: <SidebarGlobalStyles />,
51
52
  sidebar: <SidebarNavigationScreenGlobalStyles backPath="/" />,
52
- preview: <StylesPreviewArea />,
53
+ preview: ( { siteData } ) => (
54
+ <StylesPreviewArea siteData={ siteData } />
55
+ ),
53
56
  mobileContent: <SidebarGlobalStyles />,
54
57
  },
55
58
  widths: {
@@ -1,134 +1,35 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
- import { useSelect, useDispatch } from '@wordpress/data';
10
- import { Button, __experimentalHStack as HStack } from '@wordpress/components';
4
+ import { useSelect } from '@wordpress/data';
5
+ import { Button } from '@wordpress/components';
11
6
  import { __, isRTL } from '@wordpress/i18n';
12
7
  import { store as coreStore } from '@wordpress/core-data';
13
- import { decodeEntities } from '@wordpress/html-entities';
14
8
  import { memo, forwardRef, useContext } from '@wordpress/element';
15
- import { Icon, arrowUpLeft, arrowUpRight, search } from '@wordpress/icons';
16
- import { store as commandsStore } from '@wordpress/commands';
17
- import { displayShortcut } from '@wordpress/keycodes';
18
- import { VisuallyHidden } from '@wordpress/ui';
19
- import { filterURLForDisplay } from '@wordpress/url';
9
+ import { chevronLeft, chevronRight } from '@wordpress/icons';
20
10
  import { privateApis as routerPrivateApis } from '@wordpress/router';
21
11
 
22
12
  /**
23
13
  * Internal dependencies
24
14
  */
25
15
  import { store as editSiteStore } from '../../store';
26
- import SiteIcon from '../site-icon';
27
16
  import { unlock } from '../../lock-unlock';
28
17
  import { SidebarNavigationContext } from '../sidebar';
29
18
  const { useLocation, useHistory } = unlock( routerPrivateApis );
30
19
 
31
- const SiteHub = memo(
32
- forwardRef( ( { isTransparent }, ref ) => {
33
- const { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {
34
- const { getSettings } = unlock( select( editSiteStore ) );
35
-
36
- const { getEntityRecord } = select( coreStore );
37
- const _site = getEntityRecord( 'root', 'site' );
38
- return {
39
- dashboardLink: getSettings().__experimentalDashboardLink,
40
- homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
41
- siteTitle:
42
- ! _site?.title && !! _site?.url
43
- ? filterURLForDisplay( _site?.url )
44
- : _site?.title,
45
- };
46
- }, [] );
47
- const { open: openCommandCenter } = useDispatch( commandsStore );
48
-
49
- return (
50
- <div className="edit-site-site-hub">
51
- <HStack justify="flex-start" spacing="0">
52
- <div
53
- className={ clsx(
54
- 'edit-site-site-hub__view-mode-toggle-container',
55
- {
56
- 'has-transparent-background': isTransparent,
57
- }
58
- ) }
59
- >
60
- <Button
61
- __next40pxDefaultSize
62
- ref={ ref }
63
- href={ dashboardLink }
64
- label={ __( 'Go to the Dashboard' ) }
65
- className="edit-site-layout__view-mode-toggle"
66
- style={ {
67
- transform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge
68
- borderRadius: 4,
69
- } }
70
- >
71
- <SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
72
- </Button>
73
- </div>
74
-
75
- <HStack>
76
- <div className="edit-site-site-hub__title">
77
- <Button
78
- __next40pxDefaultSize
79
- variant="link"
80
- href={ homeUrl }
81
- target="_blank"
82
- >
83
- { decodeEntities( siteTitle ) }
84
- <VisuallyHidden render={ <span /> }>
85
- {
86
- /* translators: accessibility text */
87
- __( '(opens in a new tab)' )
88
- }
89
- </VisuallyHidden>
90
- </Button>
91
- </div>
92
- <HStack
93
- spacing={ 0 }
94
- expanded={ false }
95
- className="edit-site-site-hub__actions"
96
- >
97
- <Button
98
- size="compact"
99
- className="edit-site-site-hub_toggle-command-center"
100
- icon={ search }
101
- onClick={ () => openCommandCenter() }
102
- label={ __( 'Open command palette' ) }
103
- shortcut={ displayShortcut.primary( 'k' ) }
104
- />
105
- </HStack>
106
- </HStack>
107
- </HStack>
108
- </div>
109
- );
110
- } )
111
- );
112
-
113
- export default SiteHub;
114
-
115
20
  export const SiteHubMobile = memo(
116
- forwardRef( ( { isTransparent }, ref ) => {
21
+ forwardRef( ( props, ref ) => {
117
22
  const { path } = useLocation();
118
23
  const history = useHistory();
119
24
  const { navigate } = useContext( SidebarNavigationContext );
120
- const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
121
25
 
122
26
  const {
123
27
  dashboardLink,
124
- homeUrl,
125
- siteTitle,
126
28
  isBlockTheme,
127
29
  isClassicThemeWithStyleBookSupport,
128
30
  } = useSelect( ( select ) => {
129
31
  const { getSettings } = unlock( select( editSiteStore ) );
130
- const { getEntityRecord, getCurrentTheme } = select( coreStore );
131
- const _site = getEntityRecord( 'root', 'site' );
32
+ const { getCurrentTheme } = select( coreStore );
132
33
  const currentTheme = getCurrentTheme();
133
34
  const settings = getSettings();
134
35
  const supportsEditorStyles =
@@ -138,18 +39,12 @@ export const SiteHubMobile = memo(
138
39
 
139
40
  return {
140
41
  dashboardLink: settings.__experimentalDashboardLink,
141
- homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
142
- siteTitle:
143
- ! _site?.title && !! _site?.url
144
- ? filterURLForDisplay( _site?.url )
145
- : _site?.title,
146
42
  isBlockTheme: currentTheme?.is_block_theme,
147
43
  isClassicThemeWithStyleBookSupport:
148
44
  ! currentTheme?.is_block_theme &&
149
45
  ( supportsEditorStyles || hasThemeJson ),
150
46
  };
151
47
  }, [] );
152
- const { open: openCommandCenter } = useDispatch( commandsStore );
153
48
 
154
49
  let backPath;
155
50
 
@@ -181,66 +76,13 @@ export const SiteHubMobile = memo(
181
76
 
182
77
  return (
183
78
  <div className="edit-site-site-hub">
184
- <HStack justify="flex-start" spacing="0">
185
- <div
186
- className={ clsx(
187
- 'edit-site-site-hub__view-mode-toggle-container',
188
- {
189
- 'has-transparent-background': isTransparent,
190
- }
191
- ) }
192
- >
193
- <Button
194
- __next40pxDefaultSize
195
- ref={ ref }
196
- className="edit-site-layout__view-mode-toggle"
197
- style={ {
198
- transform: 'scale(0.5)',
199
- borderRadius: 4,
200
- } }
201
- { ...backButtonProps }
202
- >
203
- { hasAdminBarInEditor ? (
204
- <Icon
205
- icon={
206
- isRTL() ? arrowUpRight : arrowUpLeft
207
- }
208
- size={ 48 }
209
- />
210
- ) : (
211
- <SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
212
- ) }
213
- </Button>
214
- </div>
215
-
216
- <HStack>
217
- <div className="edit-site-site-hub__title">
218
- <Button
219
- __next40pxDefaultSize
220
- variant="link"
221
- href={ homeUrl }
222
- target="_blank"
223
- label={ __( 'View site (opens in a new tab)' ) }
224
- >
225
- { decodeEntities( siteTitle ) }
226
- </Button>
227
- </div>
228
- <HStack
229
- spacing={ 0 }
230
- expanded={ false }
231
- className="edit-site-site-hub__actions"
232
- >
233
- <Button
234
- __next40pxDefaultSize
235
- className="edit-site-site-hub_toggle-command-center"
236
- icon={ search }
237
- onClick={ () => openCommandCenter() }
238
- label={ __( 'Open command palette' ) }
239
- shortcut={ displayShortcut.primary( 'k' ) }
240
- />
241
- </HStack>
242
- </HStack>
243
- </HStack>
79
+ <Button
80
+ size="compact"
81
+ ref={ ref }
82
+ className="edit-site-site-hub__back-button"
83
+ icon={ isRTL() ? chevronRight : chevronLeft }
84
+ { ...backButtonProps }
85
+ />
244
86
  </div>
245
87
  );
246
88
  } )
@@ -3,90 +3,13 @@
3
3
  .edit-site-site-hub {
4
4
  display: flex;
5
5
  align-items: center;
6
- justify-content: space-between;
7
- gap: $grid-unit-10;
8
- margin-right: $grid-unit-15;
6
+ padding-left: $grid-unit-20;
9
7
  height: $header-height;
10
8
  }
11
9
 
12
- .edit-site-site-hub__actions {
13
- flex-shrink: 0;
14
- }
15
-
16
- .edit-site-site-hub__view-mode-toggle-container {
17
- height: $header-height;
18
- width: $header-height;
19
- flex-shrink: 0;
20
-
21
- &.has-transparent-background .edit-site-layout__view-mode-toggle-icon {
22
- background: transparent;
23
- }
24
- }
25
-
26
- .edit-site-site-hub__title .components-button {
27
- color: var(--wpds-color-foreground-interactive-neutral);
28
- display: block;
29
- flex-grow: 1;
30
- font-size: 15px;
31
- font-weight: $font-weight-medium;
32
- overflow: hidden;
33
- // Add space for the ↗ to render.
34
- padding-right: $grid-unit-20;
35
-
36
- // Create 12px gap between site icon and site title
37
- margin-left: - $grid-unit-05;
38
- position: relative;
39
- text-decoration: none;
40
- text-overflow: ellipsis;
41
- white-space: nowrap;
42
-
43
- &:hover,
44
- &:focus,
45
- &:active {
46
- color: var(--wpds-color-foreground-interactive-neutral);
47
- }
48
-
49
- &:focus {
50
- // Defer to :focus-visible below.
51
- box-shadow: none;
52
- outline: none;
53
- }
54
-
55
- &:focus-visible {
56
- // Push the shadow away from the title.
57
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wpds-color-background-surface-neutral-weak), 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wp-admin-theme-color);
58
-
59
- // Windows High Contrast mode will show this outline, but not the box-shadow.
60
- outline: 2px solid transparent;
61
- outline-offset: 2px;
62
- }
63
-
64
- &::after {
65
- content: "\2197";
66
- font-weight: 400;
67
- opacity: 0;
68
- position: absolute;
69
- right: 0;
70
-
71
- @media not (prefers-reduced-motion) {
72
- transition: opacity 0.1s linear;
73
- }
74
- }
75
-
76
- &:hover::after,
77
- &:focus::after,
78
- &:active::after {
79
- opacity: 1;
80
- }
81
- }
82
-
83
- .edit-site-site-hub_toggle-command-center {
84
- color: var(--wpds-color-foreground-interactive-neutral);
85
-
86
- &:hover,
87
- &:active {
88
- svg {
89
- fill: var(--wpds-color-foreground-interactive-neutral-active);
90
- }
10
+ .edit-site-site-hub__back-button {
11
+ &:hover:not(:disabled, [aria-disabled="true"]),
12
+ &:active:not(:disabled, [aria-disabled="true"]) {
13
+ color: var(--wpds-color-foreground-interactive-neutral-active);
91
14
  }
92
15
  }
package/src/index.js CHANGED
@@ -74,7 +74,9 @@ export function initializeEditor( id, settings ) {
74
74
  showListViewByDefault: false,
75
75
  enableChoosePatternModal: true,
76
76
  showCollaborationCursor: false,
77
- showCollaborationNotifications: true,
77
+ showCollaborationJoinNotifications: true,
78
+ showCollaborationLeaveNotifications: true,
79
+ showCollaborationPostSaveNotifications: true,
78
80
  } );
79
81
 
80
82
  if ( window.__clientSideMediaProcessing ) {