@wordpress/edit-site 5.12.10 → 5.12.12

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 (113) hide show
  1. package/build/components/global-styles/screen-revisions/index.js +8 -2
  2. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  3. package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
  4. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  5. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +31 -25
  6. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  7. package/build/components/keyboard-shortcuts/edit-mode.js +7 -5
  8. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  9. package/build/components/layout/index.js +14 -3
  10. package/build/components/layout/index.js.map +1 -1
  11. package/build/components/page-patterns/patterns-list.js +2 -1
  12. package/build/components/page-patterns/patterns-list.js.map +1 -1
  13. package/build/components/page-patterns/use-patterns.js +1 -1
  14. package/build/components/page-patterns/use-patterns.js.map +1 -1
  15. package/build/components/page-template-parts/index.js +1 -2
  16. package/build/components/page-template-parts/index.js.map +1 -1
  17. package/build/components/resizable-frame/index.js +14 -23
  18. package/build/components/resizable-frame/index.js.map +1 -1
  19. package/build/components/sidebar-edit-mode/page-panels/page-status.js +2 -7
  20. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  21. package/build/components/sidebar-navigation-screen/index.js +15 -13
  22. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  23. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +8 -0
  24. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  25. package/build/components/sidebar-navigation-screen-pages/index.js +2 -0
  26. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  27. package/build/components/sidebar-navigation-screen-patterns/index.js +0 -9
  28. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  29. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
  30. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  31. package/build/components/sidebar-navigation-screen-templates/index.js +1 -10
  32. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  33. package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -0
  34. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  35. package/build/components/site-hub/index.js +16 -7
  36. package/build/components/site-hub/index.js.map +1 -1
  37. package/build/hooks/commands/use-common-commands.js +78 -20
  38. package/build/hooks/commands/use-common-commands.js.map +1 -1
  39. package/build/hooks/commands/use-edit-mode-commands.js +30 -0
  40. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  41. package/build/store/private-actions.js +2 -1
  42. package/build/store/private-actions.js.map +1 -1
  43. package/build-module/components/global-styles/screen-revisions/index.js +9 -3
  44. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  45. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
  46. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  47. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +27 -21
  48. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  49. package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -5
  50. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  51. package/build-module/components/layout/index.js +14 -3
  52. package/build-module/components/layout/index.js.map +1 -1
  53. package/build-module/components/page-patterns/patterns-list.js +3 -2
  54. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  55. package/build-module/components/page-patterns/use-patterns.js +1 -1
  56. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  57. package/build-module/components/page-template-parts/index.js +1 -2
  58. package/build-module/components/page-template-parts/index.js.map +1 -1
  59. package/build-module/components/resizable-frame/index.js +15 -24
  60. package/build-module/components/resizable-frame/index.js.map +1 -1
  61. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +2 -7
  62. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  63. package/build-module/components/sidebar-navigation-screen/index.js +13 -13
  64. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  65. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +7 -0
  66. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  67. package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -0
  68. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  69. package/build-module/components/sidebar-navigation-screen-patterns/index.js +0 -7
  70. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  71. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
  72. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  73. package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -8
  74. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  75. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -0
  76. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  77. package/build-module/components/site-hub/index.js +16 -7
  78. package/build-module/components/site-hub/index.js.map +1 -1
  79. package/build-module/hooks/commands/use-common-commands.js +74 -20
  80. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  81. package/build-module/hooks/commands/use-edit-mode-commands.js +29 -0
  82. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  83. package/build-module/store/private-actions.js +2 -1
  84. package/build-module/store/private-actions.js.map +1 -1
  85. package/build-style/style-rtl.css +12 -11
  86. package/build-style/style.css +12 -11
  87. package/package.json +20 -20
  88. package/src/components/global-styles/screen-revisions/index.js +76 -58
  89. package/src/components/global-styles/screen-revisions/revisions-buttons.js +17 -31
  90. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +14 -1
  91. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +63 -48
  92. package/src/components/keyboard-shortcuts/edit-mode.js +4 -5
  93. package/src/components/layout/index.js +22 -2
  94. package/src/components/layout/style.scss +1 -1
  95. package/src/components/page-patterns/patterns-list.js +5 -2
  96. package/src/components/page-patterns/style.scss +3 -0
  97. package/src/components/page-patterns/use-patterns.js +1 -0
  98. package/src/components/page-template-parts/index.js +0 -1
  99. package/src/components/resizable-frame/index.js +12 -28
  100. package/src/components/resizable-frame/style.scss +0 -17
  101. package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -4
  102. package/src/components/sidebar-navigation-screen/index.js +13 -15
  103. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +27 -15
  104. package/src/components/sidebar-navigation-screen-pages/index.js +9 -4
  105. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -8
  106. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
  107. package/src/components/sidebar-navigation-screen-templates/index.js +1 -9
  108. package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -0
  109. package/src/components/site-hub/index.js +21 -7
  110. package/src/components/site-hub/style.scss +9 -2
  111. package/src/hooks/commands/use-common-commands.js +56 -23
  112. package/src/hooks/commands/use-edit-mode-commands.js +34 -3
  113. package/src/store/private-actions.js +5 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"names":["useSelect","useDispatch","__","isRTL","trash","backup","layout","page","drawerLeft","drawerRight","blockDefault","cog","code","keyboardClose","useCommandLoader","privateApis","routerPrivateApis","store","preferencesStore","interfaceStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","unlock","useHistory","usePageContentFocusCommands","isPage","canvasMode","hasPageContentFocus","select","getCanvasMode","setHasPageContentFocus","isLoading","commands","push","name","label","icon","callback","close","useManipulateDocumentCommands","isLoaded","record","template","removeTemplate","revertTemplate","history","type","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","editorMode","activeSidebar","getEditorMode","getActiveComplementaryArea","openModal","toggle","useEditModeCommands","hook","context"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SACCC,KADD,EAECC,MAFD,EAGCC,MAHD,EAICC,IAJD,EAKCC,UALD,EAMCC,WAND,EAOCC,YAPD,EAQCC,GARD,EASCC,IATD,EAUCC,aAVD,QAWO,kBAXP;AAYA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AACA,SAASD,KAAK,IAAIE,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AACA,OAAOC,qBAAP,MAAkC,2CAAlC;AACA,OAAOC,mBAAP,MAAgC,mCAAhC;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,SAASC,iCAAT,QAAkD,+CAAlD;AACA,SAASC,sBAAT,QAAuC,oCAAvC;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAiBD,MAAM,CAAEV,iBAAF,CAA7B;;AAEA,SAASY,2BAAT,GAAuC;AACtC,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,UAAV;AAAsBC,IAAAA;AAAtB,MAA8C/B,SAAS,CAC1DgC,MAAF,KAAgB;AACfH,IAAAA,MAAM,EAAEG,MAAM,CAAEZ,aAAF,CAAN,CAAwBS,MAAxB,EADO;AAEfC,IAAAA,UAAU,EAAEJ,MAAM,CAAEM,MAAM,CAAEZ,aAAF,CAAR,CAAN,CAAkCa,aAAlC,EAFG;AAGfF,IAAAA,m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gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,mCADW;AAEjByB,IAAAA,IAAI,EAAEnC,2BAFW;AAGjBoC,IAAAA,OAAO,EAAE;AAHQ,GAAF,CAAhB;AAMAlD,EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,oCADW;AAEjByB,IAAAA,IAAI,EAAEpB;AAFW,GAAF,CAAhB;AAKA7B,EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,wBADW;AAEjByB,IAAAA,IAAI,EAAEX;AAFW,GAAF,CAAhB;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\ttrash,\n\tbackup,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcog,\n\tcode,\n\tkeyboardClose,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { isPage, canvasMode, hasPageContentFocus } = useSelect(\n\t\t( select ) => ( {\n\t\t\tisPage: select( editSiteStore ).isPage(),\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\thasPageContentFocus: select( editSiteStore ).hasPageContentFocus(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( hasPageContentFocus ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: __( 'Edit template' ),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( false );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( true );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst hasPageContentFocus = useSelect(\n\t\t( select ) => select( editSiteStore ).hasPageContentFocus(),\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Reset template' )\n\t\t\t\t: __( 'Reset template part' );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: backup,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Delete template' )\n\t\t\t\t: __( 'Delete template part' );\n\t\tconst path =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst { openGeneralSidebar, closeGeneralSidebar, switchEditorMode } =\n\t\tuseDispatch( editSiteStore );\n\tconst { canvasMode, editorMode, activeSidebar } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'fixedToolbar' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-code-editor',\n\t\tlabel: __( 'Toggle code editor' ),\n\t\ticon: code,\n\t\tcallback: ( { close } ) => {\n\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Open editor preferences' ),\n\t\ticon: cog,\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Open keyboard shortcuts' ),\n\t\ticon: keyboardClose,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"names":["useSelect","useDispatch","__","isRTL","trash","backup","layout","page","drawerLeft","drawerRight","blockDefault","cog","code","keyboardClose","useCommandLoader","privateApis","routerPrivateApis","store","preferencesStore","interfaceStore","noticesStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","unlock","useHistory","usePageContentFocusCommands","isPage","canvasMode","hasPageContentFocus","select","getCanvasMode","setHasPageContentFocus","isLoading","commands","push","name","label","icon","callback","close","useManipulateDocumentCommands","isLoaded","record","template","removeTemplate","revertTemplate","history","type","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","setIsListViewOpened","switchEditorMode","editorMode","activeSidebar","getEditorMode","getActiveComplementaryArea","openModal","get","getPreference","set","setPreference","toggle","createInfoNotice","id","useEditModeCommands","hook","context"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SACCC,KADD,EAECC,MAFD,EAGCC,MAHD,EAICC,IAJD,EAKCC,UALD,EAMCC,WAND,EAOCC,YAPD,EAQCC,GARD,EASCC,IATD,EAUCC,aAVD,QAWO,kBAXP;AAYA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AACA,SAASD,KAAK,IAAIE,cAAlB,QAAwC,sBAAxC;AACA,SAASF,KAAK,IA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AT;AACA;AANa,GAAf;AASAW,EAAAA,QAAQ,CAACC,IAAT,CAAe;AACdC,IAAAA,IAAI,EAAE,yBADQ;AAEdC,IAAAA,KAAK,EAAEtC,EAAE,CAAE,yBAAF,CAFK;AAGduC,IAAAA,IAAI,EAAE5B,aAHQ;AAId6B,IAAAA,QAAQ,EAAE,MAAM;AACfqB,MAAAA,SAAS,CAAEtC,iCAAF,CAAT;AACA;AANa,GAAf;AASA,SAAO;AACNW,IAAAA,SAAS,EAAE,KADL;AAENC,IAAAA;AAFM,GAAP;AAIA;;AAED,OAAO,SAASkC,mBAAT,GAA+B;AACrCzD,EAAAA,gBAAgB,CAAE;AACjByB,IAAAA,IAAI,EAAE,mCADW;AAEjBiC,IAAAA,IAAI,EAAE3C,2BAFW;AAGjB4C,IAAAA,OAAO,EAAE;AAHQ,GAAF,CAAhB;AAMA3D,EAAAA,gBAAgB,CAAE;AACjByB,IAAAA,IAAI,EAAE,oCADW;AAEjBiC,IAAAA,IAAI,EAAE5B;AAFW,GAAF,CAAhB;AAKA9B,EAAAA,gBAAgB,CAAE;AACjByB,IAAAA,IAAI,EAAE,wBADW;AAEjBiC,IAAAA,IAAI,EAAEnB;AAFW,GAAF,CAAhB;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\ttrash,\n\tbackup,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcog,\n\tcode,\n\tkeyboardClose,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { isPage, canvasMode, hasPageContentFocus } = useSelect(\n\t\t( select ) => ( {\n\t\t\tisPage: select( editSiteStore ).isPage(),\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\thasPageContentFocus: select( editSiteStore ).hasPageContentFocus(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( hasPageContentFocus ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: __( 'Edit template' ),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( false );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( true );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst hasPageContentFocus = useSelect(\n\t\t( select ) => select( editSiteStore ).hasPageContentFocus(),\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Reset template' )\n\t\t\t\t: __( 'Reset template part' );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: backup,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Delete template' )\n\t\t\t\t: __( 'Delete template part' );\n\t\tconst path =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t} = useDispatch( editSiteStore );\n\tconst { canvasMode, editorMode, activeSidebar } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst { set: setPreference, toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: __( 'Toggle distraction free' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetPreference( 'core/edit-site', 'fixedToolbar', false );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t\ttoggle( 'core/edit-site', 'distractionFree' );\n\t\t\tcreateInfoNotice(\n\t\t\t\tgetPreference( 'core/edit-site', 'distractionFree' )\n\t\t\t\t\t? __( 'Distraction free mode turned on.' )\n\t\t\t\t\t: __( 'Distraction free mode turned off.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'fixedToolbar' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-code-editor',\n\t\tlabel: __( 'Toggle code editor' ),\n\t\ticon: code,\n\t\tcallback: ( { close } ) => {\n\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Open editor preferences' ),\n\t\ticon: cog,\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Open keyboard shortcuts' ),\n\t\ticon: keyboardClose,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"]}
@@ -20,8 +20,9 @@ export const setCanvasMode = mode => ({
20
20
  type: 'SET_CANVAS_MODE',
21
21
  mode
22
22
  }); // Check if the block list view should be open by default.
23
+ // If `distractionFree` mode is enabled, the block list view should not be open.
23
24
 
24
- if (mode === 'edit' && registry.select(preferencesStore).get('core/edit-site', 'showListViewByDefault')) {
25
+ if (mode === 'edit' && registry.select(preferencesStore).get('core/edit-site', 'showListViewByDefault') && !registry.select(preferencesStore).get('core/edit-site', 'distractionFree')) {
25
26
  dispatch.setIsListViewOpened(true);
26
27
  } // Switch focus away from editing the template when switching to view mode.
27
28
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/private-actions.js"],"names":["store","blockEditorStore","preferencesStore","setCanvasMode","mode","registry","dispatch","select","__unstableSetEditorMode","type","get","setIsListViewOpened","isPage","setHasPageContentFocus","setEditorCanvasContainerView","view"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAF,IACA,CAAE;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,QAAZ;AAAsBC,EAAAA;AAAtB,CAAF,KAAsC;AACrCF,EAAAA,QAAQ,CAACC,QAAT,CAAmBL,gBAAnB,EAAsCO,uBAAtC,CAA+D,MAA/D;;AACAF,EAAAA,QAAQ,CAAE;AACTG,IAAAA,IAAI,EAAE,iBADG;AAETL,IAAAA;AAFS,GAAF,CAAR,CAFqC,CAMrC;;AACA,MACCA,IAAI,KAAK,MAAT,IACAC,QAAQ,CACNE,MADF,CACUL,gBADV,EAEEQ,GAFF,CAEO,gBAFP,EAEyB,uBAFzB,CAFD,EAKE;AACDJ,IAAAA,QAAQ,CAACK,mBAAT,CAA8B,IAA9B;AACA,GAdoC,CAerC;;;AACA,MAAKP,IAAI,KAAK,MAAT,IAAmBG,MAAM,CAACK,MAAP,EAAxB,EAA0C;AACzCN,IAAAA,QAAQ,CAACO,sBAAT,CAAiC,IAAjC;AACA;AACD,CArBK;AAuBP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,4BAA4B,GACtCC,IAAF,IACA,CAAE;AAAET,EAAAA;AAAF,CAAF,KAAoB;AACnBA,EAAAA,QAAQ,CAAE;AACTG,IAAAA,IAAI,EAAE,kCADG;AAETM,IAAAA;AAFS,GAAF,CAAR;AAIA,CAPK","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch, select } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t\t// Switch focus away from editing the template when switching to view mode.\n\t\tif ( mode === 'view' && select.isPage() ) {\n\t\t\tdispatch.setHasPageContentFocus( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/private-actions.js"],"names":["store","blockEditorStore","preferencesStore","setCanvasMode","mode","registry","dispatch","select","__unstableSetEditorMode","type","get","setIsListViewOpened","isPage","setHasPageContentFocus","setEditorCanvasContainerView","view"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAF,IACA,CAAE;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,QAAZ;AAAsBC,EAAAA;AAAtB,CAAF,KAAsC;AACrCF,EAAAA,QAAQ,CAACC,QAAT,CAAmBL,gBAAnB,EAAsCO,uBAAtC,CAA+D,MAA/D;;AACAF,EAAAA,QAAQ,CAAE;AACTG,IAAAA,IAAI,EAAE,iBADG;AAETL,IAAAA;AAFS,GAAF,CAAR,CAFqC,CAMrC;AACA;;AACA,MACCA,IAAI,KAAK,MAAT,IACAC,QAAQ,CACNE,MADF,CACUL,gBADV,EAEEQ,GAFF,CAEO,gBAFP,EAEyB,uBAFzB,CADA,IAIA,CAAEL,QAAQ,CACRE,MADA,CACQL,gBADR,EAEAQ,GAFA,CAEK,gBAFL,EAEuB,iBAFvB,CALH,EAQE;AACDJ,IAAAA,QAAQ,CAACK,mBAAT,CAA8B,IAA9B;AACA,GAlBoC,CAmBrC;;;AACA,MAAKP,IAAI,KAAK,MAAT,IAAmBG,MAAM,CAACK,MAAP,EAAxB,EAA0C;AACzCN,IAAAA,QAAQ,CAACO,sBAAT,CAAiC,IAAjC;AACA;AACD,CAzBK;AA2BP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,4BAA4B,GACtCC,IAAF,IACA,CAAE;AAAET,EAAAA;AAAF,CAAF,KAAoB;AACnBA,EAAAA,QAAQ,CAAE;AACTG,IAAAA,IAAI,EAAE,kCADG;AAETM,IAAAA;AAFS,GAAF,CAAR;AAIA,CAPK","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch, select } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t\t// Switch focus away from editing the template when switching to view mode.\n\t\tif ( mode === 'view' && select.isPage() ) {\n\t\t\tdispatch.setHasPageContentFocus( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"]}
@@ -1837,6 +1837,9 @@ body.is-fullscreen-mode .edit-site-list-header {
1837
1837
  width: 300px;
1838
1838
  }
1839
1839
  }
1840
+ .edit-site-patterns .edit-site-patterns__sync-status-filter-option:not([aria-checked=true]) {
1841
+ color: #949494;
1842
+ }
1840
1843
  .edit-site-patterns .edit-site-patterns__sync-status-filter-option:active {
1841
1844
  background: #757575;
1842
1845
  color: #f0f0f0;
@@ -2732,7 +2735,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2732
2735
  justify-content: center;
2733
2736
  align-items: center;
2734
2737
  }
2735
- .edit-site-layout__canvas:has(.edit-site-layout__resizable-frame-oversized) {
2738
+ .edit-site-layout__canvas.is-right-aligned {
2736
2739
  justify-content: flex-end;
2737
2740
  }
2738
2741
  .edit-site-layout__canvas > div {
@@ -3364,8 +3367,13 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3364
3367
  .edit-site-site-hub .edit-site-site-hub_toggle-command-center {
3365
3368
  transition: opacity ease 0.1s;
3366
3369
  }
3370
+ .edit-site-site-hub .edit-site-site-hub__site-title.is-transparent,
3371
+ .edit-site-site-hub .edit-site-site-hub_toggle-command-center.is-transparent {
3372
+ opacity: 0 !important;
3373
+ }
3367
3374
  .edit-site-site-hub .edit-site-site-hub__site-view-link {
3368
3375
  flex-grow: 0;
3376
+ margin-left: var(--wp-admin-border-width-focus);
3369
3377
  }
3370
3378
  @media (min-width: 480px) {
3371
3379
  .edit-site-site-hub .edit-site-site-hub__site-view-link {
@@ -3374,8 +3382,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3374
3382
  }
3375
3383
  }
3376
3384
  .edit-site-site-hub .edit-site-site-hub__site-view-link:focus {
3377
- outline: none;
3378
- box-shadow: none;
3379
3385
  opacity: 1;
3380
3386
  }
3381
3387
  .edit-site-site-hub .edit-site-site-hub__site-view-link svg {
@@ -3395,6 +3401,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3395
3401
  flex-shrink: 0;
3396
3402
  background: #1e1e1e;
3397
3403
  }
3404
+ .edit-site-site-hub__view-mode-toggle-container.has-transparent-background {
3405
+ background: transparent;
3406
+ }
3398
3407
 
3399
3408
  .edit-site-site-hub__text-content {
3400
3409
  overflow: hidden;
@@ -3563,14 +3572,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3563
3572
  .edit-site-resizable-frame__inner {
3564
3573
  position: relative;
3565
3574
  }
3566
- body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__site-title,
3567
- body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub_toggle-command-center {
3568
- opacity: 0 !important;
3569
- }
3570
- body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__view-mode-toggle-container {
3571
- background-color: transparent;
3572
- }
3573
-
3574
3575
  body:has(.edit-site-resizable-frame__inner.is-resizing) {
3575
3576
  cursor: col-resize;
3576
3577
  user-select: none;
@@ -1838,6 +1838,9 @@ body.is-fullscreen-mode .edit-site-list-header {
1838
1838
  width: 300px;
1839
1839
  }
1840
1840
  }
1841
+ .edit-site-patterns .edit-site-patterns__sync-status-filter-option:not([aria-checked=true]) {
1842
+ color: #949494;
1843
+ }
1841
1844
  .edit-site-patterns .edit-site-patterns__sync-status-filter-option:active {
1842
1845
  background: #757575;
1843
1846
  color: #f0f0f0;
@@ -2733,7 +2736,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2733
2736
  justify-content: center;
2734
2737
  align-items: center;
2735
2738
  }
2736
- .edit-site-layout__canvas:has(.edit-site-layout__resizable-frame-oversized) {
2739
+ .edit-site-layout__canvas.is-right-aligned {
2737
2740
  justify-content: flex-end;
2738
2741
  }
2739
2742
  .edit-site-layout__canvas > div {
@@ -3365,8 +3368,13 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3365
3368
  .edit-site-site-hub .edit-site-site-hub_toggle-command-center {
3366
3369
  transition: opacity ease 0.1s;
3367
3370
  }
3371
+ .edit-site-site-hub .edit-site-site-hub__site-title.is-transparent,
3372
+ .edit-site-site-hub .edit-site-site-hub_toggle-command-center.is-transparent {
3373
+ opacity: 0 !important;
3374
+ }
3368
3375
  .edit-site-site-hub .edit-site-site-hub__site-view-link {
3369
3376
  flex-grow: 0;
3377
+ margin-right: var(--wp-admin-border-width-focus);
3370
3378
  }
3371
3379
  @media (min-width: 480px) {
3372
3380
  .edit-site-site-hub .edit-site-site-hub__site-view-link {
@@ -3375,8 +3383,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3375
3383
  }
3376
3384
  }
3377
3385
  .edit-site-site-hub .edit-site-site-hub__site-view-link:focus {
3378
- outline: none;
3379
- box-shadow: none;
3380
3386
  opacity: 1;
3381
3387
  }
3382
3388
  .edit-site-site-hub .edit-site-site-hub__site-view-link svg {
@@ -3396,6 +3402,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3396
3402
  flex-shrink: 0;
3397
3403
  background: #1e1e1e;
3398
3404
  }
3405
+ .edit-site-site-hub__view-mode-toggle-container.has-transparent-background {
3406
+ background: transparent;
3407
+ }
3399
3408
 
3400
3409
  .edit-site-site-hub__text-content {
3401
3410
  overflow: hidden;
@@ -3564,14 +3573,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3564
3573
  .edit-site-resizable-frame__inner {
3565
3574
  position: relative;
3566
3575
  }
3567
- body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__site-title,
3568
- body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub_toggle-command-center {
3569
- opacity: 0 !important;
3570
- }
3571
- body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__view-mode-toggle-container {
3572
- background-color: transparent;
3573
- }
3574
-
3575
3576
  body:has(.edit-site-resizable-frame__inner.is-resizing) {
3576
3577
  cursor: col-resize;
3577
3578
  user-select: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.12.10",
3
+ "version": "5.12.12",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,40 +29,40 @@
29
29
  "@babel/runtime": "^7.16.0",
30
30
  "@wordpress/a11y": "^3.35.1",
31
31
  "@wordpress/api-fetch": "^6.32.1",
32
- "@wordpress/block-editor": "^12.3.8",
33
- "@wordpress/block-library": "^8.12.10",
34
- "@wordpress/blocks": "^12.12.4",
35
- "@wordpress/commands": "^0.6.8",
36
- "@wordpress/components": "^25.1.8",
37
- "@wordpress/compose": "^6.12.1",
38
- "@wordpress/core-commands": "^0.4.8",
39
- "@wordpress/core-data": "^6.12.8",
40
- "@wordpress/data": "^9.5.4",
32
+ "@wordpress/block-editor": "^12.3.10",
33
+ "@wordpress/block-library": "^8.12.12",
34
+ "@wordpress/blocks": "^12.12.6",
35
+ "@wordpress/commands": "^0.6.9",
36
+ "@wordpress/components": "^25.1.9",
37
+ "@wordpress/compose": "^6.12.2",
38
+ "@wordpress/core-commands": "^0.4.10",
39
+ "@wordpress/core-data": "^6.12.10",
40
+ "@wordpress/data": "^9.5.5",
41
41
  "@wordpress/date": "^4.35.1",
42
42
  "@wordpress/deprecated": "^3.35.1",
43
43
  "@wordpress/dom": "^3.35.1",
44
- "@wordpress/editor": "^13.12.8",
44
+ "@wordpress/editor": "^13.12.10",
45
45
  "@wordpress/element": "^5.12.1",
46
46
  "@wordpress/escape-html": "^2.35.1",
47
47
  "@wordpress/hooks": "^3.35.1",
48
48
  "@wordpress/html-entities": "^3.35.1",
49
49
  "@wordpress/i18n": "^4.35.1",
50
50
  "@wordpress/icons": "^9.26.2",
51
- "@wordpress/interface": "^5.12.8",
52
- "@wordpress/keyboard-shortcuts": "^4.12.4",
51
+ "@wordpress/interface": "^5.12.9",
52
+ "@wordpress/keyboard-shortcuts": "^4.12.5",
53
53
  "@wordpress/keycodes": "^3.35.1",
54
54
  "@wordpress/media-utils": "^4.26.1",
55
- "@wordpress/notices": "^4.3.4",
56
- "@wordpress/plugins": "^6.3.8",
57
- "@wordpress/preferences": "^3.12.8",
55
+ "@wordpress/notices": "^4.3.5",
56
+ "@wordpress/plugins": "^6.3.9",
57
+ "@wordpress/preferences": "^3.12.9",
58
58
  "@wordpress/primitives": "^3.33.1",
59
59
  "@wordpress/private-apis": "^0.17.2",
60
- "@wordpress/reusable-blocks": "^4.12.8",
60
+ "@wordpress/reusable-blocks": "^4.12.10",
61
61
  "@wordpress/router": "^0.4.2",
62
62
  "@wordpress/style-engine": "^1.18.1",
63
63
  "@wordpress/url": "^3.36.1",
64
- "@wordpress/viewport": "^5.12.4",
65
- "@wordpress/widgets": "^3.12.8",
64
+ "@wordpress/viewport": "^5.12.5",
65
+ "@wordpress/widgets": "^3.12.10",
66
66
  "@wordpress/wordcount": "^3.35.1",
67
67
  "change-case": "^4.1.2",
68
68
  "classnames": "^2.3.1",
@@ -84,5 +84,5 @@
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  },
87
- "gitHead": "cedb8caa943db47c16bdb4fa8880d506ce938fab"
87
+ "gitHead": "609a9df27d25e3d224dd1e2b97beb1bc02693255"
88
88
  }
@@ -7,6 +7,7 @@ import {
7
7
  __experimentalUseNavigator as useNavigator,
8
8
  __experimentalConfirmDialog as ConfirmDialog,
9
9
  Spinner,
10
+ __experimentalSpacer as Spacer,
10
11
  } from '@wordpress/components';
11
12
  import { useSelect, useDispatch } from '@wordpress/data';
12
13
  import { useContext, useState, useEffect } from '@wordpress/element';
@@ -87,6 +88,7 @@ function ScreenRevisions() {
87
88
  const isLoadButtonEnabled =
88
89
  !! globalStylesRevision?.id &&
89
90
  ! areGlobalStyleConfigsEqual( globalStylesRevision, userConfig );
91
+ const shouldShowRevisions = ! isLoading && revisions.length;
90
92
 
91
93
  return (
92
94
  <>
@@ -99,68 +101,84 @@ function ScreenRevisions() {
99
101
  { isLoading && (
100
102
  <Spinner className="edit-site-global-styles-screen-revisions__loading" />
101
103
  ) }
102
- { ! isLoading && (
103
- <Revisions
104
- blocks={ blocks }
105
- userConfig={ globalStylesRevision }
106
- onClose={ onCloseRevisions }
107
- />
108
- ) }
109
- <div className="edit-site-global-styles-screen-revisions">
110
- <RevisionsButtons
111
- onChange={ selectRevision }
112
- selectedRevisionId={ selectedRevisionId }
113
- userRevisions={ revisions }
114
- />
115
- { isLoadButtonEnabled && (
116
- <SidebarFixedBottom>
117
- <Button
118
- variant="primary"
119
- className="edit-site-global-styles-screen-revisions__button"
120
- disabled={
121
- ! globalStylesRevision?.id ||
122
- globalStylesRevision?.id === 'unsaved'
104
+ { shouldShowRevisions ? (
105
+ <>
106
+ <Revisions
107
+ blocks={ blocks }
108
+ userConfig={ globalStylesRevision }
109
+ onClose={ onCloseRevisions }
110
+ />
111
+ <div className="edit-site-global-styles-screen-revisions">
112
+ <RevisionsButtons
113
+ onChange={ selectRevision }
114
+ selectedRevisionId={ selectedRevisionId }
115
+ userRevisions={ revisions }
116
+ />
117
+ { isLoadButtonEnabled && (
118
+ <SidebarFixedBottom>
119
+ <Button
120
+ variant="primary"
121
+ className="edit-site-global-styles-screen-revisions__button"
122
+ disabled={
123
+ ! globalStylesRevision?.id ||
124
+ globalStylesRevision?.id === 'unsaved'
125
+ }
126
+ onClick={ () => {
127
+ if ( hasUnsavedChanges ) {
128
+ setIsLoadingRevisionWithUnsavedChanges(
129
+ true
130
+ );
131
+ } else {
132
+ restoreRevision(
133
+ globalStylesRevision
134
+ );
135
+ }
136
+ } }
137
+ >
138
+ { __( 'Apply' ) }
139
+ </Button>
140
+ </SidebarFixedBottom>
141
+ ) }
142
+ </div>
143
+ { isLoadingRevisionWithUnsavedChanges && (
144
+ <ConfirmDialog
145
+ title={ __(
146
+ 'Loading this revision will discard all unsaved changes.'
147
+ ) }
148
+ isOpen={ isLoadingRevisionWithUnsavedChanges }
149
+ confirmButtonText={ __(
150
+ ' Discard unsaved changes'
151
+ ) }
152
+ onConfirm={ () =>
153
+ restoreRevision( globalStylesRevision )
154
+ }
155
+ onCancel={ () =>
156
+ setIsLoadingRevisionWithUnsavedChanges( false )
123
157
  }
124
- onClick={ () => {
125
- if ( hasUnsavedChanges ) {
126
- setIsLoadingRevisionWithUnsavedChanges(
127
- true
128
- );
129
- } else {
130
- restoreRevision( globalStylesRevision );
131
- }
132
- } }
133
158
  >
134
- { __( 'Apply' ) }
135
- </Button>
136
- </SidebarFixedBottom>
137
- ) }
138
- </div>
139
- { isLoadingRevisionWithUnsavedChanges && (
140
- <ConfirmDialog
141
- title={ __(
142
- 'Loading this revision will discard all unsaved changes.'
159
+ <>
160
+ <h2>
161
+ { __(
162
+ 'Loading this revision will discard all unsaved changes.'
163
+ ) }
164
+ </h2>
165
+ <p>
166
+ { __(
167
+ 'Do you want to replace your unsaved changes in the editor?'
168
+ ) }
169
+ </p>
170
+ </>
171
+ </ConfirmDialog>
143
172
  ) }
144
- isOpen={ isLoadingRevisionWithUnsavedChanges }
145
- confirmButtonText={ __( ' Discard unsaved changes' ) }
146
- onConfirm={ () => restoreRevision( globalStylesRevision ) }
147
- onCancel={ () =>
148
- setIsLoadingRevisionWithUnsavedChanges( false )
173
+ </>
174
+ ) : (
175
+ <Spacer marginX={ 4 } data-testid="global-styles-no-revisions">
176
+ {
177
+ // Adding an existing translation here in case these changes are shipped to WordPress 6.3.
178
+ // Later we could update to something better, e.g., "There are currently no style revisions.".
179
+ __( 'No results found.' )
149
180
  }
150
- >
151
- <>
152
- <h2>
153
- { __(
154
- 'Loading this revision will discard all unsaved changes.'
155
- ) }
156
- </h2>
157
- <p>
158
- { __(
159
- 'Do you want to replace your unsaved changes in the editor?'
160
- ) }
161
- </p>
162
- </>
163
- </ConfirmDialog>
181
+ </Spacer>
164
182
  ) }
165
183
  </>
166
184
  );
@@ -21,11 +21,9 @@ function getRevisionLabel( revision ) {
21
21
 
22
22
  if ( 'unsaved' === revision?.id ) {
23
23
  return sprintf(
24
- /* translators: %(name)s author display name */
25
- __( 'Unsaved changes by %(name)s' ),
26
- {
27
- name: authorDisplayName,
28
- }
24
+ /* translators: %s author display name */
25
+ __( 'Unsaved changes by %s' ),
26
+ authorDisplayName
29
27
  );
30
28
  }
31
29
  const formattedDate = dateI18n(
@@ -35,20 +33,16 @@ function getRevisionLabel( revision ) {
35
33
 
36
34
  return revision?.isLatest
37
35
  ? sprintf(
38
- /* translators: %(name)s author display name, %(date)s: revision creation date */
39
- __( 'Changes saved by %(name)s on %(date)s (current)' ),
40
- {
41
- name: authorDisplayName,
42
- date: formattedDate,
43
- }
36
+ /* translators: %1$s author display name, %2$s: revision creation date */
37
+ __( 'Changes saved by %1$s on %2$s (current)' ),
38
+ authorDisplayName,
39
+ formattedDate
44
40
  )
45
41
  : sprintf(
46
- /* translators: %(name)s author display name, %(date)s: revision creation date */
47
- __( 'Changes saved by %(name)s on %(date)s' ),
48
- {
49
- name: authorDisplayName,
50
- date: formattedDate,
51
- }
42
+ /* translators: %1$s author display name, %2$s: revision creation date */
43
+ __( 'Changes saved by %1$s on %2$s' ),
44
+ authorDisplayName,
45
+ formattedDate
52
46
  );
53
47
  }
54
48
 
@@ -104,22 +98,14 @@ function RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {
104
98
  <span className="edit-site-global-styles-screen-revisions__meta">
105
99
  { isUnsaved
106
100
  ? sprintf(
107
- /* translators: %(name)s author display name */
108
- __(
109
- 'Unsaved changes by %(name)s'
110
- ),
111
- {
112
- name: authorDisplayName,
113
- }
101
+ /* translators: %s author display name */
102
+ __( 'Unsaved changes by %s' ),
103
+ authorDisplayName
114
104
  )
115
105
  : sprintf(
116
- /* translators: %(name)s author display name */
117
- __(
118
- 'Changes saved by %(name)s'
119
- ),
120
- {
121
- name: authorDisplayName,
122
- }
106
+ /* translators: %s author display name */
107
+ __( 'Changes saved by %s' ),
108
+ authorDisplayName
123
109
  ) }
124
110
 
125
111
  <img
@@ -49,6 +49,7 @@ describe( 'useGlobalStylesRevisions', () => {
49
49
  styles: {},
50
50
  },
51
51
  ],
52
+ isLoadingGlobalStylesRevisions: false,
52
53
  };
53
54
 
54
55
  it( 'returns loaded revisions with no unsaved changes', () => {
@@ -117,11 +118,23 @@ describe( 'useGlobalStylesRevisions', () => {
117
118
  const { result } = renderHook( () => useGlobalStylesRevisions() );
118
119
  const { revisions, isLoading, hasUnsavedChanges } = result.current;
119
120
 
120
- expect( isLoading ).toBe( true );
121
+ expect( isLoading ).toBe( false );
121
122
  expect( hasUnsavedChanges ).toBe( false );
122
123
  expect( revisions ).toEqual( [] );
123
124
  } );
124
125
 
126
+ it( 'returns loading status when resolving global revisions', () => {
127
+ useSelect.mockImplementation( () => ( {
128
+ ...selectValue,
129
+ isLoadingGlobalStylesRevisions: true,
130
+ } ) );
131
+
132
+ const { result } = renderHook( () => useGlobalStylesRevisions() );
133
+ const { isLoading } = result.current;
134
+
135
+ expect( isLoading ).toBe( true );
136
+ } );
137
+
125
138
  it( 'returns empty revisions when authors are not yet available', () => {
126
139
  useSelect.mockImplementation( () => ( {
127
140
  ...selectValue,