@wordpress/edit-site 4.5.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/new-template.js +10 -3
  3. package/build/components/add-new-template/new-template.js.map +1 -1
  4. package/build/components/block-editor/index.js +28 -22
  5. package/build/components/block-editor/index.js.map +1 -1
  6. package/build/components/global-styles/border-panel.js +2 -7
  7. package/build/components/global-styles/border-panel.js.map +1 -1
  8. package/build/components/global-styles/hooks.js +2 -2
  9. package/build/components/global-styles/hooks.js.map +1 -1
  10. package/build/components/global-styles/use-global-styles-output.js +1 -7
  11. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  12. package/build/components/list/table.js +1 -1
  13. package/build/components/list/table.js.map +1 -1
  14. package/build/components/navigation-sidebar/navigation-panel/constants.js +2 -2
  15. package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
  16. package/build/components/preferences-modal/index.js +5 -1
  17. package/build/components/preferences-modal/index.js.map +1 -1
  18. package/build/components/routes/use-title.js +3 -1
  19. package/build/components/routes/use-title.js.map +1 -1
  20. package/build/components/sidebar/global-styles-sidebar.js +2 -4
  21. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  22. package/build/components/sidebar/index.js.map +1 -1
  23. package/build/components/template-details/index.js +4 -2
  24. package/build/components/template-details/index.js.map +1 -1
  25. package/build/index.js +11 -2
  26. package/build/index.js.map +1 -1
  27. package/build-module/components/add-new-template/new-template.js +9 -3
  28. package/build-module/components/add-new-template/new-template.js.map +1 -1
  29. package/build-module/components/block-editor/index.js +28 -23
  30. package/build-module/components/block-editor/index.js.map +1 -1
  31. package/build-module/components/global-styles/border-panel.js +2 -7
  32. package/build-module/components/global-styles/border-panel.js.map +1 -1
  33. package/build-module/components/global-styles/hooks.js +2 -2
  34. package/build-module/components/global-styles/hooks.js.map +1 -1
  35. package/build-module/components/global-styles/use-global-styles-output.js +1 -7
  36. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  37. package/build-module/components/list/table.js +1 -1
  38. package/build-module/components/list/table.js.map +1 -1
  39. package/build-module/components/navigation-sidebar/navigation-panel/constants.js +2 -2
  40. package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
  41. package/build-module/components/preferences-modal/index.js +5 -1
  42. package/build-module/components/preferences-modal/index.js.map +1 -1
  43. package/build-module/components/routes/use-title.js +2 -1
  44. package/build-module/components/routes/use-title.js.map +1 -1
  45. package/build-module/components/sidebar/global-styles-sidebar.js +2 -4
  46. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  47. package/build-module/components/sidebar/index.js.map +1 -1
  48. package/build-module/components/template-details/index.js +4 -2
  49. package/build-module/components/template-details/index.js.map +1 -1
  50. package/build-module/index.js +10 -2
  51. package/build-module/index.js.map +1 -1
  52. package/build-style/style-rtl.css +5 -43
  53. package/build-style/style.css +5 -43
  54. package/package.json +29 -29
  55. package/src/components/add-new-template/new-template.js +7 -2
  56. package/src/components/block-editor/index.js +58 -37
  57. package/src/components/global-styles/border-panel.js +2 -12
  58. package/src/components/global-styles/hooks.js +1 -1
  59. package/src/components/global-styles/use-global-styles-output.js +1 -4
  60. package/src/components/header/document-actions/style.scss +1 -1
  61. package/src/components/list/style.scss +1 -0
  62. package/src/components/list/table.js +1 -4
  63. package/src/components/navigation-sidebar/navigation-panel/constants.js +2 -2
  64. package/src/components/preferences-modal/index.js +8 -1
  65. package/src/components/routes/use-title.js +3 -2
  66. package/src/components/sidebar/global-styles-sidebar.js +1 -1
  67. package/src/components/sidebar/index.js +2 -0
  68. package/src/components/sidebar/style.scss +0 -49
  69. package/src/components/template-details/index.js +4 -1
  70. package/src/index.js +17 -0
@@ -31,12 +31,10 @@ export default function GlobalStylesSidebar() {
31
31
  }, __('Beta'))), createElement(FlexItem, null, createElement(DropdownMenu, {
32
32
  icon: moreVertical,
33
33
  label: __('More Global Styles Actions'),
34
- toggleProps: {
35
- disabled: !canReset
36
- },
37
34
  controls: [{
38
35
  title: __('Reset to defaults'),
39
- onClick: onReset
36
+ onClick: onReset,
37
+ isDisabled: !canReset
40
38
  }, {
41
39
  title: __('Welcome Guide'),
42
40
  onClick: () => toggle('core/edit-site', 'welcomeGuideStyles')
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["DropdownMenu","FlexItem","FlexBlock","Flex","__","styles","moreVertical","useDispatch","store","preferencesStore","DefaultSidebar","GlobalStylesUI","useGlobalStylesReset","GlobalStylesSidebar","canReset","onReset","toggle","disabled","title","onClick"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,EAA4CC,IAA5C,QAAwD,uBAAxD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,YAAjB,QAAqC,kBAArC;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,SAASC,cAAT,EAAyBC,oBAAzB,QAAqD,kBAArD;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,QAAF,EAAYC,OAAZ,IAAwBH,oBAAoB,EAAlD;AACA,QAAM;AAAEI,IAAAA;AAAF,MAAaT,WAAW,CAAEE,gBAAF,CAA9B;AAEA,SACC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAGL,EAAE,CAAE,QAAF,CAHX;AAIC,IAAA,IAAI,EAAGC,MAJR;AAKC,IAAA,UAAU,EAAGD,EAAE,CAAE,6BAAF,CALhB;AAMC,IAAA,cAAc,EAAC,wCANhB;AAOC,IAAA,MAAM,EACL,cAAC,IAAD,QACC,cAAC,SAAD,QACC,8BAAUA,EAAE,CAAE,QAAF,CAAZ,CADD,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGA,EAAE,CAAE,MAAF,CADL,CAFD,CADD,EAOC,cAAC,QAAD,QACC,cAAC,YAAD;AACC,MAAA,IAAI,EAAGE,YADR;AAEC,MAAA,KAAK,EAAGF,EAAE,CAAE,4BAAF,CAFX;AAGC,MAAA,WAAW,EAAG;AAAEa,QAAAA,QAAQ,EAAE,CAAEH;AAAd,OAHf;AAIC,MAAA,QAAQ,EAAG,CACV;AACCI,QAAAA,KAAK,EAAEd,EAAE,CAAE,mBAAF,CADV;AAECe,QAAAA,OAAO,EAAEJ;AAFV,OADU,EAKV;AACCG,QAAAA,KAAK,EAAEd,EAAE,CAAE,eAAF,CADV;AAECe,QAAAA,OAAO,EAAE,MACRH,MAAM,CACL,gBADK,EAEL,oBAFK;AAHR,OALU;AAJZ,MADD,CAPD;AARF,KAuCC,cAAC,cAAD,OAvCD,CADD;AA2CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, FlexItem, FlexBlock, Flex } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, moreVertical } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI, useGlobalStylesReset } from '../global-styles';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close global styles sidebar' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t\t<span className=\"edit-site-global-styles-sidebar__beta\">\n\t\t\t\t\t\t\t{ __( 'Beta' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'More Global Styles Actions' ) }\n\t\t\t\t\t\t\ttoggleProps={ { disabled: ! canReset } }\n\t\t\t\t\t\t\tcontrols={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["DropdownMenu","FlexItem","FlexBlock","Flex","__","styles","moreVertical","useDispatch","store","preferencesStore","DefaultSidebar","GlobalStylesUI","useGlobalStylesReset","GlobalStylesSidebar","canReset","onReset","toggle","title","onClick","isDisabled"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,EAA4CC,IAA5C,Q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AEL,oBAFK;AAHR,OANU;AAHZ,MADD,CAPD;AARF,KAuCC,cAAC,cAAD,OAvCD,CADD;AA2CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, FlexItem, FlexBlock, Flex } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, moreVertical } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI, useGlobalStylesReset } from '../global-styles';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close global styles sidebar' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t\t<span className=\"edit-site-global-styles-sidebar__beta\">\n\t\t\t\t\t\t\t{ __( 'Beta' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'More Global Styles Actions' ) }\n\t\t\t\t\t\t\tcontrols={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\t\t\t\tisDisabled: ! canReset,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["createSlotFill","PanelBody","__","cog","useEffect","Fragment","useSelect","useDispatch","store","interfaceStore","blockEditorStore","DefaultSidebar","GlobalStylesSidebar","NavigationMenuSidebar","STORE_NAME","SettingsHeader","TemplateCard","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","select","_sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","getBlockSelectionStart","enableComplementaryArea","sidebarName","MaybeNavigationMenuSidebar","process","env","IS_GUTENBERG_PLUGIN"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,GAAT,QAAoB,kBAApB;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,mBAA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,gBAAd,CAAvB;AACA;AACD,GAPQ,EAON,CAAES,iBAAF,EAAqBD,qBAArB,CAPM,CAAT;AAQA,MAAIS,WAAW,GAAGV,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9BS,IAAAA,WAAW,GAAGR,iBAAiB,GAAGV,aAAH,GAAmBC,gBAAlD;AACA,GAhC8C,CAkC/C;AACA;AACA;;;AACA,MAAIkB,0BAA0B,GAAG/B,QAAjC;;AAEA,MAAKgC,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtCH,IAAAA,0BAA0B,GAAGvB,qBAA7B;AACA;;AAED,SACC,8BACC,cAAC,cAAD;AACC,IAAA,UAAU,EAAGsB,WADd;AAEC,IAAA,KAAK,EAAGjC,EAAE,CAAE,UAAF,CAFX;AAGC,IAAA,IAAI,EAAGC,GAHR;AAIC,IAAA,UAAU,EAAGD,EAAE,CAAE,wBAAF,CAJhB;AAKC,IAAA,MAAM,EAAG,cAAC,cAAD;AAAgB,MAAA,WAAW,EAAGiC;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKjB,gBAAhB,IACD,cAAC,SAAD,QACC,cAAC,YAAD,OADD,CATF,EAaGiB,WAAW,KAAKlB,aAAhB,IACD,cAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAdF,CADD,EAkBC,cAAC,mBAAD,OAlBD,EAmBC,cAAC,0BAAD,OAnBD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cog } from '@wordpress/icons';\nimport { useEffect, Fragment } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport NavigationMenuSidebar from './navigation-menu-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport TemplateCard from './template-card';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst { sidebar, isEditorSidebarOpened, hasBlockSelection } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _sidebar = select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( STORE_NAME );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tSIDEBAR_BLOCK,\n\t\t\t\tSIDEBAR_TEMPLATE,\n\t\t\t].includes( _sidebar );\n\t\t\treturn {\n\t\t\t\tsidebar: _sidebar,\n\t\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\t\thasBlockSelection: !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) return;\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\t// Conditionally include NavMenu sidebar in Plugin only.\n\t// Optimise for dead code elimination.\n\t// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.\n\tlet MaybeNavigationMenuSidebar = Fragment;\n\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\tMaybeNavigationMenuSidebar = NavigationMenuSidebar;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ cog }\n\t\t\t\tcloseLabel={ __( 'Close settings sidebar' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t<GlobalStylesSidebar />\n\t\t\t<MaybeNavigationMenuSidebar />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["createSlotFill","PanelBody","__","cog","useEffect","Fragment","useSelect","useDispatch","store","interfaceStore","blockEditorStore","DefaultSidebar","GlobalStylesSidebar","NavigationMenuSidebar","STORE_NAME","SettingsHeader","TemplateCard","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","select","_sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","getBlockSelectionStart","enableComplementaryArea","sidebarName","MaybeNavigationMenuSidebar","process","env","IS_GUTENBERG_PLUGIN"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAAS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import { __ } from '@wordpress/i18n';\nimport { cog } from '@wordpress/icons';\nimport { useEffect, Fragment } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport NavigationMenuSidebar from './navigation-menu-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport TemplateCard from './template-card';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst { sidebar, isEditorSidebarOpened, hasBlockSelection } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _sidebar = select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( STORE_NAME );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tSIDEBAR_BLOCK,\n\t\t\t\tSIDEBAR_TEMPLATE,\n\t\t\t].includes( _sidebar );\n\t\t\treturn {\n\t\t\t\tsidebar: _sidebar,\n\t\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\t\thasBlockSelection: !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) return;\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\t// Conditionally include NavMenu sidebar in Plugin only.\n\t// Optimise for dead code elimination.\n\t// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.\n\tlet MaybeNavigationMenuSidebar = Fragment;\n\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\tMaybeNavigationMenuSidebar = NavigationMenuSidebar;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ cog }\n\t\t\t\tcloseLabel={ __( 'Close settings sidebar' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t<GlobalStylesSidebar />\n\t\t\t<MaybeNavigationMenuSidebar />\n\t\t</>\n\t);\n}\n"]}
@@ -50,7 +50,9 @@ export default function TemplateDetails(_ref) {
50
50
  // TODO: We should update this to filter by template part's areas as well.
51
51
  postType: template.type,
52
52
  postId: undefined
53
- });
53
+ }); // Only user-created and non-default templates can change the name.
54
+
55
+ const canEditTitle = template.is_custom && !template.has_theme_file;
54
56
 
55
57
  if (!template) {
56
58
  return null;
@@ -65,7 +67,7 @@ export default function TemplateDetails(_ref) {
65
67
  className: "edit-site-template-details"
66
68
  }, createElement("div", {
67
69
  className: "edit-site-template-details__group"
68
- }, template.is_custom ? createElement(EditTemplateTitle, {
70
+ }, canEditTitle ? createElement(EditTemplateTitle, {
69
71
  template: template
70
72
  }) : createElement(Heading, {
71
73
  level: 4,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["useMemo","sprintf","__","Button","MenuGroup","MenuItem","__experimentalHeading","Heading","__experimentalText","Text","useDispatch","useSelect","store","editorStore","isTemplateRevertable","MENU_TEMPLATES","TEMPLATE_PARTS_SUB_MENUS","editSiteStore","TemplateAreas","EditTemplateTitle","useLink","TemplateDetails","template","onClose","title","description","select","__experimentalGetTemplateInfo","revertTemplate","templateSubMenu","type","menu","find","area","browseAllLinkProps","postType","postId","undefined","revert","is_custom"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AACA,SACCC,MADD,EAECC,SAFD,EAGCC,QAHD,EAICC,qBAAqB,IAAIC,OAJ1B,EAKCC,kBAAkB,IAAIC,IALvB,QAMO,uBANP;AAOA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,SACCC,cADD,EAECC,wBAFD,QAGO,kDAHP;AAIA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,OAAT,QAAwB,gBAAxB;AAEA,eAAe,SAASC,eAAT,OAAkD;AAAA,MAAxB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAwB;AAChE,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyBd,SAAS,CACrCe,MAAF,IACCA,MAAM,CAAEb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WAAW,IACZ,cAAC,IAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC,yCAFX;AAGC,IAAA,EAAE,EAAC;AAHJ,KAKGA,WALH,CAdF,CADD,EAyBC,cAAC,aAAD;AAAe,IAAA,4BAA4B,EAAGF;AAA9C,IAzBD,EA2BGT,oBAAoB,CAAEQ,QAAF,CAApB,IACD,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAGpB,EAAE,CAAE,mCAAF,CAFV;AAGC,IAAA,OAAO,EAAGoC;AAHX,KAKGpC,EAAE,CAAE,sBAAF,CALL,CADD,CA5BF,EAuCC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC;AADX,KAEMgC,kBAFN,GAIGjC,OAAO;AACR;AACAC,EAAAA,EAAE,CAAE,eAAF,CAFM,EAGR2B,eAAe,CAACL,KAHR,CAJV,CAvCD,CADD;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport {\n\tMENU_TEMPLATES,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../navigation-sidebar/navigation-panel/constants';\nimport { store as editSiteStore } from '../../store';\nimport TemplateAreas from './template-areas';\nimport EditTemplateTitle from './edit-template-title';\nimport { useLink } from '../routes/link';\n\nexport default function TemplateDetails( { template, onClose } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetTemplateInfo( template ),\n\t\t[]\n\t);\n\tconst { revertTemplate } = useDispatch( editSiteStore );\n\n\tconst templateSubMenu = useMemo( () => {\n\t\tif ( template?.type === 'wp_template' ) {\n\t\t\treturn { title: __( 'templates' ), menu: MENU_TEMPLATES };\n\t\t}\n\n\t\treturn TEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t( { area } ) => area === template?.area\n\t\t);\n\t}, [ template ] );\n\n\tconst browseAllLinkProps = useLink( {\n\t\t// TODO: We should update this to filter by template part's areas as well.\n\t\tpostType: template.type,\n\t\tpostId: undefined,\n\t} );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\tconst revert = () => {\n\t\trevertTemplate( template );\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<div className=\"edit-site-template-details\">\n\t\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t\t{ template.is_custom ? (\n\t\t\t\t\t<EditTemplateTitle template={ template } />\n\t\t\t\t) : (\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\t\tweight={ 600 }\n\t\t\t\t\t\tclassName=\"edit-site-template-details__title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Heading>\n\t\t\t\t) }\n\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\tclassName=\"edit-site-template-details__description\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t<TemplateAreas closeTemplateDetailsDropdown={ onClose } />\n\n\t\t\t{ isTemplateRevertable( template ) && (\n\t\t\t\t<MenuGroup className=\"edit-site-template-details__group edit-site-template-details__revert\">\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tclassName=\"edit-site-template-details__revert-button\"\n\t\t\t\t\t\tinfo={ __( 'Restore template to default state' ) }\n\t\t\t\t\t\tonClick={ revert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-template-details__show-all-button\"\n\t\t\t\t{ ...browseAllLinkProps }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: the template part's area name (\"Headers\", \"Sidebars\") or \"templates\". */\n\t\t\t\t\t__( 'Browse all %s' ),\n\t\t\t\t\ttemplateSubMenu.title\n\t\t\t\t) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["useMemo","sprintf","__","Button","MenuGroup","MenuItem","__experimentalHeading","Heading","__experimentalText","Text","useDispatch","useSelect","store","editorStore","isTemplateRevertable","MENU_TEMPLATES","TEMPLATE_PARTS_SUB_MENUS","editSiteStore","TemplateAreas","EditTemplateTitle","useLink","TemplateDetails","template","onClose","title","description","select","__experimentalGetTemplateInfo","revertTemplate","templateSubMenu","type","menu","find","area","browseAllLinkProps","postType","postId","undefined","canEditTitle","is_custom","has_theme_file","revert"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AACA,SACCC,MADD,EAECC,SAFD,EAGCC,QAHD,EAICC,qBAAqB,IAAIC,OAJ1B,EAKCC,kBAAkB,IAAIC,IALvB,QAMO,uBANP;AAOA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,SACCC,cADD,EAECC,wBAFD,QAGO,kDAHP;AAIA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,iBAAP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CAAEN,QAAF,CAAd;AACAC,IAAAA,OAAO;AACP,GAHD;;AAKA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGe,YAAY,GACb,cAAC,iBAAD;AAAmB,IAAA,QAAQ,EAAGhB;AAA9B,IADa,GAGb,cAAC,OAAD;AACC,IAAA,KAAK,EAAG,CADT;AAEC,IAAA,MAAM,EAAG,GAFV;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGE,KALH,CAJF,EAaGC,WAAW,IACZ,cAAC,IAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC,yCAFX;AAGC,IAAA,EAAE,EAAC;AAHJ,KAKGA,WALH,CAdF,CADD,EAyBC,cAAC,aAAD;AAAe,IAAA,4BAA4B,EAAGF;AAA9C,IAzBD,EA2BGT,oBAAoB,CAAEQ,QAAF,CAApB,IACD,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAGpB,EAAE,CAAE,mCAAF,CAFV;AAGC,IAAA,OAAO,EAAGuC;AAHX,KAKGvC,EAAE,CAAE,sBAAF,CALL,CADD,CA5BF,EAuCC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC;AADX,KAEMgC,kBAFN,GAIGjC,OAAO;AACR;AACAC,EAAAA,EAAE,CAAE,eAAF,CAFM,EAGR2B,eAAe,CAACL,KAHR,CAJV,CAvCD,CADD;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport {\n\tMENU_TEMPLATES,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../navigation-sidebar/navigation-panel/constants';\nimport { store as editSiteStore } from '../../store';\nimport TemplateAreas from './template-areas';\nimport EditTemplateTitle from './edit-template-title';\nimport { useLink } from '../routes/link';\n\nexport default function TemplateDetails( { template, onClose } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetTemplateInfo( template ),\n\t\t[]\n\t);\n\tconst { revertTemplate } = useDispatch( editSiteStore );\n\n\tconst templateSubMenu = useMemo( () => {\n\t\tif ( template?.type === 'wp_template' ) {\n\t\t\treturn { title: __( 'templates' ), menu: MENU_TEMPLATES };\n\t\t}\n\n\t\treturn TEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t( { area } ) => area === template?.area\n\t\t);\n\t}, [ template ] );\n\n\tconst browseAllLinkProps = useLink( {\n\t\t// TODO: We should update this to filter by template part's areas as well.\n\t\tpostType: template.type,\n\t\tpostId: undefined,\n\t} );\n\n\t// Only user-created and non-default templates can change the name.\n\tconst canEditTitle = template.is_custom && ! template.has_theme_file;\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\tconst revert = () => {\n\t\trevertTemplate( template );\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<div className=\"edit-site-template-details\">\n\t\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t\t{ canEditTitle ? (\n\t\t\t\t\t<EditTemplateTitle template={ template } />\n\t\t\t\t) : (\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\t\tweight={ 600 }\n\t\t\t\t\t\tclassName=\"edit-site-template-details__title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Heading>\n\t\t\t\t) }\n\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\tclassName=\"edit-site-template-details__description\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t<TemplateAreas closeTemplateDetailsDropdown={ onClose } />\n\n\t\t\t{ isTemplateRevertable( template ) && (\n\t\t\t\t<MenuGroup className=\"edit-site-template-details__group edit-site-template-details__revert\">\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tclassName=\"edit-site-template-details__revert-button\"\n\t\t\t\t\t\tinfo={ __( 'Restore template to default state' ) }\n\t\t\t\t\t\tonClick={ revert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-template-details__show-all-button\"\n\t\t\t\t{ ...browseAllLinkProps }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: the template part's area name (\"Headers\", \"Sidebars\") or \"templates\". */\n\t\t\t\t\t__( 'Browse all %s' ),\n\t\t\t\t\ttemplateSubMenu.title\n\t\t\t\t) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}
@@ -9,6 +9,7 @@ import { dispatch, select } from '@wordpress/data';
9
9
  import { render, unmountComponentAtNode } from '@wordpress/element';
10
10
  import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions, __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data';
11
11
  import { store as editorStore } from '@wordpress/editor';
12
+ import { store as interfaceStore } from '@wordpress/interface';
12
13
  import { store as preferencesStore } from '@wordpress/preferences';
13
14
  import { __ } from '@wordpress/i18n';
14
15
  import { store as viewportStore } from '@wordpress/viewport';
@@ -53,8 +54,15 @@ export function reinitializeEditor(target, settings) {
53
54
  focusMode: false,
54
55
  keepCaretInsideBlock: false,
55
56
  welcomeGuide: true,
56
- welcomeGuideStyles: true
57
- });
57
+ welcomeGuideStyles: true,
58
+ shouldListViewOpenByDefault: false
59
+ }); // Check if the block list view should be open by default.
60
+
61
+ if (select(preferencesStore).get('core/edit-site', 'showListViewByDefault')) {
62
+ dispatch(editSiteStore).setIsListViewOpened(true);
63
+ }
64
+
65
+ dispatch(interfaceStore).setDefaultComplementaryArea('core/edit-site', 'edit-site/template');
58
66
  dispatch(editSiteStore).updateSettings(settings); // Keep the defaultTemplateTypes in the core/editor settings too,
59
67
  // so that they can be selected with core/editor selectors in any editor.
60
68
  // This is needed because edit-site doesn't initialize with EditorProvider,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","select","render","unmountComponentAtNode","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","preferencesStore","__","viewportStore","getQueryArgs","editSiteStore","EditSiteApp","getIsListPage","ErrorBoundaryWarning","reinitializeEditor","target","settings","__unstableHomeTemplate","reboot","bind","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","isLandingOnListPage","window","location","href","setIsNavigationPanelOpened","isViewportMatch","initializeEditor","id","search","searchOptions","__experimentalFetchRichUrlData","document","getElementById","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","default","__experimentalMainDashboardButton","__experimentalNavigationToggle","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SACCC,kCAAkC,I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AAD4B,KAAF,CAA5C;AAGA;;AAEDlC,EAAAA,kBAAkB,CAAEC,MAAF,EAAUC,QAAV,CAAlB;AACA;AAED,SAASiC,OAAO,IAAIC,iCAApB,QAA6D,oCAA7D;AACA,SAASD,OAAO,IAAIE,8BAApB,QAA0D,mDAA1D;AACA,SAASF,OAAO,IAAIG,aAApB,QAAyC,qCAAzC;AACA,SAASH,OAAO,IAAII,yBAApB,QAAqD,mDAArD;AACA,SAASJ,OAAO,IAAIK,kBAApB,QAA8C,2CAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch, select } from '@wordpress/data';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { getQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport EditSiteApp from './components/app';\nimport getIsListPage from './utils/get-is-list-page';\nimport ErrorBoundaryWarning from './components/error-boundary/warning';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\t// Display warning if editor wasn't able to resolve homepage template.\n\tif ( ! settings.__unstableHomeTemplate ) {\n\t\trender(\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor is unable to find a block template for the homepage.'\n\t\t\t\t) }\n\t\t\t\tdashboardLink=\"index.php\"\n\t\t\t/>,\n\t\t\ttarget\n\t\t);\n\t\treturn;\n\t}\n\n\t// This will be a no-op if the target doesn't have any React nodes.\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\t{\n\t\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\t\teditorMode: 'visual',\n\t\t\tfixedToolbar: false,\n\t\t\tfocusMode: false,\n\t\t\tkeepCaretInsideBlock: false,\n\t\t\twelcomeGuide: true,\n\t\t\twelcomeGuideStyles: true,\n\t\t} );\n\n\t\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t\t// so that they can be selected with core/editor selectors in any editor.\n\t\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t\t// which internally uses updateEditorSettings as well.\n\t\tdispatch( editorStore ).updateEditorSettings( {\n\t\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t\t} );\n\n\t\tconst isLandingOnListPage = getIsListPage(\n\t\t\tgetQueryArgs( window.location.href )\n\t\t);\n\n\t\tif ( isLandingOnListPage ) {\n\t\t\t// Default the navigation panel to be opened when we're in a bigger\n\t\t\t// screen and land in the list screen.\n\t\t\tdispatch( editSiteStore ).setIsNavigationPanelOpened(\n\t\t\t\tselect( viewportStore ).isViewportMatch( 'medium' )\n\t\t\t);\n\t\t}\n\t}\n\n\trender( <EditSiteApp reboot={ reboot } />, target );\n}\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tconst target = document.getElementById( id );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\treinitializeEditor( target, settings );\n}\n\nexport { default as __experimentalMainDashboardButton } from './components/main-dashboard-button';\nexport { default as __experimentalNavigationToggle } from './components/navigation-sidebar/navigation-toggle';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","select","render","unmountComponentAtNode","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","__","viewportStore","getQueryArgs","editSiteStore","EditSiteApp","getIsListPage","ErrorBoundaryWarning","reinitializeEditor","target","settings","__unstableHomeTemplate","reboot","bind","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","shouldListViewOpenByDefault","get","setIsListViewOpened","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","isLandingOnListPage","window","location","href","setIsNavigationPanelOpened","isViewportMatch","initializeEditor","id","search","searchOptions","__experimentalFetchRichUrlData","document","getElementById","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","default","__experimentalMainDashboardButton","__experimentalNavigationToggle","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC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;;AACA,OAAO,SAAS0B,gBAAT,CAA2BC,EAA3B,EAA+B1B,QAA/B,EAA0C;AAChDA,EAAAA,QAAQ,CAAChB,kCAAT,GAA8C,CAAE2C,MAAF,EAAUC,aAAV,KAC7C3C,oBAAoB,CAAE0C,MAAF,EAAUC,aAAV,EAAyB5B,QAAzB,CADrB;;AAEAA,EAAAA,QAAQ,CAAC6B,8BAAT,GAA0C1C,YAA1C;AAEA,QAAMY,MAAM,GAAG+B,QAAQ,CAACC,cAAT,CAAyBL,EAAzB,CAAf;;AAEA9C,EAAAA,QAAQ,CAAEH,WAAF,CAAR,CAAwBuD,qCAAxB;;AACAtD,EAAAA,kBAAkB;;AAClB,MAAKuD,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AACtCxD,IAAAA,4CAA4C,CAAE;AAC7CyD,MAAAA,eAAe,EAAE;AAD4B,KAAF,CAA5C;AAGA;;AAEDtC,EAAAA,kBAAkB,CAAEC,MAAF,EAAUC,QAAV,CAAlB;AACA;AAED,SAASqC,OAAO,IAAIC,iCAApB,QAA6D,oCAA7D;AACA,SAASD,OAAO,IAAIE,8BAApB,QAA0D,mDAA1D;AACA,SAASF,OAAO,IAAIG,aAApB,QAAyC,qCAAzC;AACA,SAASH,OAAO,IAAII,yBAApB,QAAqD,mDAArD;AACA,SAASJ,OAAO,IAAIK,kBAApB,QAA8C,2CAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch, select } from '@wordpress/data';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { getQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport EditSiteApp from './components/app';\nimport getIsListPage from './utils/get-is-list-page';\nimport ErrorBoundaryWarning from './components/error-boundary/warning';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\t// Display warning if editor wasn't able to resolve homepage template.\n\tif ( ! settings.__unstableHomeTemplate ) {\n\t\trender(\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor is unable to find a block template for the homepage.'\n\t\t\t\t) }\n\t\t\t\tdashboardLink=\"index.php\"\n\t\t\t/>,\n\t\t\ttarget\n\t\t);\n\t\treturn;\n\t}\n\n\t// This will be a no-op if the target doesn't have any React nodes.\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\t{\n\t\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\t\teditorMode: 'visual',\n\t\t\tfixedToolbar: false,\n\t\t\tfocusMode: false,\n\t\t\tkeepCaretInsideBlock: false,\n\t\t\twelcomeGuide: true,\n\t\t\twelcomeGuideStyles: true,\n\t\t\tshouldListViewOpenByDefault: false,\n\t\t} );\n\n\t\t// Check if the block list view should be open by default.\n\t\tif (\n\t\t\tselect( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showListViewByDefault'\n\t\t\t)\n\t\t) {\n\t\t\tdispatch( editSiteStore ).setIsListViewOpened( true );\n\t\t}\n\n\t\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t\t'core/edit-site',\n\t\t\t'edit-site/template'\n\t\t);\n\n\t\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t\t// so that they can be selected with core/editor selectors in any editor.\n\t\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t\t// which internally uses updateEditorSettings as well.\n\t\tdispatch( editorStore ).updateEditorSettings( {\n\t\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t\t} );\n\n\t\tconst isLandingOnListPage = getIsListPage(\n\t\t\tgetQueryArgs( window.location.href )\n\t\t);\n\n\t\tif ( isLandingOnListPage ) {\n\t\t\t// Default the navigation panel to be opened when we're in a bigger\n\t\t\t// screen and land in the list screen.\n\t\t\tdispatch( editSiteStore ).setIsNavigationPanelOpened(\n\t\t\t\tselect( viewportStore ).isViewportMatch( 'medium' )\n\t\t\t);\n\t\t}\n\t}\n\n\trender( <EditSiteApp reboot={ reboot } />, target );\n}\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tconst target = document.getElementById( id );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\treinitializeEditor( target, settings );\n}\n\nexport { default as __experimentalMainDashboardButton } from './components/main-dashboard-button';\nexport { default as __experimentalNavigationToggle } from './components/navigation-sidebar/navigation-toggle';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\n"]}
@@ -416,7 +416,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
416
416
  }
417
417
  @media (min-width: 480px) {
418
418
  .interface-more-menu-dropdown__content .components-popover__content {
419
- width: auto;
420
419
  max-width: 480px;
421
420
  }
422
421
  }
@@ -1031,7 +1030,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
1031
1030
  margin-right: 6px;
1032
1031
  }
1033
1032
 
1034
- .edit-site-document-actions__info-dropdown > .components-popover__content > div {
1033
+ .edit-site-document-actions__info-dropdown > .components-popover__content {
1035
1034
  padding: 0;
1036
1035
  min-width: 240px;
1037
1036
  }
@@ -1354,6 +1353,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1354
1353
  }
1355
1354
  .edit-site-list-table tr .edit-site-list-table-column:nth-child(2) {
1356
1355
  width: calc(40% - 18px);
1356
+ word-break: break-word;
1357
1357
  }
1358
1358
  .edit-site-list-table tr .edit-site-list-table-column:nth-child(3) {
1359
1359
  min-width: 36px;
@@ -1542,44 +1542,6 @@ body.is-fullscreen-mode .edit-site-list-header {
1542
1542
  line-height: 1;
1543
1543
  }
1544
1544
 
1545
- .edit-site-global-styles-sidebar__border-box-control__popover .components-popover__content,
1546
- .edit-site-global-styles-sidebar__border-box-control__popover-top .components-popover__content,
1547
- .edit-site-global-styles-sidebar__border-box-control__popover-right .components-popover__content,
1548
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom .components-popover__content,
1549
- .edit-site-global-styles-sidebar__border-box-control__popover-left .components-popover__content {
1550
- width: 282px;
1551
- }
1552
-
1553
- @media (min-width: 782px) {
1554
- .edit-site-global-styles-sidebar__border-box-control__popover .components-popover__content,
1555
- .edit-site-global-styles-sidebar__border-box-control__popover-left .components-popover__content {
1556
- margin-left: 52px !important;
1557
- }
1558
-
1559
- .edit-site-global-styles-sidebar__border-box-control__popover-top .components-popover__content,
1560
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom .components-popover__content {
1561
- margin-left: 107px !important;
1562
- }
1563
-
1564
- .edit-site-global-styles-sidebar__border-box-control__popover-right .components-popover__content {
1565
- margin-left: 162px !important;
1566
- }
1567
-
1568
- .edit-site-global-styles-sidebar__border-box-control__popover.is-from-top .components-popover__content,
1569
- .edit-site-global-styles-sidebar__border-box-control__popover-top.is-from-top .components-popover__content,
1570
- .edit-site-global-styles-sidebar__border-box-control__popover-right.is-from-top .components-popover__content,
1571
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom.is-from-top .components-popover__content,
1572
- .edit-site-global-styles-sidebar__border-box-control__popover-left.is-from-top .components-popover__content {
1573
- margin-top: -52px !important;
1574
- }
1575
- .edit-site-global-styles-sidebar__border-box-control__popover.is-from-bottom .components-popover__content,
1576
- .edit-site-global-styles-sidebar__border-box-control__popover-top.is-from-bottom .components-popover__content,
1577
- .edit-site-global-styles-sidebar__border-box-control__popover-right.is-from-bottom .components-popover__content,
1578
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom.is-from-bottom .components-popover__content,
1579
- .edit-site-global-styles-sidebar__border-box-control__popover-left.is-from-bottom .components-popover__content {
1580
- margin-bottom: -52px !important;
1581
- }
1582
- }
1583
1545
  .edit-site-global-styles-sidebar hr {
1584
1546
  margin: 0;
1585
1547
  }
@@ -1632,7 +1594,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1632
1594
  visibility: hidden;
1633
1595
  }
1634
1596
  .components-button.edit-site-sidebar__panel-tab.is-active {
1635
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) transparent, inset 0 -4px 0 0 var(--wp-admin-theme-color);
1597
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) transparent, inset 0 -1.5px 0 0 var(--wp-admin-theme-color);
1636
1598
  position: relative;
1637
1599
  z-index: 1;
1638
1600
  }
@@ -1643,7 +1605,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1643
1605
  bottom: 1px;
1644
1606
  left: 0;
1645
1607
  right: 0;
1646
- border-bottom: 4px solid transparent;
1608
+ border-bottom: 1.5px solid transparent;
1647
1609
  }
1648
1610
  .components-button.edit-site-sidebar__panel-tab:focus {
1649
1611
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
@@ -1651,7 +1613,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1651
1613
  z-index: 1;
1652
1614
  }
1653
1615
  .components-button.edit-site-sidebar__panel-tab.is-active:focus {
1654
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -4px 0 0 var(--wp-admin-theme-color);
1616
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -1.5px 0 0 var(--wp-admin-theme-color);
1655
1617
  }
1656
1618
 
1657
1619
  @keyframes loadingpulse {
@@ -416,7 +416,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
416
416
  }
417
417
  @media (min-width: 480px) {
418
418
  .interface-more-menu-dropdown__content .components-popover__content {
419
- width: auto;
420
419
  max-width: 480px;
421
420
  }
422
421
  }
@@ -1031,7 +1030,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
1031
1030
  margin-left: 6px;
1032
1031
  }
1033
1032
 
1034
- .edit-site-document-actions__info-dropdown > .components-popover__content > div {
1033
+ .edit-site-document-actions__info-dropdown > .components-popover__content {
1035
1034
  padding: 0;
1036
1035
  min-width: 240px;
1037
1036
  }
@@ -1354,6 +1353,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1354
1353
  }
1355
1354
  .edit-site-list-table tr .edit-site-list-table-column:nth-child(2) {
1356
1355
  width: calc(40% - 18px);
1356
+ word-break: break-word;
1357
1357
  }
1358
1358
  .edit-site-list-table tr .edit-site-list-table-column:nth-child(3) {
1359
1359
  min-width: 36px;
@@ -1542,44 +1542,6 @@ body.is-fullscreen-mode .edit-site-list-header {
1542
1542
  line-height: 1;
1543
1543
  }
1544
1544
 
1545
- .edit-site-global-styles-sidebar__border-box-control__popover .components-popover__content,
1546
- .edit-site-global-styles-sidebar__border-box-control__popover-top .components-popover__content,
1547
- .edit-site-global-styles-sidebar__border-box-control__popover-right .components-popover__content,
1548
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom .components-popover__content,
1549
- .edit-site-global-styles-sidebar__border-box-control__popover-left .components-popover__content {
1550
- width: 282px;
1551
- }
1552
-
1553
- @media (min-width: 782px) {
1554
- .edit-site-global-styles-sidebar__border-box-control__popover .components-popover__content,
1555
- .edit-site-global-styles-sidebar__border-box-control__popover-left .components-popover__content {
1556
- margin-right: 52px !important;
1557
- }
1558
-
1559
- .edit-site-global-styles-sidebar__border-box-control__popover-top .components-popover__content,
1560
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom .components-popover__content {
1561
- margin-right: 107px !important;
1562
- }
1563
-
1564
- .edit-site-global-styles-sidebar__border-box-control__popover-right .components-popover__content {
1565
- margin-right: 162px !important;
1566
- }
1567
-
1568
- .edit-site-global-styles-sidebar__border-box-control__popover.is-from-top .components-popover__content,
1569
- .edit-site-global-styles-sidebar__border-box-control__popover-top.is-from-top .components-popover__content,
1570
- .edit-site-global-styles-sidebar__border-box-control__popover-right.is-from-top .components-popover__content,
1571
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom.is-from-top .components-popover__content,
1572
- .edit-site-global-styles-sidebar__border-box-control__popover-left.is-from-top .components-popover__content {
1573
- margin-top: -52px !important;
1574
- }
1575
- .edit-site-global-styles-sidebar__border-box-control__popover.is-from-bottom .components-popover__content,
1576
- .edit-site-global-styles-sidebar__border-box-control__popover-top.is-from-bottom .components-popover__content,
1577
- .edit-site-global-styles-sidebar__border-box-control__popover-right.is-from-bottom .components-popover__content,
1578
- .edit-site-global-styles-sidebar__border-box-control__popover-bottom.is-from-bottom .components-popover__content,
1579
- .edit-site-global-styles-sidebar__border-box-control__popover-left.is-from-bottom .components-popover__content {
1580
- margin-bottom: -52px !important;
1581
- }
1582
- }
1583
1545
  .edit-site-global-styles-sidebar hr {
1584
1546
  margin: 0;
1585
1547
  }
@@ -1632,7 +1594,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1632
1594
  visibility: hidden;
1633
1595
  }
1634
1596
  .components-button.edit-site-sidebar__panel-tab.is-active {
1635
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) transparent, inset 0 -4px 0 0 var(--wp-admin-theme-color);
1597
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) transparent, inset 0 -1.5px 0 0 var(--wp-admin-theme-color);
1636
1598
  position: relative;
1637
1599
  z-index: 1;
1638
1600
  }
@@ -1643,7 +1605,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1643
1605
  bottom: 1px;
1644
1606
  right: 0;
1645
1607
  left: 0;
1646
- border-bottom: 4px solid transparent;
1608
+ border-bottom: 1.5px solid transparent;
1647
1609
  }
1648
1610
  .components-button.edit-site-sidebar__panel-tab:focus {
1649
1611
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
@@ -1651,7 +1613,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1651
1613
  z-index: 1;
1652
1614
  }
1653
1615
  .components-button.edit-site-sidebar__panel-tab.is-active:focus {
1654
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -4px 0 0 var(--wp-admin-theme-color);
1616
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -1.5px 0 0 var(--wp-admin-theme-color);
1655
1617
  }
1656
1618
 
1657
1619
  @keyframes loadingpulse {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "4.5.0",
3
+ "version": "4.6.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,33 +27,33 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.8.0",
31
- "@wordpress/api-fetch": "^6.5.0",
32
- "@wordpress/block-editor": "^9.0.0",
33
- "@wordpress/block-library": "^7.5.0",
34
- "@wordpress/blocks": "^11.7.0",
35
- "@wordpress/components": "^19.10.0",
36
- "@wordpress/compose": "^5.6.0",
37
- "@wordpress/core-data": "^4.6.0",
38
- "@wordpress/data": "^6.8.0",
39
- "@wordpress/deprecated": "^3.8.0",
40
- "@wordpress/editor": "^12.7.0",
41
- "@wordpress/element": "^4.6.0",
42
- "@wordpress/hooks": "^3.8.0",
43
- "@wordpress/html-entities": "^3.8.0",
44
- "@wordpress/i18n": "^4.8.0",
45
- "@wordpress/icons": "^8.4.0",
46
- "@wordpress/interface": "^4.7.0",
47
- "@wordpress/keyboard-shortcuts": "^3.6.0",
48
- "@wordpress/keycodes": "^3.8.0",
49
- "@wordpress/media-utils": "^3.6.0",
50
- "@wordpress/notices": "^3.8.0",
51
- "@wordpress/plugins": "^4.6.0",
52
- "@wordpress/preferences": "^2.0.0",
53
- "@wordpress/reusable-blocks": "^3.6.0",
54
- "@wordpress/style-engine": "^0.7.0",
55
- "@wordpress/url": "^3.9.0",
56
- "@wordpress/viewport": "^4.6.0",
30
+ "@wordpress/a11y": "^3.9.0",
31
+ "@wordpress/api-fetch": "^6.6.0",
32
+ "@wordpress/block-editor": "^9.1.0",
33
+ "@wordpress/block-library": "^7.6.0",
34
+ "@wordpress/blocks": "^11.8.0",
35
+ "@wordpress/components": "^19.11.0",
36
+ "@wordpress/compose": "^5.7.0",
37
+ "@wordpress/core-data": "^4.7.0",
38
+ "@wordpress/data": "^6.9.0",
39
+ "@wordpress/deprecated": "^3.9.0",
40
+ "@wordpress/editor": "^12.8.0",
41
+ "@wordpress/element": "^4.7.0",
42
+ "@wordpress/hooks": "^3.9.0",
43
+ "@wordpress/html-entities": "^3.9.0",
44
+ "@wordpress/i18n": "^4.9.0",
45
+ "@wordpress/icons": "^9.0.0",
46
+ "@wordpress/interface": "^4.8.0",
47
+ "@wordpress/keyboard-shortcuts": "^3.7.0",
48
+ "@wordpress/keycodes": "^3.9.0",
49
+ "@wordpress/media-utils": "^4.0.0",
50
+ "@wordpress/notices": "^3.9.0",
51
+ "@wordpress/plugins": "^4.7.0",
52
+ "@wordpress/preferences": "^2.1.0",
53
+ "@wordpress/reusable-blocks": "^3.7.0",
54
+ "@wordpress/style-engine": "^0.8.0",
55
+ "@wordpress/url": "^3.10.0",
56
+ "@wordpress/viewport": "^4.7.0",
57
57
  "classnames": "^2.3.1",
58
58
  "downloadjs": "^1.4.7",
59
59
  "history": "^5.1.0",
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "4631d515033397fcfeda77e5755960253caef9bf"
71
+ "gitHead": "198fa129cf1af8dc615918987ea6795cd40ab7df"
72
72
  }
@@ -37,10 +37,11 @@ import { store as noticesStore } from '@wordpress/notices';
37
37
  * Internal dependencies
38
38
  */
39
39
  import { useHistory } from '../routes';
40
+ import { store as editSiteStore } from '../../store';
40
41
 
41
42
  const DEFAULT_TEMPLATE_SLUGS = [
42
43
  'front-page',
43
- 'single-post',
44
+ 'single',
44
45
  'page',
45
46
  'index',
46
47
  'archive',
@@ -55,7 +56,7 @@ const DEFAULT_TEMPLATE_SLUGS = [
55
56
 
56
57
  const TEMPLATE_ICONS = {
57
58
  'front-page': home,
58
- 'single-post': post,
59
+ single: post,
59
60
  page,
60
61
  archive,
61
62
  search,
@@ -86,6 +87,7 @@ export default function NewTemplate( { postType } ) {
86
87
  );
87
88
  const { saveEntityRecord } = useDispatch( coreStore );
88
89
  const { createErrorNotice } = useDispatch( noticesStore );
90
+ const { setTemplate } = useDispatch( editSiteStore );
89
91
 
90
92
  async function createTemplate( { slug } ) {
91
93
  try {
@@ -106,6 +108,9 @@ export default function NewTemplate( { postType } ) {
106
108
  { throwOnError: true }
107
109
  );
108
110
 
111
+ // Set template before navigating away to avoid initial stale value.
112
+ setTemplate( template.id, template.slug );
113
+
109
114
  // Navigate to the created template editor.
110
115
  history.push( {
111
116
  postId: template.id,