@wordpress/edit-site 6.8.8 → 6.8.10

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 (39) hide show
  1. package/build/components/editor/index.js +8 -0
  2. package/build/components/editor/index.js.map +1 -1
  3. package/build/components/global-styles/font-families.js +23 -17
  4. package/build/components/global-styles/font-families.js.map +1 -1
  5. package/build/components/sidebar-button/index.js +1 -1
  6. package/build/components/sidebar-button/index.js.map +1 -1
  7. package/build/components/site-hub/index.js +3 -2
  8. package/build/components/site-hub/index.js.map +1 -1
  9. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -0
  10. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  11. package/build/index.js +1 -3
  12. package/build/index.js.map +1 -1
  13. package/build-module/components/editor/index.js +8 -0
  14. package/build-module/components/editor/index.js.map +1 -1
  15. package/build-module/components/global-styles/font-families.js +25 -19
  16. package/build-module/components/global-styles/font-families.js.map +1 -1
  17. package/build-module/components/sidebar-button/index.js +1 -1
  18. package/build-module/components/sidebar-button/index.js.map +1 -1
  19. package/build-module/components/site-hub/index.js +3 -2
  20. package/build-module/components/site-hub/index.js.map +1 -1
  21. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -0
  22. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  23. package/build-module/index.js +1 -3
  24. package/build-module/index.js.map +1 -1
  25. package/build-style/posts-rtl.css +37 -37
  26. package/build-style/posts.css +37 -37
  27. package/build-style/style-rtl.css +41 -39
  28. package/build-style/style.css +41 -39
  29. package/package.json +16 -16
  30. package/src/components/editor/index.js +9 -0
  31. package/src/components/global-styles/font-families.js +30 -21
  32. package/src/components/layout/style.scss +2 -2
  33. package/src/components/sidebar-button/index.js +1 -1
  34. package/src/components/sidebar-button/style.scss +2 -2
  35. package/src/components/sidebar-navigation-screen/style.scss +5 -1
  36. package/src/components/site-hub/index.js +2 -2
  37. package/src/components/site-hub/style.scss +4 -0
  38. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -0
  39. package/src/index.js +1 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "6.8.8",
3
+ "version": "6.8.10",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,20 +32,20 @@
32
32
  "@wordpress/a11y": "^4.8.2",
33
33
  "@wordpress/api-fetch": "^7.8.2",
34
34
  "@wordpress/blob": "^4.8.1",
35
- "@wordpress/block-editor": "^14.3.6",
36
- "@wordpress/block-library": "^9.8.7",
37
- "@wordpress/blocks": "^13.8.4",
38
- "@wordpress/commands": "^1.8.6",
39
- "@wordpress/components": "^28.8.6",
35
+ "@wordpress/block-editor": "^14.3.8",
36
+ "@wordpress/block-library": "^9.8.9",
37
+ "@wordpress/blocks": "^13.8.5",
38
+ "@wordpress/commands": "^1.8.7",
39
+ "@wordpress/components": "^28.8.7",
40
40
  "@wordpress/compose": "^7.8.3",
41
- "@wordpress/core-commands": "^1.8.6",
42
- "@wordpress/core-data": "^7.8.6",
41
+ "@wordpress/core-commands": "^1.8.8",
42
+ "@wordpress/core-data": "^7.8.8",
43
43
  "@wordpress/data": "^10.8.3",
44
- "@wordpress/dataviews": "^4.4.6",
44
+ "@wordpress/dataviews": "^4.4.7",
45
45
  "@wordpress/date": "^5.8.2",
46
46
  "@wordpress/deprecated": "^4.8.2",
47
47
  "@wordpress/dom": "^4.8.2",
48
- "@wordpress/editor": "^14.8.8",
48
+ "@wordpress/editor": "^14.8.10",
49
49
  "@wordpress/element": "^6.8.1",
50
50
  "@wordpress/escape-html": "^3.8.1",
51
51
  "@wordpress/hooks": "^4.8.2",
@@ -55,18 +55,18 @@
55
55
  "@wordpress/keyboard-shortcuts": "^5.8.3",
56
56
  "@wordpress/keycodes": "^4.8.2",
57
57
  "@wordpress/notices": "^5.8.3",
58
- "@wordpress/patterns": "^2.8.6",
59
- "@wordpress/plugins": "^7.8.6",
60
- "@wordpress/preferences": "^4.8.6",
58
+ "@wordpress/patterns": "^2.8.8",
59
+ "@wordpress/plugins": "^7.8.7",
60
+ "@wordpress/preferences": "^4.8.7",
61
61
  "@wordpress/primitives": "^4.8.1",
62
62
  "@wordpress/priority-queue": "^3.8.1",
63
63
  "@wordpress/private-apis": "^1.8.1",
64
- "@wordpress/reusable-blocks": "^5.8.6",
64
+ "@wordpress/reusable-blocks": "^5.8.8",
65
65
  "@wordpress/router": "^1.8.1",
66
66
  "@wordpress/style-engine": "^2.8.1",
67
67
  "@wordpress/url": "^4.8.1",
68
68
  "@wordpress/viewport": "^6.8.3",
69
- "@wordpress/widgets": "^4.8.6",
69
+ "@wordpress/widgets": "^4.8.8",
70
70
  "@wordpress/wordcount": "^4.8.1",
71
71
  "change-case": "^4.1.2",
72
72
  "clsx": "^2.1.1",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "b7af02f8431034ee19cdc33dd105d21705823eed"
85
+ "gitHead": "2453690ba117f1c1634e078f3a0b6a9ac47820ba"
86
86
  }
@@ -23,6 +23,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
23
23
  import { store as preferencesStore } from '@wordpress/preferences';
24
24
  import { decodeEntities } from '@wordpress/html-entities';
25
25
  import { Icon, arrowUpLeft } from '@wordpress/icons';
26
+ import { store as blockEditorStore } from '@wordpress/block-editor';
26
27
 
27
28
  /**
28
29
  * Internal dependencies
@@ -153,6 +154,9 @@ export default function EditSiteEditor( { isPostsList = false } ) {
153
154
  [ settings.styles, canvasMode, currentPostIsTrashed ]
154
155
  );
155
156
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
157
+ const { __unstableSetEditorMode, resetZoomLevel } = unlock(
158
+ useDispatch( blockEditorStore )
159
+ );
156
160
  const { createSuccessNotice } = useDispatch( noticesStore );
157
161
  const history = useHistory();
158
162
  const onActionPerformed = useCallback(
@@ -261,6 +265,11 @@ export default function EditSiteEditor( { isPostsList = false } ) {
261
265
  tooltipPosition="middle right"
262
266
  onClick={ () => {
263
267
  setCanvasMode( 'view' );
268
+ __unstableSetEditorMode(
269
+ 'edit'
270
+ );
271
+ resetZoomLevel();
272
+
264
273
  // TODO: this is a temporary solution to navigate to the posts list if we are
265
274
  // come here through `posts list` and are in focus mode editing a template, template part etc..
266
275
  if (
@@ -6,9 +6,11 @@ import {
6
6
  __experimentalText as Text,
7
7
  __experimentalItemGroup as ItemGroup,
8
8
  __experimentalVStack as VStack,
9
+ __experimentalHStack as HStack,
9
10
  Button,
10
11
  } from '@wordpress/components';
11
12
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
13
+ import { settings } from '@wordpress/icons';
12
14
  import { useContext } from '@wordpress/element';
13
15
 
14
16
  /**
@@ -67,10 +69,18 @@ function FontFamilies() {
67
69
  />
68
70
  ) }
69
71
 
70
- <VStack spacing={ 4 }>
72
+ <VStack spacing={ 2 }>
73
+ <HStack justify="space-between">
74
+ <Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>
75
+ <Button
76
+ onClick={ () => setModalTabOpen( 'installed-fonts' ) }
77
+ label={ __( 'Manage fonts' ) }
78
+ icon={ settings }
79
+ size="small"
80
+ />
81
+ </HStack>
71
82
  { activeFonts.length > 0 && (
72
83
  <>
73
- <Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>
74
84
  <ItemGroup size="large" isBordered isSeparated>
75
85
  { activeFonts.map( ( font ) => (
76
86
  <FontFamilyItem
@@ -82,31 +92,30 @@ function FontFamilies() {
82
92
  </>
83
93
  ) }
84
94
  { ! hasFonts && (
85
- <VStack>
86
- <Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>
95
+ <>
87
96
  <Text as="p">
88
97
  { hasInstalledFonts
89
98
  ? __( 'No fonts activated.' )
90
99
  : __( 'No fonts installed.' ) }
91
100
  </Text>
92
- </VStack>
101
+ <Button
102
+ className="edit-site-global-styles-font-families__manage-fonts"
103
+ variant="secondary"
104
+ __next40pxDefaultSize
105
+ onClick={ () => {
106
+ setModalTabOpen(
107
+ hasInstalledFonts
108
+ ? 'installed-fonts'
109
+ : 'upload-fonts'
110
+ );
111
+ } }
112
+ >
113
+ { hasInstalledFonts
114
+ ? __( 'Manage fonts' )
115
+ : __( 'Add fonts' ) }
116
+ </Button>
117
+ </>
93
118
  ) }
94
- <Button
95
- className="edit-site-global-styles-font-families__manage-fonts"
96
- variant="secondary"
97
- __next40pxDefaultSize
98
- onClick={ () => {
99
- setModalTabOpen(
100
- hasInstalledFonts
101
- ? 'installed-fonts'
102
- : 'upload-fonts'
103
- );
104
- } }
105
- >
106
- { hasInstalledFonts
107
- ? __( 'Manage fonts' )
108
- : __( 'Add fonts' ) }
109
- </Button>
110
119
  </VStack>
111
120
  </>
112
121
  );
@@ -206,8 +206,8 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
206
206
 
207
207
  .edit-site-layout__view-mode-toggle-icon {
208
208
  display: flex;
209
- height: $grid-unit-80;
210
- width: $grid-unit-80;
209
+ height: $header-height;
210
+ width: $header-height;
211
211
  justify-content: center;
212
212
  align-items: center;
213
213
  }
@@ -11,7 +11,7 @@ import { Button } from '@wordpress/components';
11
11
  export default function SidebarButton( props ) {
12
12
  return (
13
13
  <Button
14
- __next40pxDefaultSize
14
+ size="compact"
15
15
  { ...props }
16
16
  className={ clsx( 'edit-site-sidebar-button', props.className ) }
17
17
  />
@@ -14,10 +14,10 @@
14
14
  outline: 3px solid transparent;
15
15
  }
16
16
 
17
- &:hover,
17
+ &:hover:not(:disabled,[aria-disabled="true"]),
18
18
  &:focus-visible,
19
19
  &:focus,
20
- &:not([aria-disabled="true"]):active,
20
+ &:not(:disabled,[aria-disabled="true"]):active,
21
21
  &[aria-expanded="true"] {
22
22
  color: $gray-100;
23
23
  }
@@ -68,7 +68,11 @@
68
68
  .edit-site-sidebar-navigation-screen__title {
69
69
  flex-grow: 1;
70
70
  overflow-wrap: break-word;
71
- padding: $grid-unit-05 * 0.5 0 0 0;
71
+
72
+ &#{&},
73
+ &#{&} .edit-site-sidebar-navigation-screen__title {
74
+ line-height: 32px;
75
+ }
72
76
  }
73
77
 
74
78
  .edit-site-sidebar-navigation-screen__actions {
@@ -68,7 +68,7 @@ const SiteHub = memo(
68
68
  label={ __( 'Go to the Dashboard' ) }
69
69
  className="edit-site-layout__view-mode-toggle"
70
70
  style={ {
71
- transform: 'scale(0.5)',
71
+ transform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge
72
72
  borderRadius: 4,
73
73
  } }
74
74
  >
@@ -99,7 +99,7 @@ const SiteHub = memo(
99
99
  className="edit-site-site-hub__actions"
100
100
  >
101
101
  <Button
102
- __next40pxDefaultSize
102
+ size="compact"
103
103
  className="edit-site-site-hub_toggle-command-center"
104
104
  icon={ search }
105
105
  onClick={ () => openCommandCenter() }
@@ -4,6 +4,7 @@
4
4
  justify-content: space-between;
5
5
  gap: $grid-unit-10;
6
6
  margin-right: $grid-unit-15;
7
+ height: $grid-unit-70;
7
8
  }
8
9
 
9
10
  .edit-site-site-hub__actions {
@@ -29,6 +30,9 @@
29
30
  overflow: hidden;
30
31
  // Add space for the ↗ to render.
31
32
  padding-right: $grid-unit-20;
33
+
34
+ // Create 12px gap between site icon and site title
35
+ margin-left: - $grid-unit-05;
32
36
  position: relative;
33
37
  text-decoration: none;
34
38
  text-overflow: ellipsis;
@@ -5,6 +5,7 @@ import { useEffect, useMemo } from '@wordpress/element';
5
5
  import { useSelect, useDispatch } from '@wordpress/data';
6
6
  import { store as coreDataStore } from '@wordpress/core-data';
7
7
  import { privateApis as routerPrivateApis } from '@wordpress/router';
8
+ import { store as blockEditorStore } from '@wordpress/block-editor';
8
9
 
9
10
  /**
10
11
  * Internal dependencies
@@ -248,9 +249,14 @@ export default function useInitEditedEntityFromURL() {
248
249
  useResolveEditedEntityAndContext( params );
249
250
 
250
251
  const { setEditedEntity } = useDispatch( editSiteStore );
252
+ const { __unstableSetEditorMode, resetZoomLevel } = unlock(
253
+ useDispatch( blockEditorStore )
254
+ );
251
255
 
252
256
  useEffect( () => {
253
257
  if ( isReady ) {
258
+ __unstableSetEditorMode( 'edit' );
259
+ resetZoomLevel();
254
260
  setEditedEntity( postType, postId, context );
255
261
  }
256
262
  }, [ isReady, postType, postId, context, setEditedEntity ] );
package/src/index.js CHANGED
@@ -28,10 +28,7 @@ import { store as editSiteStore } from './store';
28
28
  import { unlock } from './lock-unlock';
29
29
  import App from './components/app';
30
30
 
31
- const {
32
- registerCoreBlockBindingsSources,
33
- bootstrapBlockBindingsSourcesFromServer,
34
- } = unlock( editorPrivateApis );
31
+ const { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );
35
32
 
36
33
  /**
37
34
  * Initializes the site editor screen.
@@ -48,7 +45,6 @@ export function initializeEditor( id, settings ) {
48
45
  ( { name } ) => name !== 'core/freeform'
49
46
  );
50
47
  registerCoreBlocks( coreBlocks );
51
- bootstrapBlockBindingsSourcesFromServer( settings?.blockBindingsSources );
52
48
  registerCoreBlockBindingsSources();
53
49
  dispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );
54
50
  registerLegacyWidgetBlock( { inserter: false } );