@wordpress/edit-site 6.30.1-next.6870dfe5b.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.
@@ -30,46 +30,6 @@ const {
30
30
  useHistory,
31
31
  useLocation
32
32
  } = (0, _lockUnlock.unlock)(_router.privateApis);
33
- const getGlobalStylesOpenStylesCommands = () => function useGlobalStylesOpenStylesCommands() {
34
- const {
35
- openGeneralSidebar
36
- } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
37
- const {
38
- params
39
- } = useLocation();
40
- const {
41
- canvas = 'view'
42
- } = params;
43
- const history = useHistory();
44
- const isBlockBasedTheme = (0, _data.useSelect)(select => {
45
- return select(_coreData.store).getCurrentTheme().is_block_theme;
46
- }, []);
47
- const commands = (0, _element.useMemo)(() => {
48
- if (!isBlockBasedTheme) {
49
- return [];
50
- }
51
- return [{
52
- name: 'core/edit-site/open-styles',
53
- label: (0, _i18n.__)('Open styles'),
54
- callback: ({
55
- close
56
- }) => {
57
- close();
58
- if (canvas !== 'edit') {
59
- history.navigate('/styles?canvas=edit', {
60
- transition: 'canvas-mode-edit-transition'
61
- });
62
- }
63
- openGeneralSidebar('edit-site/global-styles');
64
- },
65
- icon: _icons.styles
66
- }];
67
- }, [history, openGeneralSidebar, canvas, isBlockBasedTheme]);
68
- return {
69
- isLoading: false,
70
- commands
71
- };
72
- };
73
33
  const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStylesToggleWelcomeGuideCommands() {
74
34
  const {
75
35
  openGeneralSidebar
@@ -142,58 +102,6 @@ const getGlobalStylesResetCommands = () => function useGlobalStylesResetCommands
142
102
  commands
143
103
  };
144
104
  };
145
- const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssCommands() {
146
- const {
147
- openGeneralSidebar,
148
- setEditorCanvasContainerView
149
- } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
150
- const {
151
- params
152
- } = useLocation();
153
- const {
154
- canvas = 'view'
155
- } = params;
156
- const history = useHistory();
157
- const {
158
- canEditCSS
159
- } = (0, _data.useSelect)(select => {
160
- const {
161
- getEntityRecord,
162
- __experimentalGetCurrentGlobalStylesId
163
- } = select(_coreData.store);
164
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
165
- const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
166
- return {
167
- canEditCSS: !!globalStyles?._links?.['wp:action-edit-css']
168
- };
169
- }, []);
170
- const commands = (0, _element.useMemo)(() => {
171
- if (!canEditCSS) {
172
- return [];
173
- }
174
- return [{
175
- name: 'core/edit-site/open-styles-css',
176
- label: (0, _i18n.__)('Customize CSS'),
177
- icon: _icons.brush,
178
- callback: ({
179
- close
180
- }) => {
181
- close();
182
- if (canvas !== 'edit') {
183
- history.navigate('/styles?canvas=edit', {
184
- transition: 'canvas-mode-edit-transition'
185
- });
186
- }
187
- openGeneralSidebar('edit-site/global-styles');
188
- setEditorCanvasContainerView('global-styles-css');
189
- }
190
- }];
191
- }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, canvas]);
192
- return {
193
- isLoading: false,
194
- commands
195
- };
196
- };
197
105
  const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenRevisionsCommands() {
198
106
  const {
199
107
  openGeneralSidebar,
@@ -220,8 +128,8 @@ const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenR
220
128
  return [];
221
129
  }
222
130
  return [{
223
- name: 'core/edit-site/open-global-styles-revisions',
224
- label: (0, _i18n.__)('Style revisions'),
131
+ name: 'core/edit-site/open-styles-revisions',
132
+ label: (0, _i18n.__)('Open style revisions'),
225
133
  icon: _icons.backup,
226
134
  callback: ({
227
135
  close
@@ -236,32 +144,13 @@ const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenR
236
144
  setEditorCanvasContainerView('global-styles-revisions');
237
145
  }
238
146
  }];
239
- }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, canvas]);
147
+ }, [history, openGeneralSidebar, setEditorCanvasContainerView, hasRevisions, canvas]);
240
148
  return {
241
149
  isLoading: false,
242
150
  commands
243
151
  };
244
152
  };
245
153
  function useCommonCommands() {
246
- const homeUrl = (0, _data.useSelect)(select => {
247
- // Site index.
248
- return select(_coreData.store).getEntityRecord('root', '__unstableBase')?.home;
249
- }, []);
250
- (0, _commands.useCommand)({
251
- name: 'core/edit-site/view-site',
252
- label: (0, _i18n.__)('View site'),
253
- callback: ({
254
- close
255
- }) => {
256
- close();
257
- window.open(homeUrl, '_blank');
258
- },
259
- icon: _icons.external
260
- });
261
- (0, _commands.useCommandLoader)({
262
- name: 'core/edit-site/open-styles',
263
- hook: getGlobalStylesOpenStylesCommands()
264
- });
265
154
  (0, _commands.useCommandLoader)({
266
155
  name: 'core/edit-site/toggle-styles-welcome-guide',
267
156
  hook: getGlobalStylesToggleWelcomeGuideCommands()
@@ -270,10 +159,6 @@ function useCommonCommands() {
270
159
  name: 'core/edit-site/reset-global-styles',
271
160
  hook: getGlobalStylesResetCommands()
272
161
  });
273
- (0, _commands.useCommandLoader)({
274
- name: 'core/edit-site/open-styles-css',
275
- hook: getGlobalStylesOpenCssCommands()
276
- });
277
162
  (0, _commands.useCommandLoader)({
278
163
  name: 'core/edit-site/open-styles-revisions',
279
164
  hook: getGlobalStylesOpenRevisionsCommands()
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_i18n","_icons","_commands","_blockEditor","_router","_preferences","_coreData","_lockUnlock","_store","useGlobalStylesReset","unlock","blockEditorPrivateApis","useHistory","useLocation","routerPrivateApis","getGlobalStylesOpenStylesCommands","useGlobalStylesOpenStylesCommands","openGeneralSidebar","useDispatch","editSiteStore","params","canvas","history","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","commands","useMemo","name","label","__","callback","close","navigate","transition","icon","styles","isLoading","getGlobalStylesToggleWelcomeGuideCommands","useGlobalStylesToggleWelcomeGuideCommands","set","preferencesStore","setTimeout","help","getGlobalStylesResetCommands","useGlobalStylesResetCommands","canReset","onReset","isRTL","rotateRight","rotateLeft","getGlobalStylesOpenCssCommands","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","canEditCSS","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","brush","getGlobalStylesOpenRevisionsCommands","useGlobalStylesOpenRevisionsCommands","hasRevisions","count","backup","useCommonCommands","homeUrl","home","useCommand","window","open","external","useCommandLoader","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\trotateLeft,\n\trotateRight,\n\tbackup,\n\thelp,\n\tstyles,\n\texternal,\n\tbrush,\n} from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst getGlobalStylesOpenStylesCommands = () =>\n\tfunction useGlobalStylesOpenStylesCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t},\n\t\t\t\t\ticon: styles,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ history, openGeneralSidebar, canvas, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesToggleWelcomeGuideCommands = () =>\n\tfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst { set } = useDispatch( preferencesStore );\n\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t}, 500 );\n\t\t\t\t\t},\n\t\t\t\t\ticon: help,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ history, openGeneralSidebar, canvas, isBlockBasedTheme, set ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesResetCommands = () =>\n\tfunction useGlobalStylesResetCommands() {\n\t\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canReset ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tonReset();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ canReset, onReset ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenCssCommands = () =>\n\tfunction useGlobalStylesOpenCssCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t\t};\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canEditCSS ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\t\ticon: brush,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\tcanEditCSS,\n\t\t\tcanvas,\n\t\t] );\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenRevisionsCommands = () =>\n\tfunction useGlobalStylesOpenRevisionsCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst hasRevisions = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! hasRevisions ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\t\ticon: backup,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thasRevisions,\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\tcanvas,\n\t\t] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: getGlobalStylesOpenStylesCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: getGlobalStylesToggleWelcomeGuideCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: getGlobalStylesResetCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: getGlobalStylesOpenCssCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: getGlobalStylesOpenRevisionsCommands(),\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AASA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAzBA;AACA;AACA;;AAmBA;AACA;AACA;;AAIA,MAAM;EAAEW;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACjE,MAAM;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAG,IAAAH,kBAAM,EAAEI,mBAAkB,CAAC;AAE/D,MAAMC,iCAAiC,GAAGA,CAAA,KACzC,SAASC,iCAAiCA,CAAA,EAAG;EAC5C,MAAM;IAAEC;EAAmB,CAAC,GAAG,I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M,IAAM;IACxC;IACA,OAAOA,MAAM,CAAEC,eAAU,CAAC,CAACgC,eAAe,CAAE,MAAM,EAAE,gBAAiB,CAAC,EACnEc,IAAI;EACR,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAC,oBAAU,EAAE;IACX1C,IAAI,EAAE,0BAA0B;IAChCC,KAAK,EAAE,IAAAC,QAAE,EAAE,WAAY,CAAC;IACxBC,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACPuC,MAAM,CAACC,IAAI,CAAEJ,OAAO,EAAE,QAAS,CAAC;IACjC,CAAC;IACDjC,IAAI,EAAEsC;EACP,CAAE,CAAC;EAEH,IAAAC,0BAAgB,EAAE;IACjB9C,IAAI,EAAE,4BAA4B;IAClC+C,IAAI,EAAE/D,iCAAiC,CAAC;EACzC,CAAE,CAAC;EAEH,IAAA8D,0BAAgB,EAAE;IACjB9C,IAAI,EAAE,4CAA4C;IAClD+C,IAAI,EAAErC,yCAAyC,CAAC;EACjD,CAAE,CAAC;EAEH,IAAAoC,0BAAgB,EAAE;IACjB9C,IAAI,EAAE,oCAAoC;IAC1C+C,IAAI,EAAE/B,4BAA4B,CAAC;EACpC,CAAE,CAAC;EAEH,IAAA8B,0BAAgB,EAAE;IACjB9C,IAAI,EAAE,gCAAgC;IACtC+C,IAAI,EAAExB,8BAA8B,CAAC;EACtC,CAAE,CAAC;EAEH,IAAAuB,0BAAgB,EAAE;IACjB9C,IAAI,EAAE,sCAAsC;IAC5C+C,IAAI,EAAEb,oCAAoC,CAAC;EAC5C,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_i18n","_icons","_commands","_blockEditor","_router","_preferences","_coreData","_lockUnlock","_store","useGlobalStylesReset","unlock","blockEditorPrivateApis","useHistory","useLocation","routerPrivateApis","getGlobalStylesToggleWelcomeGuideCommands","useGlobalStylesToggleWelcomeGuideCommands","openGeneralSidebar","useDispatch","editSiteStore","params","canvas","set","preferencesStore","history","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","commands","useMemo","name","label","__","callback","close","navigate","transition","setTimeout","icon","help","isLoading","getGlobalStylesResetCommands","useGlobalStylesResetCommands","canReset","onReset","isRTL","rotateRight","rotateLeft","getGlobalStylesOpenRevisionsCommands","useGlobalStylesOpenRevisionsCommands","setEditorCanvasContainerView","hasRevisions","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","backup","useCommonCommands","useCommandLoader","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { rotateLeft, rotateRight, help, backup } from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst getGlobalStylesToggleWelcomeGuideCommands = () =>\n\tfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst { set } = useDispatch( preferencesStore );\n\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t}, 500 );\n\t\t\t\t\t},\n\t\t\t\t\ticon: help,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ history, openGeneralSidebar, canvas, isBlockBasedTheme, set ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesResetCommands = () =>\n\tfunction useGlobalStylesResetCommands() {\n\t\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canReset ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tonReset();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ canReset, onReset ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenRevisionsCommands = () =>\n\tfunction useGlobalStylesOpenRevisionsCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst hasRevisions = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\n\t\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! hasRevisions ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles-revisions',\n\t\t\t\t\tlabel: __( 'Open style revisions' ),\n\t\t\t\t\ticon: backup,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\thasRevisions,\n\t\t\tcanvas,\n\t\t] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useCommonCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: getGlobalStylesToggleWelcomeGuideCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: getGlobalStylesResetCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: getGlobalStylesOpenRevisionsCommands(),\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAjBA;AACA;AACA;;AAWA;AACA;AACA;;AAIA,MAAM;EAAEW;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACjE,MAAM;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAG,IAAAH,kBAAM,EAAEI,mBAAkB,CAAC;AAE/D,MAAMC,yCAAyC,GAAGA,CAAA,KACjD,SAASC,yCAAyCA,CAAA,EAAG;EACpD,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAP,kBAAM,EAAE,IAAAQ,iBAAW,EAAEC,YAAc,CAAE,CAAC;EACrE,MAAM;IAAEC;EAAO,CAAC,GAAGP,WAAW,CAAC,CAAC;EAChC,MAAM;IAAEQ,MAAM,GAAG;EAAO,CAAC,G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@ -4,8 +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 { rotateLeft, rotateRight, backup, help, styles, external, brush } from '@wordpress/icons';
8
- import { useCommandLoader, useCommand } from '@wordpress/commands';
7
+ import { rotateLeft, rotateRight, help, backup } from '@wordpress/icons';
8
+ import { useCommandLoader } from '@wordpress/commands';
9
9
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
10
10
  import { privateApis as routerPrivateApis } from '@wordpress/router';
11
11
  import { store as preferencesStore } from '@wordpress/preferences';
@@ -23,46 +23,6 @@ const {
23
23
  useHistory,
24
24
  useLocation
25
25
  } = unlock(routerPrivateApis);
26
- const getGlobalStylesOpenStylesCommands = () => function useGlobalStylesOpenStylesCommands() {
27
- const {
28
- openGeneralSidebar
29
- } = unlock(useDispatch(editSiteStore));
30
- const {
31
- params
32
- } = useLocation();
33
- const {
34
- canvas = 'view'
35
- } = params;
36
- const history = useHistory();
37
- const isBlockBasedTheme = useSelect(select => {
38
- return select(coreStore).getCurrentTheme().is_block_theme;
39
- }, []);
40
- const commands = useMemo(() => {
41
- if (!isBlockBasedTheme) {
42
- return [];
43
- }
44
- return [{
45
- name: 'core/edit-site/open-styles',
46
- label: __('Open styles'),
47
- callback: ({
48
- close
49
- }) => {
50
- close();
51
- if (canvas !== 'edit') {
52
- history.navigate('/styles?canvas=edit', {
53
- transition: 'canvas-mode-edit-transition'
54
- });
55
- }
56
- openGeneralSidebar('edit-site/global-styles');
57
- },
58
- icon: styles
59
- }];
60
- }, [history, openGeneralSidebar, canvas, isBlockBasedTheme]);
61
- return {
62
- isLoading: false,
63
- commands
64
- };
65
- };
66
26
  const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStylesToggleWelcomeGuideCommands() {
67
27
  const {
68
28
  openGeneralSidebar
@@ -135,58 +95,6 @@ const getGlobalStylesResetCommands = () => function useGlobalStylesResetCommands
135
95
  commands
136
96
  };
137
97
  };
138
- const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssCommands() {
139
- const {
140
- openGeneralSidebar,
141
- setEditorCanvasContainerView
142
- } = unlock(useDispatch(editSiteStore));
143
- const {
144
- params
145
- } = useLocation();
146
- const {
147
- canvas = 'view'
148
- } = params;
149
- const history = useHistory();
150
- const {
151
- canEditCSS
152
- } = useSelect(select => {
153
- const {
154
- getEntityRecord,
155
- __experimentalGetCurrentGlobalStylesId
156
- } = select(coreStore);
157
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
158
- const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
159
- return {
160
- canEditCSS: !!globalStyles?._links?.['wp:action-edit-css']
161
- };
162
- }, []);
163
- const commands = useMemo(() => {
164
- if (!canEditCSS) {
165
- return [];
166
- }
167
- return [{
168
- name: 'core/edit-site/open-styles-css',
169
- label: __('Customize CSS'),
170
- icon: brush,
171
- callback: ({
172
- close
173
- }) => {
174
- close();
175
- if (canvas !== 'edit') {
176
- history.navigate('/styles?canvas=edit', {
177
- transition: 'canvas-mode-edit-transition'
178
- });
179
- }
180
- openGeneralSidebar('edit-site/global-styles');
181
- setEditorCanvasContainerView('global-styles-css');
182
- }
183
- }];
184
- }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, canvas]);
185
- return {
186
- isLoading: false,
187
- commands
188
- };
189
- };
190
98
  const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenRevisionsCommands() {
191
99
  const {
192
100
  openGeneralSidebar,
@@ -213,8 +121,8 @@ const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenR
213
121
  return [];
214
122
  }
215
123
  return [{
216
- name: 'core/edit-site/open-global-styles-revisions',
217
- label: __('Style revisions'),
124
+ name: 'core/edit-site/open-styles-revisions',
125
+ label: __('Open style revisions'),
218
126
  icon: backup,
219
127
  callback: ({
220
128
  close
@@ -229,32 +137,13 @@ const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenR
229
137
  setEditorCanvasContainerView('global-styles-revisions');
230
138
  }
231
139
  }];
232
- }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, canvas]);
140
+ }, [history, openGeneralSidebar, setEditorCanvasContainerView, hasRevisions, canvas]);
233
141
  return {
234
142
  isLoading: false,
235
143
  commands
236
144
  };
237
145
  };
238
146
  export function useCommonCommands() {
239
- const homeUrl = useSelect(select => {
240
- // Site index.
241
- return select(coreStore).getEntityRecord('root', '__unstableBase')?.home;
242
- }, []);
243
- useCommand({
244
- name: 'core/edit-site/view-site',
245
- label: __('View site'),
246
- callback: ({
247
- close
248
- }) => {
249
- close();
250
- window.open(homeUrl, '_blank');
251
- },
252
- icon: external
253
- });
254
- useCommandLoader({
255
- name: 'core/edit-site/open-styles',
256
- hook: getGlobalStylesOpenStylesCommands()
257
- });
258
147
  useCommandLoader({
259
148
  name: 'core/edit-site/toggle-styles-welcome-guide',
260
149
  hook: getGlobalStylesToggleWelcomeGuideCommands()
@@ -263,10 +152,6 @@ export function useCommonCommands() {
263
152
  name: 'core/edit-site/reset-global-styles',
264
153
  hook: getGlobalStylesResetCommands()
265
154
  });
266
- useCommandLoader({
267
- name: 'core/edit-site/open-styles-css',
268
- hook: getGlobalStylesOpenCssCommands()
269
- });
270
155
  useCommandLoader({
271
156
  name: 'core/edit-site/open-styles-revisions',
272
157
  hook: getGlobalStylesOpenRevisionsCommands()
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useDispatch","useSelect","__","isRTL","rotateLeft","rotateRight","backup","help","styles","external","brush","useCommandLoader","useCommand","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","unlock","editSiteStore","useGlobalStylesReset","useHistory","useLocation","getGlobalStylesOpenStylesCommands","useGlobalStylesOpenStylesCommands","openGeneralSidebar","params","canvas","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","navigate","transition","icon","isLoading","getGlobalStylesToggleWelcomeGuideCommands","useGlobalStylesToggleWelcomeGuideCommands","set","setTimeout","getGlobalStylesResetCommands","useGlobalStylesResetCommands","canReset","onReset","getGlobalStylesOpenCssCommands","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","canEditCSS","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","getGlobalStylesOpenRevisionsCommands","useGlobalStylesOpenRevisionsCommands","hasRevisions","count","useCommonCommands","homeUrl","home","window","open","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\trotateLeft,\n\trotateRight,\n\tbackup,\n\thelp,\n\tstyles,\n\texternal,\n\tbrush,\n} from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst getGlobalStylesOpenStylesCommands = () =>\n\tfunction useGlobalStylesOpenStylesCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t},\n\t\t\t\t\ticon: styles,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ history, openGeneralSidebar, canvas, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesToggleWelcomeGuideCommands = () =>\n\tfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst { set } = useDispatch( preferencesStore );\n\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t}, 500 );\n\t\t\t\t\t},\n\t\t\t\t\ticon: help,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ history, openGeneralSidebar, canvas, isBlockBasedTheme, set ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesResetCommands = () =>\n\tfunction useGlobalStylesResetCommands() {\n\t\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canReset ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tonReset();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ canReset, onReset ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenCssCommands = () =>\n\tfunction useGlobalStylesOpenCssCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t\t};\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canEditCSS ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\t\ticon: brush,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\tcanEditCSS,\n\t\t\tcanvas,\n\t\t] );\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenRevisionsCommands = () =>\n\tfunction useGlobalStylesOpenRevisionsCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst hasRevisions = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! hasRevisions ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\t\ticon: backup,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thasRevisions,\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\tcanvas,\n\t\t] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: getGlobalStylesOpenStylesCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: getGlobalStylesToggleWelcomeGuideCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: getGlobalStylesResetCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: getGlobalStylesOpenCssCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: getGlobalStylesOpenRevisionsCommands(),\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SACCC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,QAAQ,EACRC,KAAK,QACC,kBAAkB;AACzB,SAASC,gBAAgB,EAAEC,UAAU,QAAQ,qBAAqB;AAClE,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AAEpD,MAAM;EAAEC;AAAqB,CAAC,GAAGF,MAAM,CAAEL,sBAAuB,CAAC;AACjE,MAAM;EAAEQ,UAAU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O,GAAGjE,SAAS,CAAI8B,MAAM,IAAM;IACxC;IACA,OAAOA,MAAM,CAAEb,SAAU,CAAC,CAACqC,eAAe,CAAE,MAAM,EAAE,gBAAiB,CAAC,EACnEY,IAAI;EACR,CAAC,EAAE,EAAG,CAAC;EAEPvD,UAAU,CAAE;IACXuB,IAAI,EAAE,0BAA0B;IAChCC,KAAK,EAAElC,EAAE,CAAE,WAAY,CAAC;IACxBmC,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACP8B,MAAM,CAACC,IAAI,CAAEH,OAAO,EAAE,QAAS,CAAC;IACjC,CAAC;IACDzB,IAAI,EAAEhC;EACP,CAAE,CAAC;EAEHE,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,4BAA4B;IAClCmC,IAAI,EAAE9C,iCAAiC,CAAC;EACzC,CAAE,CAAC;EAEHb,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,4CAA4C;IAClDmC,IAAI,EAAE3B,yCAAyC,CAAC;EACjD,CAAE,CAAC;EAEHhC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,oCAAoC;IAC1CmC,IAAI,EAAEvB,4BAA4B,CAAC;EACpC,CAAE,CAAC;EAEHpC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,gCAAgC;IACtCmC,IAAI,EAAEnB,8BAA8B,CAAC;EACtC,CAAE,CAAC;EAEHxC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,sCAAsC;IAC5CmC,IAAI,EAAET,oCAAoC,CAAC;EAC5C,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","useDispatch","useSelect","__","isRTL","rotateLeft","rotateRight","help","backup","useCommandLoader","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","unlock","editSiteStore","useGlobalStylesReset","useHistory","useLocation","getGlobalStylesToggleWelcomeGuideCommands","useGlobalStylesToggleWelcomeGuideCommands","openGeneralSidebar","params","canvas","set","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","navigate","transition","setTimeout","icon","isLoading","getGlobalStylesResetCommands","useGlobalStylesResetCommands","canReset","onReset","getGlobalStylesOpenRevisionsCommands","useGlobalStylesOpenRevisionsCommands","setEditorCanvasContainerView","hasRevisions","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","useCommonCommands","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { rotateLeft, rotateRight, help, backup } from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst getGlobalStylesToggleWelcomeGuideCommands = () =>\n\tfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst { set } = useDispatch( preferencesStore );\n\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t}, 500 );\n\t\t\t\t\t},\n\t\t\t\t\ticon: help,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ history, openGeneralSidebar, canvas, isBlockBasedTheme, set ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesResetCommands = () =>\n\tfunction useGlobalStylesResetCommands() {\n\t\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canReset ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tonReset();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ canReset, onReset ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenRevisionsCommands = () =>\n\tfunction useGlobalStylesOpenRevisionsCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst hasRevisions = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\n\t\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! hasRevisions ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles-revisions',\n\t\t\t\t\tlabel: __( 'Open style revisions' ),\n\t\t\t\t\ticon: backup,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles?canvas=edit', {\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\thasRevisions,\n\t\t\tcanvas,\n\t\t] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useCommonCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: getGlobalStylesToggleWelcomeGuideCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: getGlobalStylesResetCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: getGlobalStylesOpenRevisionsCommands(),\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,WAAW,EAAEC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AACxE,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AAEpD,MAAM;EAAEC;AAAqB,CAAC,GAAGF,MAAM,CAAEL,sBAAuB,CAAC;AACjE,MAAM;EAAEQ,UAAU;EAAEC;AAAY,CAAC,GAAGJ,MAAM,CAAEJ,iBAAkB,CAAC;AAE/D,MAAMS,yCAAyC,GAAGA,CAAA,KACjD,SAASC,yCAAyCA,CAAA,EAAG;EACpD,MAAM;IAAEC;EAAmB,CAAC,GAAGP,MAAM,CAAEf,WAAW,CAAEgB,aAAc,CAAE,CAAC;EACrE,MAAM;IAAEO;EAAO,CAAC,GAAGJ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
  aspect-ratio: 1/1;
1133
1133
  background-color: #fff;
1134
1134
  border-radius: 4px;
1135
+ overflow: hidden;
1135
1136
  position: relative;
1136
1137
  }
1137
1138
  .dataviews-view-grid .dataviews-view-grid__media img {
@@ -1450,6 +1451,14 @@ div.dataviews-view-list {
1450
1451
  justify-content: space-between;
1451
1452
  }
1452
1453
 
1454
+ .dataviews-view-list__group-header {
1455
+ font-size: 15px;
1456
+ font-weight: 500;
1457
+ color: #1e1e1e;
1458
+ margin: 0 0 8px 0;
1459
+ padding: 0 24px;
1460
+ }
1461
+
1453
1462
  .dataviews-view-table {
1454
1463
  width: 100%;
1455
1464
  text-indent: 0;
@@ -1945,12 +1954,6 @@ div.dataviews-view-list {
1945
1954
  align-items: flex-start !important;
1946
1955
  }
1947
1956
 
1948
- .dataforms-layouts-regular__field .components-base-control__label {
1949
- font-size: inherit;
1950
- font-weight: normal;
1951
- text-transform: none;
1952
- }
1953
-
1954
1957
  .dataforms-layouts-regular__field-label {
1955
1958
  width: 38%;
1956
1959
  flex-shrink: 0;
@@ -2332,7 +2335,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2332
2335
  contain: content;
2333
2336
  }
2334
2337
 
2335
- @keyframes _athqy_slide-from-right {
2338
+ @keyframes _l7v71_slide-from-right {
2336
2339
  from {
2337
2340
  transform: translateX(-50px);
2338
2341
  opacity: 0;
@@ -2342,7 +2345,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2342
2345
  opacity: 1;
2343
2346
  }
2344
2347
  }
2345
- @keyframes _athqy_slide-from-left {
2348
+ @keyframes _l7v71_slide-from-left {
2346
2349
  from {
2347
2350
  transform: translateX(50px);
2348
2351
  opacity: 0;
@@ -2398,10 +2401,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2398
2401
  }
2399
2402
  }
2400
2403
  .edit-site-sidebar__screen-wrapper.slide-from-left {
2401
- animation-name: _athqy_slide-from-left;
2404
+ animation-name: _l7v71_slide-from-left;
2402
2405
  }
2403
2406
  .edit-site-sidebar__screen-wrapper.slide-from-right {
2404
- animation-name: _athqy_slide-from-right;
2407
+ animation-name: _l7v71_slide-from-right;
2405
2408
  }
2406
2409
 
2407
2410
  .edit-site-site-hub {
@@ -1132,6 +1132,7 @@
1132
1132
  aspect-ratio: 1/1;
1133
1133
  background-color: #fff;
1134
1134
  border-radius: 4px;
1135
+ overflow: hidden;
1135
1136
  position: relative;
1136
1137
  }
1137
1138
  .dataviews-view-grid .dataviews-view-grid__media img {
@@ -1450,6 +1451,14 @@ div.dataviews-view-list {
1450
1451
  justify-content: space-between;
1451
1452
  }
1452
1453
 
1454
+ .dataviews-view-list__group-header {
1455
+ font-size: 15px;
1456
+ font-weight: 500;
1457
+ color: #1e1e1e;
1458
+ margin: 0 0 8px 0;
1459
+ padding: 0 24px;
1460
+ }
1461
+
1453
1462
  .dataviews-view-table {
1454
1463
  width: 100%;
1455
1464
  text-indent: 0;
@@ -1945,12 +1954,6 @@ div.dataviews-view-list {
1945
1954
  align-items: flex-start !important;
1946
1955
  }
1947
1956
 
1948
- .dataforms-layouts-regular__field .components-base-control__label {
1949
- font-size: inherit;
1950
- font-weight: normal;
1951
- text-transform: none;
1952
- }
1953
-
1954
1957
  .dataforms-layouts-regular__field-label {
1955
1958
  width: 38%;
1956
1959
  flex-shrink: 0;
@@ -2332,7 +2335,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2332
2335
  contain: content;
2333
2336
  }
2334
2337
 
2335
- @keyframes _athqy_slide-from-right {
2338
+ @keyframes _l7v71_slide-from-right {
2336
2339
  from {
2337
2340
  transform: translateX(50px);
2338
2341
  opacity: 0;
@@ -2342,7 +2345,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2342
2345
  opacity: 1;
2343
2346
  }
2344
2347
  }
2345
- @keyframes _athqy_slide-from-left {
2348
+ @keyframes _l7v71_slide-from-left {
2346
2349
  from {
2347
2350
  transform: translateX(-50px);
2348
2351
  opacity: 0;
@@ -2398,10 +2401,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2398
2401
  }
2399
2402
  }
2400
2403
  .edit-site-sidebar__screen-wrapper.slide-from-left {
2401
- animation-name: _athqy_slide-from-left;
2404
+ animation-name: _l7v71_slide-from-left;
2402
2405
  }
2403
2406
  .edit-site-sidebar__screen-wrapper.slide-from-right {
2404
- animation-name: _athqy_slide-from-right;
2407
+ animation-name: _l7v71_slide-from-right;
2405
2408
  }
2406
2409
 
2407
2410
  .edit-site-site-hub {
@@ -1132,6 +1132,7 @@
1132
1132
  aspect-ratio: 1/1;
1133
1133
  background-color: #fff;
1134
1134
  border-radius: 4px;
1135
+ overflow: hidden;
1135
1136
  position: relative;
1136
1137
  }
1137
1138
  .dataviews-view-grid .dataviews-view-grid__media img {
@@ -1450,6 +1451,14 @@ div.dataviews-view-list {
1450
1451
  justify-content: space-between;
1451
1452
  }
1452
1453
 
1454
+ .dataviews-view-list__group-header {
1455
+ font-size: 15px;
1456
+ font-weight: 500;
1457
+ color: #1e1e1e;
1458
+ margin: 0 0 8px 0;
1459
+ padding: 0 24px;
1460
+ }
1461
+
1453
1462
  .dataviews-view-table {
1454
1463
  width: 100%;
1455
1464
  text-indent: 0;
@@ -1945,12 +1954,6 @@ div.dataviews-view-list {
1945
1954
  align-items: flex-start !important;
1946
1955
  }
1947
1956
 
1948
- .dataforms-layouts-regular__field .components-base-control__label {
1949
- font-size: inherit;
1950
- font-weight: normal;
1951
- text-transform: none;
1952
- }
1953
-
1954
1957
  .dataforms-layouts-regular__field-label {
1955
1958
  width: 38%;
1956
1959
  flex-shrink: 0;
@@ -3531,7 +3534,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
3531
3534
  contain: content;
3532
3535
  }
3533
3536
 
3534
- @keyframes _1hvec_slide-from-right {
3537
+ @keyframes _85q9t_slide-from-right {
3535
3538
  from {
3536
3539
  transform: translateX(-50px);
3537
3540
  opacity: 0;
@@ -3541,7 +3544,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
3541
3544
  opacity: 1;
3542
3545
  }
3543
3546
  }
3544
- @keyframes _1hvec_slide-from-left {
3547
+ @keyframes _85q9t_slide-from-left {
3545
3548
  from {
3546
3549
  transform: translateX(50px);
3547
3550
  opacity: 0;
@@ -3597,10 +3600,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
3597
3600
  }
3598
3601
  }
3599
3602
  .edit-site-sidebar__screen-wrapper.slide-from-left {
3600
- animation-name: _1hvec_slide-from-left;
3603
+ animation-name: _85q9t_slide-from-left;
3601
3604
  }
3602
3605
  .edit-site-sidebar__screen-wrapper.slide-from-right {
3603
- animation-name: _1hvec_slide-from-right;
3606
+ animation-name: _85q9t_slide-from-right;
3604
3607
  }
3605
3608
 
3606
3609
  .edit-site-sidebar-button {
@@ -1132,6 +1132,7 @@
1132
1132
  aspect-ratio: 1/1;
1133
1133
  background-color: #fff;
1134
1134
  border-radius: 4px;
1135
+ overflow: hidden;
1135
1136
  position: relative;
1136
1137
  }
1137
1138
  .dataviews-view-grid .dataviews-view-grid__media img {
@@ -1450,6 +1451,14 @@ div.dataviews-view-list {
1450
1451
  justify-content: space-between;
1451
1452
  }
1452
1453
 
1454
+ .dataviews-view-list__group-header {
1455
+ font-size: 15px;
1456
+ font-weight: 500;
1457
+ color: #1e1e1e;
1458
+ margin: 0 0 8px 0;
1459
+ padding: 0 24px;
1460
+ }
1461
+
1453
1462
  .dataviews-view-table {
1454
1463
  width: 100%;
1455
1464
  text-indent: 0;
@@ -1945,12 +1954,6 @@ div.dataviews-view-list {
1945
1954
  align-items: flex-start !important;
1946
1955
  }
1947
1956
 
1948
- .dataforms-layouts-regular__field .components-base-control__label {
1949
- font-size: inherit;
1950
- font-weight: normal;
1951
- text-transform: none;
1952
- }
1953
-
1954
1957
  .dataforms-layouts-regular__field-label {
1955
1958
  width: 38%;
1956
1959
  flex-shrink: 0;
@@ -3532,7 +3535,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
3532
3535
  contain: content;
3533
3536
  }
3534
3537
 
3535
- @keyframes _1hvec_slide-from-right {
3538
+ @keyframes _85q9t_slide-from-right {
3536
3539
  from {
3537
3540
  transform: translateX(50px);
3538
3541
  opacity: 0;
@@ -3542,7 +3545,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
3542
3545
  opacity: 1;
3543
3546
  }
3544
3547
  }
3545
- @keyframes _1hvec_slide-from-left {
3548
+ @keyframes _85q9t_slide-from-left {
3546
3549
  from {
3547
3550
  transform: translateX(-50px);
3548
3551
  opacity: 0;
@@ -3598,10 +3601,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
3598
3601
  }
3599
3602
  }
3600
3603
  .edit-site-sidebar__screen-wrapper.slide-from-left {
3601
- animation-name: _1hvec_slide-from-left;
3604
+ animation-name: _85q9t_slide-from-left;
3602
3605
  }
3603
3606
  .edit-site-sidebar__screen-wrapper.slide-from-right {
3604
- animation-name: _1hvec_slide-from-right;
3607
+ animation-name: _85q9t_slide-from-right;
3605
3608
  }
3606
3609
 
3607
3610
  .edit-site-sidebar-button {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "6.30.1-next.6870dfe5b.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.1-next.6870dfe5b.0",
34
- "@wordpress/api-fetch": "^7.30.1-next.6870dfe5b.0",
35
- "@wordpress/blob": "^4.30.1-next.6870dfe5b.0",
36
- "@wordpress/block-editor": "^15.3.1-next.6870dfe5b.0",
37
- "@wordpress/block-library": "^9.30.1-next.6870dfe5b.0",
38
- "@wordpress/blocks": "^15.3.1-next.6870dfe5b.0",
39
- "@wordpress/commands": "^1.30.1-next.6870dfe5b.0",
40
- "@wordpress/components": "^30.3.2-next.6870dfe5b.0",
41
- "@wordpress/compose": "^7.30.1-next.6870dfe5b.0",
42
- "@wordpress/core-data": "^7.30.1-next.6870dfe5b.0",
43
- "@wordpress/data": "^10.30.1-next.6870dfe5b.0",
44
- "@wordpress/dataviews": "^9.0.1-next.6870dfe5b.0",
45
- "@wordpress/date": "^5.30.1-next.6870dfe5b.0",
46
- "@wordpress/deprecated": "^4.30.1-next.6870dfe5b.0",
47
- "@wordpress/dom": "^4.30.1-next.6870dfe5b.0",
48
- "@wordpress/editor": "^14.30.1-next.6870dfe5b.0",
49
- "@wordpress/element": "^6.30.1-next.6870dfe5b.0",
50
- "@wordpress/escape-html": "^3.30.1-next.6870dfe5b.0",
51
- "@wordpress/fields": "^0.22.1-next.6870dfe5b.0",
52
- "@wordpress/hooks": "^4.30.1-next.6870dfe5b.0",
53
- "@wordpress/html-entities": "^4.30.1-next.6870dfe5b.0",
54
- "@wordpress/i18n": "^6.3.1-next.6870dfe5b.0",
55
- "@wordpress/icons": "^10.30.1-next.6870dfe5b.0",
56
- "@wordpress/keyboard-shortcuts": "^5.30.1-next.6870dfe5b.0",
57
- "@wordpress/keycodes": "^4.30.1-next.6870dfe5b.0",
58
- "@wordpress/media-utils": "^5.30.1-next.6870dfe5b.0",
59
- "@wordpress/notices": "^5.30.1-next.6870dfe5b.0",
60
- "@wordpress/patterns": "^2.30.1-next.6870dfe5b.0",
61
- "@wordpress/plugins": "^7.30.1-next.6870dfe5b.0",
62
- "@wordpress/preferences": "^4.30.1-next.6870dfe5b.0",
63
- "@wordpress/primitives": "^4.30.1-next.6870dfe5b.0",
64
- "@wordpress/private-apis": "^1.30.1-next.6870dfe5b.0",
65
- "@wordpress/reusable-blocks": "^5.30.1-next.6870dfe5b.0",
66
- "@wordpress/router": "^1.30.1-next.6870dfe5b.0",
67
- "@wordpress/style-engine": "^2.30.1-next.6870dfe5b.0",
68
- "@wordpress/url": "^4.30.1-next.6870dfe5b.0",
69
- "@wordpress/viewport": "^6.30.1-next.6870dfe5b.0",
70
- "@wordpress/widgets": "^4.30.1-next.6870dfe5b.0",
71
- "@wordpress/wordcount": "^4.30.1-next.6870dfe5b.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": "c8637da9df499cd7b6b07c9fad918f6d45f4de3d"
86
+ "gitHead": "8806899f598577a3c90a55d9aa79fbc372fe1e75"
87
87
  }
@@ -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(),