@wordpress/edit-site 4.4.0 → 4.5.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 (71) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-editor/index.js +1 -1
  3. package/build/components/block-editor/index.js.map +1 -1
  4. package/build/components/global-styles/context-menu.js +3 -3
  5. package/build/components/global-styles/context-menu.js.map +1 -1
  6. package/build/components/global-styles/header.js +15 -11
  7. package/build/components/global-styles/header.js.map +1 -1
  8. package/build/components/global-styles/navigation-button.js +4 -4
  9. package/build/components/global-styles/navigation-button.js.map +1 -1
  10. package/build/components/global-styles/palette.js +1 -1
  11. package/build/components/global-styles/palette.js.map +1 -1
  12. package/build/components/global-styles/screen-block-list.js +1 -1
  13. package/build/components/global-styles/screen-block-list.js.map +1 -1
  14. package/build/components/global-styles/screen-colors.js +3 -3
  15. package/build/components/global-styles/screen-colors.js.map +1 -1
  16. package/build/components/global-styles/screen-root.js +13 -3
  17. package/build/components/global-styles/screen-root.js.map +1 -1
  18. package/build/components/global-styles/screen-typography.js +1 -1
  19. package/build/components/global-styles/screen-typography.js.map +1 -1
  20. package/build/components/secondary-sidebar/list-view-sidebar.js +1 -5
  21. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  22. package/build/components/sidebar/index.js +1 -1
  23. package/build/components/sidebar/index.js.map +1 -1
  24. package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
  25. package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
  26. package/build/index.js +0 -1
  27. package/build/index.js.map +1 -1
  28. package/build-module/components/block-editor/index.js +2 -2
  29. package/build-module/components/block-editor/index.js.map +1 -1
  30. package/build-module/components/global-styles/context-menu.js +4 -4
  31. package/build-module/components/global-styles/context-menu.js.map +1 -1
  32. package/build-module/components/global-styles/header.js +16 -11
  33. package/build-module/components/global-styles/header.js.map +1 -1
  34. package/build-module/components/global-styles/navigation-button.js +3 -3
  35. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  36. package/build-module/components/global-styles/palette.js +2 -2
  37. package/build-module/components/global-styles/palette.js.map +1 -1
  38. package/build-module/components/global-styles/screen-block-list.js +2 -2
  39. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  40. package/build-module/components/global-styles/screen-colors.js +4 -4
  41. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  42. package/build-module/components/global-styles/screen-root.js +15 -5
  43. package/build-module/components/global-styles/screen-root.js.map +1 -1
  44. package/build-module/components/global-styles/screen-typography.js +2 -2
  45. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  46. package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -5
  47. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  48. package/build-module/components/sidebar/index.js +3 -3
  49. package/build-module/components/sidebar/index.js.map +1 -1
  50. package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
  51. package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
  52. package/build-module/index.js +0 -1
  53. package/build-module/index.js.map +1 -1
  54. package/build-style/style-rtl.css +19 -29
  55. package/build-style/style.css +19 -29
  56. package/package.json +29 -29
  57. package/src/components/block-editor/index.js +2 -2
  58. package/src/components/global-styles/context-menu.js +7 -7
  59. package/src/components/global-styles/header.js +20 -17
  60. package/src/components/global-styles/navigation-button.js +3 -3
  61. package/src/components/global-styles/palette.js +3 -3
  62. package/src/components/global-styles/screen-block-list.js +3 -3
  63. package/src/components/global-styles/screen-colors.js +7 -7
  64. package/src/components/global-styles/screen-root.js +34 -24
  65. package/src/components/global-styles/screen-typography.js +3 -3
  66. package/src/components/header/style.scss +14 -29
  67. package/src/components/secondary-sidebar/list-view-sidebar.js +1 -5
  68. package/src/components/sidebar/index.js +2 -2
  69. package/src/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -7
  70. package/src/components/sidebar/style.scss +6 -0
  71. package/src/index.js +0 -1
@@ -16,7 +16,7 @@ import { useMemo } from '@wordpress/element';
16
16
  * Internal dependencies
17
17
  */
18
18
  import Subtitle from './subtitle';
19
- import { NavigationButton } from './navigation-button';
19
+ import { NavigationButtonAsItem } from './navigation-button';
20
20
  import { useSetting } from './hooks';
21
21
  import ColorIndicatorWrapper from './color-indicator-wrapper';
22
22
 
@@ -58,7 +58,7 @@ function Palette( { name } ) {
58
58
  <VStack spacing={ 3 }>
59
59
  <Subtitle>{ __( 'Palette' ) }</Subtitle>
60
60
  <ItemGroup isBordered isSeparated>
61
- <NavigationButton path={ screenPath }>
61
+ <NavigationButtonAsItem path={ screenPath }>
62
62
  <HStack
63
63
  direction={
64
64
  colors.length === 0 ? 'row-reverse' : 'row'
@@ -73,7 +73,7 @@ function Palette( { name } ) {
73
73
  </ZStack>
74
74
  <FlexItem>{ paletteButtonText }</FlexItem>
75
75
  </HStack>
76
- </NavigationButton>
76
+ </NavigationButtonAsItem>
77
77
  </ItemGroup>
78
78
  </VStack>
79
79
  );
@@ -22,7 +22,7 @@ import { useHasColorPanel } from './color-utils';
22
22
  import { useHasDimensionsPanel } from './dimensions-panel';
23
23
  import { useHasTypographyPanel } from './typography-panel';
24
24
  import ScreenHeader from './header';
25
- import { NavigationButton } from './navigation-button';
25
+ import { NavigationButtonAsItem } from './navigation-button';
26
26
 
27
27
  function useSortedBlockTypes() {
28
28
  const blockItems = useSelect(
@@ -61,12 +61,12 @@ function BlockMenuItem( { block } ) {
61
61
  }
62
62
 
63
63
  return (
64
- <NavigationButton path={ '/blocks/' + block.name }>
64
+ <NavigationButtonAsItem path={ '/blocks/' + block.name }>
65
65
  <HStack justify="flex-start">
66
66
  <BlockIcon icon={ block.icon } />
67
67
  <FlexItem>{ block.title }</FlexItem>
68
68
  </HStack>
69
- </NavigationButton>
69
+ </NavigationButtonAsItem>
70
70
  );
71
71
  }
72
72
 
@@ -15,7 +15,7 @@ import {
15
15
  */
16
16
  import ScreenHeader from './header';
17
17
  import Palette from './palette';
18
- import { NavigationButton } from './navigation-button';
18
+ import { NavigationButtonAsItem } from './navigation-button';
19
19
  import { getSupportedGlobalStylesPanels, useStyle } from './hooks';
20
20
  import Subtitle from './subtitle';
21
21
  import ColorIndicatorWrapper from './color-indicator-wrapper';
@@ -33,7 +33,7 @@ function BackgroundColorItem( { name, parentMenu } ) {
33
33
  }
34
34
 
35
35
  return (
36
- <NavigationButton path={ parentMenu + '/colors/background' }>
36
+ <NavigationButtonAsItem path={ parentMenu + '/colors/background' }>
37
37
  <HStack justify="flex-start">
38
38
  <ColorIndicatorWrapper expanded={ false }>
39
39
  <ColorIndicator
@@ -42,7 +42,7 @@ function BackgroundColorItem( { name, parentMenu } ) {
42
42
  </ColorIndicatorWrapper>
43
43
  <FlexItem>{ __( 'Background' ) }</FlexItem>
44
44
  </HStack>
45
- </NavigationButton>
45
+ </NavigationButtonAsItem>
46
46
  );
47
47
  }
48
48
 
@@ -56,14 +56,14 @@ function TextColorItem( { name, parentMenu } ) {
56
56
  }
57
57
 
58
58
  return (
59
- <NavigationButton path={ parentMenu + '/colors/text' }>
59
+ <NavigationButtonAsItem path={ parentMenu + '/colors/text' }>
60
60
  <HStack justify="flex-start">
61
61
  <ColorIndicatorWrapper expanded={ false }>
62
62
  <ColorIndicator colorValue={ color } />
63
63
  </ColorIndicatorWrapper>
64
64
  <FlexItem>{ __( 'Text' ) }</FlexItem>
65
65
  </HStack>
66
- </NavigationButton>
66
+ </NavigationButtonAsItem>
67
67
  );
68
68
  }
69
69
 
@@ -77,14 +77,14 @@ function LinkColorItem( { name, parentMenu } ) {
77
77
  }
78
78
 
79
79
  return (
80
- <NavigationButton path={ parentMenu + '/colors/link' }>
80
+ <NavigationButtonAsItem path={ parentMenu + '/colors/link' }>
81
81
  <HStack justify="flex-start">
82
82
  <ColorIndicatorWrapper expanded={ false }>
83
83
  <ColorIndicator colorValue={ color } />
84
84
  </ColorIndicatorWrapper>
85
85
  <FlexItem>{ __( 'Links' ) }</FlexItem>
86
86
  </HStack>
87
- </NavigationButton>
87
+ </NavigationButtonAsItem>
88
88
  );
89
89
  }
90
90
 
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import {
5
5
  __experimentalItemGroup as ItemGroup,
6
- __experimentalItem as Item,
7
6
  __experimentalHStack as HStack,
7
+ __experimentalSpacer as Spacer,
8
8
  __experimentalVStack as VStack,
9
9
  FlexItem,
10
10
  CardBody,
@@ -21,7 +21,7 @@ import { store as coreStore } from '@wordpress/core-data';
21
21
  * Internal dependencies
22
22
  */
23
23
  import { IconWithCurrentColor } from './icon-with-current-color';
24
- import { NavigationButton } from './navigation-button';
24
+ import { NavigationButtonAsItem } from './navigation-button';
25
25
  import ContextMenu from './context-menu';
26
26
  import StylesPreview from './preview';
27
27
 
@@ -37,48 +37,58 @@ function ScreenRoot() {
37
37
  return (
38
38
  <Card size="small">
39
39
  <CardBody>
40
- <VStack spacing={ 2 }>
40
+ <VStack spacing={ 4 }>
41
41
  <Card>
42
42
  <CardMedia>
43
43
  <StylesPreview />
44
44
  </CardMedia>
45
45
  </Card>
46
46
  { !! variations?.length && (
47
- <NavigationButton path="/variations">
48
- <HStack justify="space-between">
49
- <FlexItem>{ __( 'Browse styles' ) }</FlexItem>
50
- <IconWithCurrentColor
51
- icon={
52
- isRTL() ? chevronLeft : chevronRight
53
- }
54
- />
55
- </HStack>
56
- </NavigationButton>
47
+ <ItemGroup>
48
+ <NavigationButtonAsItem path="/variations">
49
+ <HStack justify="space-between">
50
+ <FlexItem>
51
+ { __( 'Browse styles' ) }
52
+ </FlexItem>
53
+ <IconWithCurrentColor
54
+ icon={
55
+ isRTL() ? chevronLeft : chevronRight
56
+ }
57
+ />
58
+ </HStack>
59
+ </NavigationButtonAsItem>
60
+ </ItemGroup>
57
61
  ) }
62
+ <ContextMenu />
58
63
  </VStack>
59
64
  </CardBody>
60
65
 
61
- <CardBody>
62
- <ContextMenu />
63
- </CardBody>
64
-
65
66
  <CardDivider />
66
67
 
67
68
  <CardBody>
69
+ <Spacer
70
+ as="p"
71
+ paddingTop={ 2 }
72
+ /*
73
+ * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).
74
+ * This is an ad hoc override for this particular instance only and should be reconsidered before making into a pattern.
75
+ */
76
+ paddingX="13px"
77
+ marginBottom={ 4 }
78
+ >
79
+ { __(
80
+ 'Customize the appearance of specific blocks for the whole site.'
81
+ ) }
82
+ </Spacer>
68
83
  <ItemGroup>
69
- <Item>
70
- { __(
71
- 'Customize the appearance of specific blocks for the whole site.'
72
- ) }
73
- </Item>
74
- <NavigationButton path="/blocks">
84
+ <NavigationButtonAsItem path="/blocks">
75
85
  <HStack justify="space-between">
76
86
  <FlexItem>{ __( 'Blocks' ) }</FlexItem>
77
87
  <IconWithCurrentColor
78
88
  icon={ isRTL() ? chevronLeft : chevronRight }
79
89
  />
80
90
  </HStack>
81
- </NavigationButton>
91
+ </NavigationButtonAsItem>
82
92
  </ItemGroup>
83
93
  </CardBody>
84
94
  </Card>
@@ -13,7 +13,7 @@ import {
13
13
  * Internal dependencies
14
14
  */
15
15
  import ScreenHeader from './header';
16
- import { NavigationButton } from './navigation-button';
16
+ import { NavigationButtonAsItem } from './navigation-button';
17
17
  import { useStyle } from './hooks';
18
18
  import Subtitle from './subtitle';
19
19
  import TypographyPanel from './typography-panel';
@@ -44,7 +44,7 @@ function Item( { name, parentMenu, element, label } ) {
44
44
  }
45
45
 
46
46
  return (
47
- <NavigationButton path={ parentMenu + '/typography/' + element }>
47
+ <NavigationButtonAsItem path={ parentMenu + '/typography/' + element }>
48
48
  <HStack justify="flex-start">
49
49
  <FlexItem
50
50
  className="edit-site-global-styles-screen-typography__indicator"
@@ -62,7 +62,7 @@ function Item( { name, parentMenu, element, label } ) {
62
62
  </FlexItem>
63
63
  <FlexItem>{ label }</FlexItem>
64
64
  </HStack>
65
- </NavigationButton>
65
+ </NavigationButtonAsItem>
66
66
  );
67
67
  }
68
68
 
@@ -104,8 +104,9 @@ body.is-navigation-sidebar-open {
104
104
  margin: 0 -6px 0;
105
105
  }
106
106
 
107
+
107
108
  /**
108
- * Buttons in the Toolbar
109
+ * Buttons on the right side
109
110
  */
110
111
 
111
112
  .edit-site-header__actions {
@@ -113,36 +114,23 @@ body.is-navigation-sidebar-open {
113
114
  align-items: center;
114
115
  padding-right: $grid-unit-05;
115
116
 
116
- .interface-pinned-items {
117
- display: none;
118
-
119
- @include break-medium() {
120
- display: inline-flex;
121
- }
117
+ @include break-small () {
118
+ padding-right: $grid-unit-20 - ($grid-unit-15 * 0.5);
122
119
  }
123
120
 
124
- // Adjust button paddings to scale better to mobile.
125
- .editor-post-saved-state,
126
- .components-button.components-button {
127
- margin-right: $grid-unit-05;
128
-
129
- @include break-small() {
130
- margin-right: $grid-unit-15;
131
- }
132
- }
121
+ gap: $grid-unit-05;
133
122
 
134
- .editor-post-saved-state,
135
- .components-button.is-tertiary {
136
- padding: 0 #{$grid-unit-15 * 0.5};
123
+ @include break-small() {
124
+ gap: $grid-unit-10;
137
125
  }
138
126
 
139
- .edit-site-more-menu .components-button,
140
- .interface-pinned-items .components-button {
141
- margin-right: 0;
142
- }
127
+ // Pinned items.
128
+ .interface-pinned-items {
129
+ display: none;
143
130
 
144
- @include break-small() {
145
- padding-right: $grid-unit-20;
131
+ @include break-medium() {
132
+ display: inline-flex;
133
+ }
146
134
  }
147
135
  }
148
136
 
@@ -192,11 +180,8 @@ body.is-navigation-sidebar-open {
192
180
  .edit-site-save-button__button {
193
181
  padding-left: 6px;
194
182
  padding-right: 6px;
195
- margin-right: $grid-unit-05;
196
- }
197
- .block-editor-post-preview__button-toggle {
198
- margin-right: $grid-unit-05;
199
183
  }
184
+
200
185
  // The inserter and the template details toggle have custom labels, different from their aria-label, so we don't want to display both.
201
186
  .edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle,
202
187
  .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
@@ -59,11 +59,7 @@ export default function ListViewSidebar() {
59
59
  focusOnMountRef,
60
60
  ] ) }
61
61
  >
62
- <ListView
63
- showNestedBlocks
64
- __experimentalFeatures
65
- __experimentalPersistentListViewFeatures
66
- />
62
+ <ListView />
67
63
  </div>
68
64
  </div>
69
65
  );
@@ -4,7 +4,7 @@
4
4
  import { createSlotFill, PanelBody } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { cog } from '@wordpress/icons';
7
- import { useEffect } from '@wordpress/element';
7
+ import { useEffect, Fragment } from '@wordpress/element';
8
8
  import { useSelect, useDispatch } from '@wordpress/data';
9
9
  import { store as interfaceStore } from '@wordpress/interface';
10
10
  import { store as blockEditorStore } from '@wordpress/block-editor';
@@ -62,7 +62,7 @@ export function SidebarComplementaryAreaFills() {
62
62
  // Conditionally include NavMenu sidebar in Plugin only.
63
63
  // Optimise for dead code elimination.
64
64
  // See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
65
- let MaybeNavigationMenuSidebar = 'Fragment';
65
+ let MaybeNavigationMenuSidebar = Fragment;
66
66
 
67
67
  if ( process.env.IS_GUTENBERG_PLUGIN ) {
68
68
  MaybeNavigationMenuSidebar = NavigationMenuSidebar;
@@ -50,13 +50,7 @@ export default function NavigationMenu( { innerBlocks, id } ) {
50
50
  }, [ updateBlockListSettings, innerBlocks ] );
51
51
  return (
52
52
  <>
53
- <ListView
54
- id={ id }
55
- showNestedBlocks
56
- expandNested={ false }
57
- __experimentalFeatures
58
- __experimentalPersistentListViewFeatures
59
- />
53
+ <ListView id={ id } />
60
54
  </>
61
55
  );
62
56
  }
@@ -136,3 +136,9 @@ $split-border-control-offset: 55px;
136
136
  }
137
137
  }
138
138
  }
139
+
140
+ // Override the `hr` styles defined in the `ComplementaryArea` component
141
+ // from the `@wordpress/interface` package.
142
+ .edit-site-global-styles-sidebar hr {
143
+ margin: 0;
144
+ }
package/src/index.js CHANGED
@@ -103,7 +103,6 @@ export function initializeEditor( id, settings ) {
103
103
  settings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>
104
104
  fetchLinkSuggestions( search, searchOptions, settings );
105
105
  settings.__experimentalFetchRichUrlData = fetchUrlData;
106
- settings.__experimentalSpotlightEntityBlocks = [ 'core/template-part' ];
107
106
 
108
107
  const target = document.getElementById( id );
109
108