@wordpress/edit-site 6.30.0 → 6.30.1-next.6f42e1382.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "6.30.0",
3
+ "version": "6.30.1-next.6f42e1382.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,45 +30,45 @@
30
30
  "dependencies": {
31
31
  "@babel/runtime": "7.25.7",
32
32
  "@react-spring/web": "^9.4.5",
33
- "@wordpress/a11y": "^4.30.0",
34
- "@wordpress/api-fetch": "^7.30.0",
35
- "@wordpress/blob": "^4.30.0",
36
- "@wordpress/block-editor": "^15.3.0",
37
- "@wordpress/block-library": "^9.30.0",
38
- "@wordpress/blocks": "^15.3.0",
39
- "@wordpress/commands": "^1.30.0",
40
- "@wordpress/components": "^30.3.0",
41
- "@wordpress/compose": "^7.30.0",
42
- "@wordpress/core-data": "^7.30.0",
43
- "@wordpress/data": "^10.30.0",
44
- "@wordpress/dataviews": "^8.0.0",
45
- "@wordpress/date": "^5.30.0",
46
- "@wordpress/deprecated": "^4.30.0",
47
- "@wordpress/dom": "^4.30.0",
48
- "@wordpress/editor": "^14.30.0",
49
- "@wordpress/element": "^6.30.0",
50
- "@wordpress/escape-html": "^3.30.0",
51
- "@wordpress/fields": "^0.22.0",
52
- "@wordpress/hooks": "^4.30.0",
53
- "@wordpress/html-entities": "^4.30.0",
54
- "@wordpress/i18n": "^6.3.0",
55
- "@wordpress/icons": "^10.30.0",
56
- "@wordpress/keyboard-shortcuts": "^5.30.0",
57
- "@wordpress/keycodes": "^4.30.0",
58
- "@wordpress/media-utils": "^5.30.0",
59
- "@wordpress/notices": "^5.30.0",
60
- "@wordpress/patterns": "^2.30.0",
61
- "@wordpress/plugins": "^7.30.0",
62
- "@wordpress/preferences": "^4.30.0",
63
- "@wordpress/primitives": "^4.30.0",
64
- "@wordpress/private-apis": "^1.30.0",
65
- "@wordpress/reusable-blocks": "^5.30.0",
66
- "@wordpress/router": "^1.30.0",
67
- "@wordpress/style-engine": "^2.30.0",
68
- "@wordpress/url": "^4.30.0",
69
- "@wordpress/viewport": "^6.30.0",
70
- "@wordpress/widgets": "^4.30.0",
71
- "@wordpress/wordcount": "^4.30.0",
33
+ "@wordpress/a11y": "^4.30.1-next.6f42e1382.0",
34
+ "@wordpress/api-fetch": "^7.30.1-next.6f42e1382.0",
35
+ "@wordpress/blob": "^4.30.1-next.6f42e1382.0",
36
+ "@wordpress/block-editor": "^15.3.1-next.6f42e1382.0",
37
+ "@wordpress/block-library": "^9.30.1-next.6f42e1382.0",
38
+ "@wordpress/blocks": "^15.3.1-next.6f42e1382.0",
39
+ "@wordpress/commands": "^1.30.1-next.6f42e1382.0",
40
+ "@wordpress/components": "^30.3.2-next.6f42e1382.0",
41
+ "@wordpress/compose": "^7.30.1-next.6f42e1382.0",
42
+ "@wordpress/core-data": "^7.30.1-next.6f42e1382.0",
43
+ "@wordpress/data": "^10.30.1-next.6f42e1382.0",
44
+ "@wordpress/dataviews": "^9.0.1-next.6f42e1382.0",
45
+ "@wordpress/date": "^5.30.1-next.6f42e1382.0",
46
+ "@wordpress/deprecated": "^4.30.1-next.6f42e1382.0",
47
+ "@wordpress/dom": "^4.30.1-next.6f42e1382.0",
48
+ "@wordpress/editor": "^14.30.1-next.6f42e1382.0",
49
+ "@wordpress/element": "^6.30.1-next.6f42e1382.0",
50
+ "@wordpress/escape-html": "^3.30.1-next.6f42e1382.0",
51
+ "@wordpress/fields": "^0.22.1-next.6f42e1382.0",
52
+ "@wordpress/hooks": "^4.30.1-next.6f42e1382.0",
53
+ "@wordpress/html-entities": "^4.30.1-next.6f42e1382.0",
54
+ "@wordpress/i18n": "^6.3.1-next.6f42e1382.0",
55
+ "@wordpress/icons": "^10.30.1-next.6f42e1382.0",
56
+ "@wordpress/keyboard-shortcuts": "^5.30.1-next.6f42e1382.0",
57
+ "@wordpress/keycodes": "^4.30.1-next.6f42e1382.0",
58
+ "@wordpress/media-utils": "^5.30.1-next.6f42e1382.0",
59
+ "@wordpress/notices": "^5.30.1-next.6f42e1382.0",
60
+ "@wordpress/patterns": "^2.30.1-next.6f42e1382.0",
61
+ "@wordpress/plugins": "^7.30.1-next.6f42e1382.0",
62
+ "@wordpress/preferences": "^4.30.1-next.6f42e1382.0",
63
+ "@wordpress/primitives": "^4.30.1-next.6f42e1382.0",
64
+ "@wordpress/private-apis": "^1.30.1-next.6f42e1382.0",
65
+ "@wordpress/reusable-blocks": "^5.30.1-next.6f42e1382.0",
66
+ "@wordpress/router": "^1.30.1-next.6f42e1382.0",
67
+ "@wordpress/style-engine": "^2.30.1-next.6f42e1382.0",
68
+ "@wordpress/url": "^4.30.1-next.6f42e1382.0",
69
+ "@wordpress/viewport": "^6.30.1-next.6f42e1382.0",
70
+ "@wordpress/widgets": "^4.30.1-next.6f42e1382.0",
71
+ "@wordpress/wordcount": "^4.30.1-next.6f42e1382.0",
72
72
  "change-case": "^4.1.2",
73
73
  "clsx": "^2.1.1",
74
74
  "colord": "^2.9.2",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "c66cb089eed19d4f4956962fa7b4c81abe6dd513"
86
+ "gitHead": "8806899f598577a3c90a55d9aa79fbc372fe1e75"
87
87
  }
@@ -16,7 +16,6 @@ import { isRTL, __ } from '@wordpress/i18n';
16
16
  import { chevronLeft, chevronRight } from '@wordpress/icons';
17
17
  import { useSelect } from '@wordpress/data';
18
18
  import { store as coreStore } from '@wordpress/core-data';
19
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
20
19
 
21
20
  /**
22
21
  * Internal dependencies
@@ -25,13 +24,8 @@ import { IconWithCurrentColor } from './icon-with-current-color';
25
24
  import { NavigationButtonAsItem } from './navigation-button';
26
25
  import RootMenu from './root-menu';
27
26
  import PreviewStyles from './preview-styles';
28
- import { unlock } from '../../lock-unlock';
29
-
30
- const { useGlobalStyle } = unlock( blockEditorPrivateApis );
31
27
 
32
28
  function ScreenRoot() {
33
- const [ customCSS ] = useGlobalStyle( 'css' );
34
-
35
29
  const { hasVariations, canEditCSS } = useSelect( ( select ) => {
36
30
  const {
37
31
  getEntityRecord,
@@ -116,7 +110,7 @@ function ScreenRoot() {
116
110
  </ItemGroup>
117
111
  </CardBody>
118
112
 
119
- { canEditCSS && !! customCSS && (
113
+ { canEditCSS && (
120
114
  <>
121
115
  <CardDivider />
122
116
  <CardBody>
@@ -200,7 +200,6 @@ function getItemLevel( item ) {
200
200
 
201
201
  export default function PostList( { postType } ) {
202
202
  const [ view, setView ] = useView( postType );
203
- const defaultViews = useDefaultViews( { postType } );
204
203
  const history = useHistory();
205
204
  const location = useLocation();
206
205
  const {
@@ -266,7 +265,7 @@ export default function PostList( { postType } ) {
266
265
  search: view.search,
267
266
  ...filters,
268
267
  };
269
- }, [ view, activeView, defaultViews ] );
268
+ }, [ view ] );
270
269
  const {
271
270
  records,
272
271
  isResolving: isLoadingData,
@@ -4,16 +4,8 @@
4
4
  import { useMemo } from '@wordpress/element';
5
5
  import { useDispatch, useSelect } from '@wordpress/data';
6
6
  import { __, isRTL } from '@wordpress/i18n';
7
- import {
8
- rotateLeft,
9
- rotateRight,
10
- backup,
11
- help,
12
- styles,
13
- external,
14
- brush,
15
- } from '@wordpress/icons';
16
- import { useCommandLoader, useCommand } from '@wordpress/commands';
7
+ import { rotateLeft, rotateRight, help, backup } from '@wordpress/icons';
8
+ import { useCommandLoader } from '@wordpress/commands';
17
9
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
18
10
  import { privateApis as routerPrivateApis } from '@wordpress/router';
19
11
  import { store as preferencesStore } from '@wordpress/preferences';
@@ -28,45 +20,6 @@ import { store as editSiteStore } from '../../store';
28
20
  const { useGlobalStylesReset } = unlock( blockEditorPrivateApis );
29
21
  const { useHistory, useLocation } = unlock( routerPrivateApis );
30
22
 
31
- const getGlobalStylesOpenStylesCommands = () =>
32
- function useGlobalStylesOpenStylesCommands() {
33
- const { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );
34
- const { params } = useLocation();
35
- const { canvas = 'view' } = params;
36
- const history = useHistory();
37
- const isBlockBasedTheme = useSelect( ( select ) => {
38
- return select( coreStore ).getCurrentTheme().is_block_theme;
39
- }, [] );
40
-
41
- const commands = useMemo( () => {
42
- if ( ! isBlockBasedTheme ) {
43
- return [];
44
- }
45
-
46
- return [
47
- {
48
- name: 'core/edit-site/open-styles',
49
- label: __( 'Open styles' ),
50
- callback: ( { close } ) => {
51
- close();
52
- if ( canvas !== 'edit' ) {
53
- history.navigate( '/styles?canvas=edit', {
54
- transition: 'canvas-mode-edit-transition',
55
- } );
56
- }
57
- openGeneralSidebar( 'edit-site/global-styles' );
58
- },
59
- icon: styles,
60
- },
61
- ];
62
- }, [ history, openGeneralSidebar, canvas, isBlockBasedTheme ] );
63
-
64
- return {
65
- isLoading: false,
66
- commands,
67
- };
68
- };
69
-
70
23
  const getGlobalStylesToggleWelcomeGuideCommands = () =>
71
24
  function useGlobalStylesToggleWelcomeGuideCommands() {
72
25
  const { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );
@@ -141,63 +94,6 @@ const getGlobalStylesResetCommands = () =>
141
94
  };
142
95
  };
143
96
 
144
- const getGlobalStylesOpenCssCommands = () =>
145
- function useGlobalStylesOpenCssCommands() {
146
- const { openGeneralSidebar, setEditorCanvasContainerView } = unlock(
147
- useDispatch( editSiteStore )
148
- );
149
- const { params } = useLocation();
150
- const { canvas = 'view' } = params;
151
- const history = useHistory();
152
- const { canEditCSS } = useSelect( ( select ) => {
153
- const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =
154
- select( coreStore );
155
-
156
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
157
- const globalStyles = globalStylesId
158
- ? getEntityRecord( 'root', 'globalStyles', globalStylesId )
159
- : undefined;
160
-
161
- return {
162
- canEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],
163
- };
164
- }, [] );
165
-
166
- const commands = useMemo( () => {
167
- if ( ! canEditCSS ) {
168
- return [];
169
- }
170
-
171
- return [
172
- {
173
- name: 'core/edit-site/open-styles-css',
174
- label: __( 'Customize CSS' ),
175
- icon: brush,
176
- callback: ( { close } ) => {
177
- close();
178
- if ( canvas !== 'edit' ) {
179
- history.navigate( '/styles?canvas=edit', {
180
- transition: 'canvas-mode-edit-transition',
181
- } );
182
- }
183
- openGeneralSidebar( 'edit-site/global-styles' );
184
- setEditorCanvasContainerView( 'global-styles-css' );
185
- },
186
- },
187
- ];
188
- }, [
189
- history,
190
- openGeneralSidebar,
191
- setEditorCanvasContainerView,
192
- canEditCSS,
193
- canvas,
194
- ] );
195
- return {
196
- isLoading: false,
197
- commands,
198
- };
199
- };
200
-
201
97
  const getGlobalStylesOpenRevisionsCommands = () =>
202
98
  function useGlobalStylesOpenRevisionsCommands() {
203
99
  const { openGeneralSidebar, setEditorCanvasContainerView } = unlock(
@@ -213,6 +109,7 @@ const getGlobalStylesOpenRevisionsCommands = () =>
213
109
  const globalStyles = globalStylesId
214
110
  ? getEntityRecord( 'root', 'globalStyles', globalStylesId )
215
111
  : undefined;
112
+
216
113
  return !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;
217
114
  }, [] );
218
115
 
@@ -223,8 +120,8 @@ const getGlobalStylesOpenRevisionsCommands = () =>
223
120
 
224
121
  return [
225
122
  {
226
- name: 'core/edit-site/open-global-styles-revisions',
227
- label: __( 'Style revisions' ),
123
+ name: 'core/edit-site/open-styles-revisions',
124
+ label: __( 'Open style revisions' ),
228
125
  icon: backup,
229
126
  callback: ( { close } ) => {
230
127
  close();
@@ -241,10 +138,10 @@ const getGlobalStylesOpenRevisionsCommands = () =>
241
138
  },
242
139
  ];
243
140
  }, [
244
- hasRevisions,
245
141
  history,
246
142
  openGeneralSidebar,
247
143
  setEditorCanvasContainerView,
144
+ hasRevisions,
248
145
  canvas,
249
146
  ] );
250
147
 
@@ -255,27 +152,6 @@ const getGlobalStylesOpenRevisionsCommands = () =>
255
152
  };
256
153
 
257
154
  export function useCommonCommands() {
258
- const homeUrl = useSelect( ( select ) => {
259
- // Site index.
260
- return select( coreStore ).getEntityRecord( 'root', '__unstableBase' )
261
- ?.home;
262
- }, [] );
263
-
264
- useCommand( {
265
- name: 'core/edit-site/view-site',
266
- label: __( 'View site' ),
267
- callback: ( { close } ) => {
268
- close();
269
- window.open( homeUrl, '_blank' );
270
- },
271
- icon: external,
272
- } );
273
-
274
- useCommandLoader( {
275
- name: 'core/edit-site/open-styles',
276
- hook: getGlobalStylesOpenStylesCommands(),
277
- } );
278
-
279
155
  useCommandLoader( {
280
156
  name: 'core/edit-site/toggle-styles-welcome-guide',
281
157
  hook: getGlobalStylesToggleWelcomeGuideCommands(),
@@ -286,11 +162,6 @@ export function useCommonCommands() {
286
162
  hook: getGlobalStylesResetCommands(),
287
163
  } );
288
164
 
289
- useCommandLoader( {
290
- name: 'core/edit-site/open-styles-css',
291
- hook: getGlobalStylesOpenCssCommands(),
292
- } );
293
-
294
165
  useCommandLoader( {
295
166
  name: 'core/edit-site/open-styles-revisions',
296
167
  hook: getGlobalStylesOpenRevisionsCommands(),