@wordpress/edit-site 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-template/add-custom-template-modal.js +12 -3
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +8 -7
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +3 -6
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/editor/index.js +3 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +1 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +11 -8
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +41 -487
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/duotone-panel.js +78 -0
- package/build/components/global-styles/duotone-panel.js.map +1 -0
- package/build/components/global-styles/filter-utils.js +17 -0
- package/build/components/global-styles/filter-utils.js.map +1 -0
- package/build/components/global-styles/preview.js +9 -5
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +4 -8
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-border.js +1 -1
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-filters.js +46 -0
- package/build/components/global-styles/screen-filters.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +13 -5
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-variations.js +1 -1
- package/build/components/global-styles/screen-variations.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +6 -4
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -5
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +7 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +124 -0
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -0
- package/build/components/keyboard-shortcuts/global.js +48 -0
- package/build/components/keyboard-shortcuts/global.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +67 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +153 -0
- package/build/components/keyboard-shortcuts/register.js.map +1 -0
- package/build/components/layout/index.js +5 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +41 -42
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/table.js +3 -2
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-inspector/navigation-menu.js +22 -5
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build/components/save-button/index.js +5 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-panel/index.js +11 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +28 -16
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +30 -0
- package/build/components/sidebar-button/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +10 -10
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +3 -3
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +17 -16
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +10 -4
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +9 -19
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +25 -15
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +8 -7
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/style-book/index.js +17 -2
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +36 -34
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +65 -18
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-details/index.js +7 -9
- package/build/components/template-details/index.js.map +1 -1
- package/build/index.js +10 -22
- package/build/index.js.map +1 -1
- package/build/store/actions.js +2 -2
- package/build/store/actions.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +13 -4
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +8 -7
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +3 -6
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/editor/index.js +3 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +1 -1
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +12 -9
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +43 -480
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/duotone-panel.js +67 -0
- package/build-module/components/global-styles/duotone-panel.js.map +1 -0
- package/build-module/components/global-styles/filter-utils.js +9 -0
- package/build-module/components/global-styles/filter-utils.js.map +1 -0
- package/build-module/components/global-styles/preview.js +10 -6
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +4 -6
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +1 -1
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-filters.js +33 -0
- package/build-module/components/global-styles/screen-filters.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +11 -2
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-variations.js +1 -1
- package/build-module/components/global-styles/screen-variations.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +6 -4
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +2 -5
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +6 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +108 -0
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/global.js +37 -0
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +65 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +141 -0
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -0
- package/build-module/components/layout/index.js +3 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +43 -44
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/table.js +3 -2
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +25 -8
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build-module/components/save-button/index.js +5 -2
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +8 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +25 -18
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +18 -0
- package/build-module/components/sidebar-button/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +8 -11
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +3 -3
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +16 -17
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +10 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +8 -18
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +23 -16
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -7
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/style-book/index.js +17 -3
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +36 -34
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +63 -18
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-details/index.js +7 -8
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/index.js +12 -22
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +2 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +41 -38
- package/build-style/style.css +41 -38
- package/package.json +31 -31
- package/src/components/add-new-template/add-custom-template-modal.js +14 -10
- package/src/components/add-new-template/new-template-part.js +7 -9
- package/src/components/add-new-template/new-template.js +3 -6
- package/src/components/add-new-template/style.scss +0 -5
- package/src/components/block-editor/style.scss +1 -1
- package/src/components/editor/index.js +4 -3
- package/src/components/editor/style.scss +0 -6
- package/src/components/global-styles/border-panel.js +1 -1
- package/src/components/global-styles/context-menu.js +16 -10
- package/src/components/global-styles/dimensions-panel.js +43 -577
- package/src/components/global-styles/duotone-panel.js +82 -0
- package/src/components/global-styles/filter-utils.js +9 -0
- package/src/components/global-styles/preview.js +155 -140
- package/src/components/global-styles/screen-block-list.js +4 -9
- package/src/components/global-styles/screen-border.js +1 -1
- package/src/components/global-styles/screen-filters.js +27 -0
- package/src/components/global-styles/screen-layout.js +9 -2
- package/src/components/global-styles/screen-variations.js +0 -1
- package/src/components/global-styles/shadow-panel.js +4 -3
- package/src/components/global-styles/typography-panel.js +5 -7
- package/src/components/global-styles/ui.js +6 -1
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -0
- package/src/components/keyboard-shortcuts/edit-mode.js +116 -0
- package/src/components/keyboard-shortcuts/global.js +35 -0
- package/src/components/keyboard-shortcuts/index.js +70 -0
- package/src/components/keyboard-shortcuts/register.js +157 -0
- package/src/components/layout/index.js +4 -0
- package/src/components/layout/style.scss +8 -1
- package/src/components/list/added-by.js +48 -55
- package/src/components/list/style.scss +5 -13
- package/src/components/list/table.js +4 -5
- package/src/components/navigation-inspector/navigation-menu.js +24 -6
- package/src/components/save-button/index.js +2 -2
- package/src/components/save-panel/index.js +8 -1
- package/src/components/sidebar/index.js +32 -14
- package/src/components/sidebar-button/index.js +21 -0
- package/src/components/sidebar-button/style.scss +23 -0
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +3 -7
- package/src/components/sidebar-edit-mode/style.scss +16 -0
- package/src/components/sidebar-navigation-screen/index.js +31 -38
- package/src/components/sidebar-navigation-screen/style.scss +1 -9
- package/src/components/sidebar-navigation-screen-main/index.js +3 -3
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +24 -20
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +7 -3
- package/src/components/sidebar-navigation-screen-template/index.js +7 -19
- package/src/components/sidebar-navigation-screen-templates/index.js +22 -14
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -5
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -11
- package/src/components/style-book/index.js +25 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +28 -23
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +72 -17
- package/src/components/template-details/index.js +5 -6
- package/src/index.js +6 -21
- package/src/store/actions.js +2 -2
- package/src/style.scss +1 -0
- package/src/utils/get-is-list-page.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-inspector/navigation-menu.js"],"names":["ALLOWED_BLOCKS","NavigationMenu","innerBlocks","onSelect","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-inspector/navigation-menu.js"],"names":["ALLOWED_BLOCKS","NavigationMenu","innerBlocks","onSelect","clientIdsTree","select","__unstableGetClientIdsTree","blockEditorStore","updateBlockListSettings","OffCanvasEditor","LeafMoreMenu","blockEditorPrivateApis","allowedBlocks","forEach","block","name","clientId","display"],"mappings":";;;;;;;AASA;;AANA;;AAOA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG;AACtB,qBAAmB,CAClB,sBADkB,EAElB,aAFkB,EAGlB,mBAHkB,EAIlB,gBAJkB,EAKlB,aALkB,EAMlB,gBANkB,EAOlB,iBAPkB,EAQlB,gBARkB,EASlB,yBATkB,CADG;AAYtB,uBAAqB,CAAE,kBAAF,CAZC;AAatB,6BAA2B,CAC1B,sBAD0B,EAE1B,yBAF0B,CAbL;AAiBtB,0BAAwB,CACvB,sBADuB,EAEvB,yBAFuB,CAjBF;AAqBtB,oBAAkB,CAAE,qBAAF;AArBI,CAAvB;;AAwBe,SAASC,cAAT,OAAqD;AAAA,MAA5B;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,GAA4B;AACnE,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAiCD,MAAM,CAAEE,kBAAF,CAA7C;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,0BAA0B;AADnC,KAAP;AAGA,GALyB,CAA1B;AAMA,QAAM;AAAEE,IAAAA;AAAF,MAA8B,uBAAaD,kBAAb,CAApC;AAEA,QAAM;AAAEE,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB,MAAoC,yBAAQC,wBAAR,CAA1C,CATmE,CAWnE;AACA;;AACA,0BAAW,MAAM;AAChBH,IAAAA,uBAAuB,CAAE,EAAF,EAAM;AAC5BI,MAAAA,aAAa,EAAEZ,cAAc,CAAE,iBAAF;AADD,KAAN,CAAvB;AAGAE,IAAAA,WAAW,CAACW,OAAZ,CAAuBC,KAAF,IAAa;AACjC,UAAKd,cAAc,CAAEc,KAAK,CAACC,IAAR,CAAnB,EAAoC;AACnCP,QAAAA,uBAAuB,CAAEM,KAAK,CAACE,QAAR,EAAkB;AACxCJ,UAAAA,aAAa,EAAEZ,cAAc,CAAEc,KAAK,CAACC,IAAR;AADW,SAAlB,CAAvB;AAGA;AACD,KAND;AAOA,GAXD,EAWG,CAAEP,uBAAF,EAA2BN,WAA3B,CAXH,EAbmE,CA0BnE;AACA;;AACA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,MAAM,EAAGE,aADV;AAEC,IAAA,QAAQ,EAAGD,QAFZ;AAGC,IAAA,YAAY,EAAGO;AAHhB,IADD,EAMC;AAAK,IAAA,KAAK,EAAG;AAAEO,MAAAA,OAAO,EAAE;AAAX;AAAb,KACC,4BAAC,uBAAD,QACC,4BAAC,sBAAD,OADD,CADD,CAND,CADD;AAcA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n\tBlockTools,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst ALLOWED_BLOCKS = {\n\t'core/navigation': [\n\t\t'core/navigation-link',\n\t\t'core/search',\n\t\t'core/social-links',\n\t\t'core/page-list',\n\t\t'core/spacer',\n\t\t'core/home-link',\n\t\t'core/site-title',\n\t\t'core/site-logo',\n\t\t'core/navigation-submenu',\n\t],\n\t'core/social-links': [ 'core/social-link' ],\n\t'core/navigation-submenu': [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t],\n\t'core/navigation-link': [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t],\n\t'core/page-list': [ 'core/page-list-item' ],\n};\n\nexport default function NavigationMenu( { innerBlocks, onSelect } ) {\n\tconst { clientIdsTree } = useSelect( ( select ) => {\n\t\tconst { __unstableGetClientIdsTree } = select( blockEditorStore );\n\t\treturn {\n\t\t\tclientIdsTree: __unstableGetClientIdsTree(),\n\t\t};\n\t} );\n\tconst { updateBlockListSettings } = useDispatch( blockEditorStore );\n\n\tconst { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );\n\n\t//TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList\n\t//Think through a better way of doing this, possible with adding allowed blocks to block library metadata\n\tuseEffect( () => {\n\t\tupdateBlockListSettings( '', {\n\t\t\tallowedBlocks: ALLOWED_BLOCKS[ 'core/navigation' ],\n\t\t} );\n\t\tinnerBlocks.forEach( ( block ) => {\n\t\t\tif ( ALLOWED_BLOCKS[ block.name ] ) {\n\t\t\t\tupdateBlockListSettings( block.clientId, {\n\t\t\t\t\tallowedBlocks: ALLOWED_BLOCKS[ block.name ],\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}, [ updateBlockListSettings, innerBlocks ] );\n\n\t// The hidden block is needed because it makes block edit side effects trigger.\n\t// For example a navigation page list load its items has an effect on edit to load its items.\n\treturn (\n\t\t<>\n\t\t\t<OffCanvasEditor\n\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tLeafMoreMenu={ LeafMoreMenu }\n\t\t\t/>\n\t\t\t<div style={ { display: 'none' } }>\n\t\t\t\t<BlockTools>\n\t\t\t\t\t<BlockList />\n\t\t\t\t</BlockTools>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -26,7 +26,10 @@ var _store = require("../../store");
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
function SaveButton() {
|
|
29
|
+
function SaveButton(_ref) {
|
|
30
|
+
let {
|
|
31
|
+
showTooltip = true
|
|
32
|
+
} = _ref;
|
|
30
33
|
const {
|
|
31
34
|
isDirty,
|
|
32
35
|
isSaving,
|
|
@@ -74,7 +77,7 @@ function SaveButton() {
|
|
|
74
77
|
& the tooltip is always rendered even when there's no keyboard shortcut.
|
|
75
78
|
*/
|
|
76
79
|
,
|
|
77
|
-
showTooltip:
|
|
80
|
+
showTooltip: showTooltip
|
|
78
81
|
}, label);
|
|
79
82
|
}
|
|
80
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","length","some","record","kind","name","key","setIsSaveViewOpened","disabled","label","undefined","displayShortcut","primary"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,UAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","showTooltip","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","length","some","record","kind","name","key","setIsSaveViewOpened","disabled","label","undefined","displayShortcut","primary"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,UAAT,OAA8C;AAAA,MAAzB;AAAEC,IAAAA,WAAW,GAAG;AAAhB,GAAyB;AAC5D,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAX;AAAqBC,IAAAA;AAArB,MAAwC,qBAAaC,MAAF,IAAc;AACtE,UAAM;AAAEC,MAAAA,mCAAF;AAAuCC,MAAAA;AAAvC,QACLF,MAAM,CAAEG,eAAF,CADP;;AAEA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,UAAM;AAAEI,MAAAA;AAAF,QAAuBL,MAAM,CAAEM,YAAF,CAAnC;AACA,WAAO;AACNT,MAAAA,OAAO,EAAEO,kBAAkB,CAACG,MAAnB,GAA4B,CAD/B;AAENT,MAAAA,QAAQ,EAAEM,kBAAkB,CAACI,IAAnB,CAA2BC,MAAF,IAClCP,oBAAoB,CAAEO,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX,CAFJ;AAKNb,MAAAA,cAAc,EAAEM,gBAAgB;AAL1B,KAAP;AAOA,GAZ6C,EAY3C,EAZ2C,CAA9C;AAaA,QAAM;AAAEQ,IAAAA;AAAF,MAA0B,uBAAaP,YAAb,CAAhC;AAEA,QAAMQ,QAAQ,GAAG,CAAEjB,OAAF,IAAaC,QAA9B;AAEA,QAAMiB,KAAK,GAAG,cAAI,MAAJ,CAAd;AAEA,SACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBD,QAHjB;AAIC,qBAAgBf,cAJjB;AAKC,IAAA,MAAM,EAAGD,QALV;AAMC,IAAA,OAAO,EAAGgB,QAAQ,GAAGE,SAAH,GAAe,MAAMH,mBAAmB,CAAE,IAAF,CAN3D;AAOC,IAAA,KAAK,EAAGE;AACR;AACH;AACA;AACA;AAXE;AAYC,IAAA,QAAQ,EAAGD,QAAQ,GAAGE,SAAH,GAAeC,0BAAgBC,OAAhB,CAAyB,GAAzB;AAClC;AACH;AACA;AACA;AACA;AACA;AAlBE;AAmBC,IAAA,WAAW,EAAGtB;AAnBf,KAqBGmB,KArBH,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function SaveButton( { showTooltip = true } ) {\n\tconst { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\tconst label = __( 'Save' );\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t & the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -7,6 +9,8 @@ exports.default = SavePanel;
|
|
|
7
9
|
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
9
11
|
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _components = require("@wordpress/components");
|
|
11
15
|
|
|
12
16
|
var _editor = require("@wordpress/editor");
|
|
@@ -21,6 +25,10 @@ var _store = require("../../store");
|
|
|
21
25
|
|
|
22
26
|
var _privateApis = require("../../private-apis");
|
|
23
27
|
|
|
28
|
+
/**
|
|
29
|
+
* External dependencies
|
|
30
|
+
*/
|
|
31
|
+
|
|
24
32
|
/**
|
|
25
33
|
* WordPress dependencies
|
|
26
34
|
*/
|
|
@@ -62,7 +70,9 @@ function SavePanel() {
|
|
|
62
70
|
}
|
|
63
71
|
|
|
64
72
|
return (0, _element.createElement)(_interface.NavigableRegion, {
|
|
65
|
-
className:
|
|
73
|
+
className: (0, _classnames.default)('edit-site-layout__actions', {
|
|
74
|
+
'is-entity-save-view-open': isSaveViewOpen
|
|
75
|
+
}),
|
|
66
76
|
ariaLabel: (0, _i18n.__)('Save sidebar')
|
|
67
77
|
}, isSaveViewOpen ? (0, _element.createElement)(_editor.EntitiesSavedStates, {
|
|
68
78
|
close: onClose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened","onClose"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAIe,SAASA,SAAT,GAAqB;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAiC,qBAAaC,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAsC,yBAC3CF,MAAM,CAAEG,YAAF,CADqC,CAA5C,CAD+D,CAK/D;AACA;;AACA,WAAO;AACNL,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,UAAU,EAAEG,aAAa;AAFnB,KAAP;AAIA,GAXsC,EAWpC,EAXoC,CAAvC;AAYA,QAAM;AAAEE,IAAAA;AAAF,MAA0B,uBAAaD,YAAb,CAAhC;;AACA,QAAME,OAAO,GAAG,MAAMD,mBAAmB,CAAE,KAAF,CAAzC;;AAEA,MAAKL,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGO,OAFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAG,cACd,0CADc;AAJhB,OAQC,4BAAC,2BAAD;AAAqB,MAAA,KAAK,EAAGA;AAA7B,MARD,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,4BAAC,0BAAD;AACC,IAAA,SAAS,EAAG,yBAAY,2BAAZ,EAAyC;AACpD,kCAA4BP;AADwB,KAAzC,CADb;AAIC,IAAA,SAAS,EAAG,cAAI,cAAJ;AAJb,KAMGA,cAAc,GACf,4BAAC,2BAAD;AAAqB,IAAA,KAAK,EAAGO;AAA7B,IADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMD,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMG,cAAI,iBAAJ,CANH,CADD,CATF,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport { EntitiesSavedStates } from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<EntitiesSavedStates close={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save sidebar' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<EntitiesSavedStates close={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
|
|
@@ -17,7 +17,7 @@ var _sidebarNavigationScreenTemplates = _interopRequireDefault(require("../sideb
|
|
|
17
17
|
|
|
18
18
|
var _sidebarNavigationScreenTemplate = _interopRequireDefault(require("../sidebar-navigation-screen-template"));
|
|
19
19
|
|
|
20
|
-
var _useSyncPathWithUrl =
|
|
20
|
+
var _useSyncPathWithUrl = _interopRequireWildcard(require("../sync-state-with-url/use-sync-path-with-url"));
|
|
21
21
|
|
|
22
22
|
var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
|
|
23
23
|
|
|
@@ -27,6 +27,12 @@ var _saveButton = _interopRequireDefault(require("../save-button"));
|
|
|
27
27
|
|
|
28
28
|
var _sidebarNavigationScreenNavigationItem = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-item"));
|
|
29
29
|
|
|
30
|
+
var _routes = require("../routes");
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
30
36
|
/**
|
|
31
37
|
* WordPress dependencies
|
|
32
38
|
*/
|
|
@@ -36,28 +42,34 @@ var _sidebarNavigationScreenNavigationItem = _interopRequireDefault(require("../
|
|
|
36
42
|
*/
|
|
37
43
|
function SidebarScreens() {
|
|
38
44
|
(0, _useSyncPathWithUrl.default)();
|
|
39
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}));
|
|
45
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
46
|
+
path: "/"
|
|
47
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenMain.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
48
|
+
path: "/navigation"
|
|
49
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
50
|
+
path: "/navigation/:postType/:postId"
|
|
51
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenNavigationItem.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
52
|
+
path: "/:postType(wp_template|wp_template_part)"
|
|
53
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenTemplates.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
54
|
+
path: "/:postType(wp_template|wp_template_part)/all"
|
|
55
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenTemplatesBrowse.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
56
|
+
path: "/:postType(wp_template|wp_template_part)/:postId"
|
|
57
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenTemplate.default, null)));
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
function Sidebar() {
|
|
61
|
+
const {
|
|
62
|
+
params: urlParams
|
|
63
|
+
} = (0, _routes.useLocation)();
|
|
64
|
+
const initialPath = (0, _element.useRef)((0, _useSyncPathWithUrl.getPathFromURL)(urlParams));
|
|
55
65
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalNavigatorProvider, {
|
|
56
66
|
className: "edit-site-sidebar__content",
|
|
57
|
-
initialPath:
|
|
67
|
+
initialPath: initialPath.current
|
|
58
68
|
}, (0, _element.createElement)(SidebarScreens, null)), (0, _element.createElement)("div", {
|
|
59
69
|
className: "edit-site-sidebar__footer"
|
|
60
|
-
}, (0, _element.createElement)(_saveButton.default,
|
|
70
|
+
}, (0, _element.createElement)(_saveButton.default, {
|
|
71
|
+
showTooltip: false
|
|
72
|
+
})));
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
var _default = (0, _element.memo)(Sidebar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar"],"mappings":";;;;;;;;;AAGA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;;;;;AAtBA;AACA;AACA;;AAOA;AACA;AACA;AAaA,SAASA,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,oCAAD,OADD,CADD,EAIC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAJD,EAOC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,8CAAD,OADD,CAPD,EAUC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,yCAAD,OADD,CAVD,EAaC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAbD,EAgBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,wCAAD,OADD,CAhBD,CADD;AAsBA;;AAED,SAASC,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwB,0BAA9B;AACA,QAAMC,WAAW,GAAG,qBAAQ,wCAAgBD,SAAhB,CAAR,CAApB;AAEA,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,4BAAC,cAAD,OAJD,CADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,mBAAD;AAAY,IAAA,WAAW,EAAG;AAA1B,IADD,CARD,CADD;AAcA;;eAEc,mBAAMJ,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveButton from '../save-button';\nimport SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';\nimport { useLocation } from '../routes';\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationItem />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\n\t\t\t<div className=\"edit-site-sidebar__footer\">\n\t\t\t\t<SaveButton showTooltip={ false } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = SidebarButton;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _components = require("@wordpress/components");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* External dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
function SidebarButton(props) {
|
|
26
|
+
return (0, _element.createElement)(_components.Button, (0, _extends2.default)({}, props, {
|
|
27
|
+
className: (0, _classnames.default)('edit-site-sidebar-button', props.className)
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-button/index.js"],"names":["SidebarButton","props","className"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGe,SAASA,aAAT,CAAwBC,KAAxB,EAAgC;AAC9C,SACC,4BAAC,kBAAD,6BACMA,KADN;AAEC,IAAA,SAAS,EAAG,yBACX,0BADW,EAEXA,KAAK,CAACC,SAFK;AAFb,KADD;AASA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\n\nexport default function SidebarButton( props ) {\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-button',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -47,9 +47,15 @@ function GlobalStylesSidebar() {
|
|
|
47
47
|
icon: _icons.styles,
|
|
48
48
|
closeLabel: (0, _i18n.__)('Close Styles sidebar'),
|
|
49
49
|
panelClassName: "edit-site-global-styles-sidebar__panel",
|
|
50
|
-
header: (0, _element.createElement)(_components.Flex,
|
|
50
|
+
header: (0, _element.createElement)(_components.Flex, {
|
|
51
|
+
className: "edit-site-global-styles-sidebar__header"
|
|
52
|
+
}, (0, _element.createElement)(_components.FlexBlock, {
|
|
53
|
+
style: {
|
|
54
|
+
minWidth: 'min-content'
|
|
55
|
+
}
|
|
56
|
+
}, (0, _element.createElement)("strong", null, (0, _i18n.__)('Styles'))), (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_components.Button, {
|
|
51
57
|
icon: _icons.seen,
|
|
52
|
-
label:
|
|
58
|
+
label: (0, _i18n.__)('Style Book'),
|
|
53
59
|
isPressed: isStyleBookOpened,
|
|
54
60
|
disabled: editorMode !== 'visual',
|
|
55
61
|
onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","isStyleBookOpened","setIsStyleBookOpened","editorMode","select","editSiteStore","getEditorMode","styles","seen"],"mappings":";;;;;;;;;AAQA;;AALA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAQA;AACA;AACA;AAMe,SAASA,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,uBAAU,KAAV,CAApD;AACA,QAAMC,UAAU,GAAG,qBAChBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,aAAxB,EADI,EAElB,EAFkB,CAAnB;AAKA,0BAAW,MAAM;AAChB,QAAKH,UAAU,KAAK,QAApB,EAA+B;AAC9BD,MAAAA,oBAAoB,CAAE,KAAF,CAApB;AACA;AACD,GAJD,EAIG,CAAEC,UAAF,CAJH;AAKA,SACC,4BAAC,uBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAHT;AAIC,IAAA,IAAI,EAAGI,aAJR;AAKC,IAAA,UAAU,EAAG,cAAI,sBAAJ,CALd;AAMC,IAAA,cAAc,EAAC,wCANhB;AAOC,IAAA,MAAM,EACL,4BAAC,gBAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","isStyleBookOpened","setIsStyleBookOpened","editorMode","select","editSiteStore","getEditorMode","styles","minWidth","seen"],"mappings":";;;;;;;;;AAQA;;AALA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAQA;AACA;AACA;AAMe,SAASA,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,uBAAU,KAAV,CAApD;AACA,QAAMC,UAAU,GAAG,qBAChBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,aAAxB,EADI,EAElB,EAFkB,CAAnB;AAKA,0BAAW,MAAM;AAChB,QAAKH,UAAU,KAAK,QAApB,EAA+B;AAC9BD,MAAAA,oBAAoB,CAAE,KAAF,CAApB;AACA;AACD,GAJD,EAIG,CAAEC,UAAF,CAJH;AAKA,SACC,4BAAC,uBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAHT;AAIC,IAAA,IAAI,EAAGI,aAJR;AAKC,IAAA,UAAU,EAAG,cAAI,sBAAJ,CALd;AAMC,IAAA,cAAc,EAAC,wCANhB;AAOC,IAAA,MAAM,EACL,4BAAC,gBAAD;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,4BAAC,qBAAD;AAAW,MAAA,KAAK,EAAG;AAAEC,QAAAA,QAAQ,EAAE;AAAZ;AAAnB,OACC,4CAAU,cAAI,QAAJ,CAAV,CADD,CADD,EAIC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AACC,MAAA,IAAI,EAAGC,WADR;AAEC,MAAA,KAAK,EAAG,cAAI,YAAJ,CAFT;AAGC,MAAA,SAAS,EAAGR,iBAHb;AAIC,MAAA,QAAQ,EAAGE,UAAU,KAAK,QAJ3B;AAKC,MAAA,OAAO,EAAG,MAAM;AACfD,QAAAA,oBAAoB,CAAE,CAAED,iBAAJ,CAApB;AACA;AAPF,MADD,CAJD,EAeC,4BAAC,oBAAD,QACC,4BAAC,wBAAD,OADD,CAfD;AARF,KA6BC,4BAAC,4BAAD;AACC,IAAA,iBAAiB,EAAGA,iBADrB;AAEC,IAAA,gBAAgB,EAAG,MAAMC,oBAAoB,CAAE,KAAF;AAF9C,IA7BD,CADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexItem, FlexBlock, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst editorMode = useSelect(\n\t\t( select ) => select( editSiteStore ).getEditorMode(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( editorMode !== 'visual' ) {\n\t\t\tsetIsStyleBookOpened( false );\n\t\t}\n\t}, [ editorMode ] );\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 Styles sidebar' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex className=\"edit-site-global-styles-sidebar__header\">\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\tdisabled={ editorMode !== 'visual' }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsStyleBookOpened( ! isStyleBookOpened );\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\t<FlexItem>\n\t\t\t\t\t\t<GlobalStylesMenuSlot />\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\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\tonCloseStyleBook={ () => setIsStyleBookOpened( false ) }\n\t\t\t/>\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -19,6 +21,8 @@ var _store = require("../../store");
|
|
|
19
21
|
|
|
20
22
|
var _privateApis = require("../../private-apis");
|
|
21
23
|
|
|
24
|
+
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
25
|
+
|
|
22
26
|
/**
|
|
23
27
|
* WordPress dependencies
|
|
24
28
|
*/
|
|
@@ -28,7 +32,7 @@ var _privateApis = require("../../private-apis");
|
|
|
28
32
|
*/
|
|
29
33
|
function SidebarNavigationScreen(_ref) {
|
|
30
34
|
let {
|
|
31
|
-
|
|
35
|
+
isRoot,
|
|
32
36
|
title,
|
|
33
37
|
actions,
|
|
34
38
|
content
|
|
@@ -43,21 +47,17 @@ function SidebarNavigationScreen(_ref) {
|
|
|
43
47
|
dashboardLink: getSettings().__experimentalDashboardLink
|
|
44
48
|
};
|
|
45
49
|
}, []);
|
|
46
|
-
return (0, _element.createElement)(_components.
|
|
47
|
-
className: "edit-site-sidebar-navigation-screen",
|
|
48
|
-
path: path
|
|
49
|
-
}, (0, _element.createElement)(_components.__experimentalVStack, {
|
|
50
|
+
return (0, _element.createElement)(_components.__experimentalVStack, {
|
|
50
51
|
spacing: 2
|
|
51
52
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
52
53
|
spacing: 4,
|
|
53
54
|
justify: "flex-start",
|
|
54
55
|
className: "edit-site-sidebar-navigation-screen__title-icon"
|
|
55
|
-
},
|
|
56
|
-
|
|
56
|
+
}, !isRoot ? (0, _element.createElement)(_components.__experimentalNavigatorToParentButton, {
|
|
57
|
+
as: _sidebarButton.default,
|
|
57
58
|
icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
|
|
58
59
|
"aria-label": (0, _i18n.__)('Back')
|
|
59
|
-
}) : (0, _element.createElement)(
|
|
60
|
-
className: "edit-site-sidebar-navigation-screen__back",
|
|
60
|
+
}) : (0, _element.createElement)(_sidebarButton.default, {
|
|
61
61
|
icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
|
|
62
62
|
"aria-label": (0, _i18n.__)('Navigate to the Dashboard'),
|
|
63
63
|
href: dashboardLink || 'index.php',
|
|
@@ -66,6 +66,6 @@ function SidebarNavigationScreen(_ref) {
|
|
|
66
66
|
className: "edit-site-sidebar-navigation-screen__title"
|
|
67
67
|
}, title), actions), (0, _element.createElement)("nav", {
|
|
68
68
|
className: "edit-site-sidebar-navigation-screen__content"
|
|
69
|
-
}, content))
|
|
69
|
+
}, content));
|
|
70
70
|
}
|
|
71
71
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","isRoot","title","actions","content","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","SidebarButton","chevronRight","chevronLeft"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKe,SAASA,uBAAT,OAKX;AAAA,MAL6C;AAChDC,IAAAA,MADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,OAHgD;AAIhDC,IAAAA;AAJgD,GAK7C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkB,yBAAQD,MAAM,CAAEE,YAAF,CAAd,CAAxB;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,WAAW,GAAGE;AADvB,KAAP;AAGA,GALyB,EAKvB,EALuB,CAA1B;AAOA,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,OAAO,EAAC,YAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG,CAAER,MAAF,GACD,4BAAC,iDAAD;AACC,IAAA,EAAE,EAAGS,sBADN;AAEC,IAAA,IAAI,EAAG,qBAAUC,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa,cAAI,MAAJ;AAHd,IADC,GAOD,4BAAC,sBAAD;AACC,IAAA,IAAI,EAAG,qBAAUD,mBAAV,GAAyBC,kBADjC;AAEC,kBAAa,cAAI,2BAAJ,CAFd;AAGC,IAAA,IAAI,EAAGP,aAAa,IAAI,WAHzB;AAIC,IAAA,KAAK,EAAG,cAAI,WAAJ;AAJT,IAZF,EAmBC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGH,KADH,CAnBD,EAsBGC,OAtBH,CADD,EA0BC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGC,OADH,CA1BD,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack\n\t\t\t\tspacing={ 4 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t>\n\t\t\t\t{ ! isRoot ? (\n\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\tas={ SidebarButton }\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\taria-label={ __( 'Back' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\taria-label={ __( 'Navigate to the Dashboard' ) }\n\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\tlabel={ __( 'Dashboard' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<h2 className=\"edit-site-sidebar-navigation-screen__title\">\n\t\t\t\t\t{ title }\n\t\t\t\t</h2>\n\t\t\t\t{ actions }\n\t\t\t</HStack>\n\n\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t{ content }\n\t\t\t</nav>\n\t\t</VStack>\n\t);\n}\n"]}
|
|
@@ -45,7 +45,7 @@ function SidebarNavigationScreenMain() {
|
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
47
|
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
48
|
-
|
|
48
|
+
isRoot: true,
|
|
49
49
|
title: (0, _i18n.__)('Design'),
|
|
50
50
|
content: (0, _element.createElement)(_components.__experimentalItemGroup, null, !!navigationMenus && navigationMenus.length > 0 && (0, _element.createElement)(_components.__experimentalNavigatorButton, {
|
|
51
51
|
as: _sidebarNavigationItem.default,
|
|
@@ -54,12 +54,12 @@ function SidebarNavigationScreenMain() {
|
|
|
54
54
|
icon: _icons.navigation
|
|
55
55
|
}, (0, _i18n.__)('Navigation')), (0, _element.createElement)(_components.__experimentalNavigatorButton, {
|
|
56
56
|
as: _sidebarNavigationItem.default,
|
|
57
|
-
path: "/
|
|
57
|
+
path: "/wp_template",
|
|
58
58
|
withChevron: true,
|
|
59
59
|
icon: _icons.layout
|
|
60
60
|
}, (0, _i18n.__)('Templates')), (0, _element.createElement)(_components.__experimentalNavigatorButton, {
|
|
61
61
|
as: _sidebarNavigationItem.default,
|
|
62
|
-
path: "/
|
|
62
|
+
path: "/wp_template_part",
|
|
63
63
|
withChevron: true,
|
|
64
64
|
icon: _icons.symbolFilled
|
|
65
65
|
}, (0, _i18n.__)('Template Parts')))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["SidebarNavigationScreenMain","navigationMenus","select","getEntityRecords","coreStore","per_page","status","length","SidebarNavigationItem","navigation","layout","symbolFilled"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAAsB,qBAAaC,MAAF,IAAc;AACpD,UAAM;AAAEC,MAAAA;AAAF,QAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,WAAO;AACNH,MAAAA,eAAe,EAAEE,gBAAgB,CAAE,UAAF,EAAc,eAAd,EAA+B;AAC/DE,QAAAA,QAAQ,EAAE,CAAC,CADoD;AAE/DC,QAAAA,MAAM,EAAE;AAFuD,OAA/B;AAD3B,KAAP;AAMA,GAR2B,CAA5B;AAUA,SACC,4BAAC,gCAAD;AACC,IAAA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["SidebarNavigationScreenMain","navigationMenus","select","getEntityRecords","coreStore","per_page","status","length","SidebarNavigationItem","navigation","layout","symbolFilled"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAAsB,qBAAaC,MAAF,IAAc;AACpD,UAAM;AAAEC,MAAAA;AAAF,QAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,WAAO;AACNH,MAAAA,eAAe,EAAEE,gBAAgB,CAAE,UAAF,EAAc,eAAd,EAA+B;AAC/DE,QAAAA,QAAQ,EAAE,CAAC,CADoD;AAE/DC,QAAAA,MAAM,EAAE;AAFuD,OAA/B;AAD3B,KAAP;AAMA,GAR2B,CAA5B;AAUA,SACC,4BAAC,gCAAD;AACC,IAAA,MAAM,MADP;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,OAAO,EACN,4BAAC,mCAAD,QACG,CAAC,CAAEL,eAAH,IAAsBA,eAAe,CAACM,MAAhB,GAAyB,CAA/C,IACD,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGC,8BADN;AAEC,MAAA,IAAI,EAAC,aAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGC;AAJR,OAMG,cAAI,YAAJ,CANH,CAFF,EAWC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGD,8BADN;AAEC,MAAA,IAAI,EAAC,cAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGE;AAJR,OAMG,cAAI,WAAJ,CANH,CAXD,EAmBC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGF,8BADN;AAEC,MAAA,IAAI,EAAC,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGG;AAJR,OAMG,cAAI,gBAAJ,CANH,CAnBD;AAJF,IADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalNavigatorButton as NavigatorButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbolFilled, navigation } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { navigationMenus } = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\treturn {\n\t\t\tnavigationMenus: getEntityRecords( 'postType', 'wp_navigation', {\n\t\t\t\tper_page: -1,\n\t\t\t\tstatus: 'publish',\n\t\t\t} ),\n\t\t};\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tcontent={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ !! navigationMenus && navigationMenus.length > 0 && (\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/navigation\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/wp_template\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/wp_template_part\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ symbolFilled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template Parts' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t</ItemGroup>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -19,12 +19,16 @@ var _coreData = require("@wordpress/core-data");
|
|
|
19
19
|
|
|
20
20
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
21
21
|
|
|
22
|
+
var _icons = require("@wordpress/icons");
|
|
23
|
+
|
|
22
24
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
23
25
|
|
|
24
26
|
var _privateApis = require("../../private-apis");
|
|
25
27
|
|
|
26
28
|
var _store = require("../../store");
|
|
27
29
|
|
|
30
|
+
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
31
|
+
|
|
28
32
|
/**
|
|
29
33
|
* WordPress dependencies
|
|
30
34
|
*/
|
|
@@ -38,34 +42,31 @@ function SidebarNavigationScreenNavigationItem() {
|
|
|
38
42
|
const {
|
|
39
43
|
setCanvasMode
|
|
40
44
|
} = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
|
|
45
|
+
const {
|
|
46
|
+
params: {
|
|
47
|
+
postType,
|
|
48
|
+
postId
|
|
49
|
+
}
|
|
50
|
+
} = (0, _components.__experimentalUseNavigator)();
|
|
41
51
|
const {
|
|
42
52
|
post
|
|
43
53
|
} = (0, _data.useSelect)(select => {
|
|
44
|
-
var _getEditedPostContext;
|
|
45
|
-
|
|
46
|
-
const {
|
|
47
|
-
getEditedPostContext
|
|
48
|
-
} = select(_store.store);
|
|
49
54
|
const {
|
|
50
55
|
getEntityRecord
|
|
51
|
-
} = select(_coreData.store);
|
|
52
|
-
const {
|
|
53
|
-
postType,
|
|
54
|
-
postId
|
|
55
|
-
} = (_getEditedPostContext = getEditedPostContext()) !== null && _getEditedPostContext !== void 0 ? _getEditedPostContext : {}; // The currently selected entity to display.
|
|
56
|
+
} = select(_coreData.store); // The currently selected entity to display.
|
|
56
57
|
// Typically template or template part in the site editor.
|
|
57
58
|
|
|
58
59
|
return {
|
|
59
60
|
post: postId && postType ? getEntityRecord('postType', postType, postId) : null
|
|
60
61
|
};
|
|
61
|
-
}, []);
|
|
62
|
+
}, [postType, postId]);
|
|
62
63
|
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
63
|
-
path: "/navigation/single",
|
|
64
64
|
title: post ? (0, _htmlEntities.decodeEntities)(post === null || post === void 0 ? void 0 : (_post$title = post.title) === null || _post$title === void 0 ? void 0 : _post$title.rendered) : null,
|
|
65
|
-
actions: (0, _element.createElement)(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
actions: (0, _element.createElement)(_sidebarButton.default, {
|
|
66
|
+
onClick: () => setCanvasMode('edit'),
|
|
67
|
+
label: (0, _i18n.__)('Edit'),
|
|
68
|
+
icon: _icons.pencil
|
|
69
|
+
}),
|
|
69
70
|
content: post ? (0, _htmlEntities.decodeEntities)(post === null || post === void 0 ? void 0 : (_post$description = post.description) === null || _post$description === void 0 ? void 0 : _post$description.rendered) : null
|
|
70
71
|
});
|
|
71
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["SidebarNavigationScreenNavigationItem","setCanvasMode","editSiteStore","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["SidebarNavigationScreenNavigationItem","setCanvasMode","editSiteStore","params","postType","postId","post","select","getEntityRecord","coreStore","title","rendered","pencil","description"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAQA;AACA;AACA;AAMe,SAASA,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AADH,MAEF,6CAFJ;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAW,qBACdC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAsBD,MAAM,CAAEE,eAAF,CAAlC,CADa,CAGb;AACA;;AACA,WAAO;AACNH,MAAAA,IAAI,EACHD,MAAM,IAAID,QAAV,GACGI,eAAe,CAAE,UAAF,EAAcJ,QAAd,EAAwBC,MAAxB,CADlB,GAEG;AAJE,KAAP;AAMA,GAZe,EAahB,CAAED,QAAF,EAAYC,MAAZ,CAbgB,CAAjB;AAgBA,SACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAGC,IAAI,GAAG,kCAAgBA,IAAhB,aAAgBA,IAAhB,sCAAgBA,IAAI,CAAEI,KAAtB,gDAAgB,YAAaC,QAA7B,CAAH,GAA6C,IAD1D;AAEC,IAAA,OAAO,EACN,4BAAC,sBAAD;AACC,MAAA,OAAO,EAAG,MAAMV,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,MAAA,IAAI,EAAGW;AAHR,MAHF;AASC,IAAA,OAAO,EACNN,IAAI,GAAG,kCAAgBA,IAAhB,aAAgBA,IAAhB,4CAAgBA,IAAI,CAAEO,WAAtB,sDAAgB,kBAAmBF,QAAnC,CAAH,GAAmD;AAVzD,IADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreenNavigationItem() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postType, postId },\n\t} = useNavigator();\n\n\tconst { post } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tpost:\n\t\t\t\t\tpostId && postType\n\t\t\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ post ? decodeEntities( post?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\tpost ? decodeEntities( post?.description?.rendered ) : null\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -28,19 +28,25 @@ function SidebarNavigationScreenNavigationMenus() {
|
|
|
28
28
|
const history = (0, _routes.useHistory)();
|
|
29
29
|
const onSelect = (0, _element.useCallback)(selectedBlock => {
|
|
30
30
|
const {
|
|
31
|
-
attributes
|
|
31
|
+
attributes,
|
|
32
|
+
name
|
|
32
33
|
} = selectedBlock;
|
|
33
34
|
|
|
34
35
|
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
|
35
36
|
history.push({
|
|
36
37
|
postType: attributes.type,
|
|
37
|
-
postId: attributes.id
|
|
38
|
-
|
|
38
|
+
postId: attributes.id
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (name === 'core/page-list-item' && attributes.id && history) {
|
|
43
|
+
history.push({
|
|
44
|
+
postType: 'page',
|
|
45
|
+
postId: attributes.id
|
|
39
46
|
});
|
|
40
47
|
}
|
|
41
48
|
}, [history]);
|
|
42
49
|
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
43
|
-
path: "/navigation",
|
|
44
50
|
title: (0, _i18n.__)('Navigation'),
|
|
45
51
|
content: (0, _element.createElement)("div", {
|
|
46
52
|
className: "edit-site-sidebar-navigation-screen-navigation-menus"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","name","kind","id","type","push","postType","postId"],"mappings":";;;;;;;;;AAIA;;AADA;;AAMA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKe,SAASA,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAG,yBAAhB;AACA,QAAMC,QAAQ,GAAG,0BACdC,aAAF,IAAqB;AACpB,UAAM;AAAEC,MAAAA,UAAF;AAAcC,MAAAA;AAAd,QAAuBF,aAA7B;;AACA,QACCC,UAAU,CAACE,IAAX,KAAoB,WAApB,IACAF,UAAU,CAACG,EADX,IAEAH,UAAU,CAACI,IAFX,IAGAP,OAJD,EAKE;AACDA,MAAAA,OAAO,CAACQ,IAAR,CAAc;AACbC,QAAAA,QAAQ,EAAEN,UAAU,CAACI,IADR;AAEbG,QAAAA,MAAM,EAAEP,UAAU,CAACG;AAFN,OAAd;AAIA;;AACD,QAAKF,IAAI,KAAK,qBAAT,IAAkCD,UAAU,CAACG,EAA7C,IAAmDN,OAAxD,EAAkE;AACjEA,MAAAA,OAAO,CAACQ,IAAR,CAAc;AACbC,QAAAA,QAAQ,EAAE,MADG;AAEbC,QAAAA,MAAM,EAAEP,UAAU,CAACG;AAFN,OAAd;AAIA;AACD,GApBe,EAqBhB,CAAEN,OAAF,CArBgB,CAAjB;AAuBA,SACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,OAAO,EACN;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAqB,MAAA,QAAQ,EAAGC;AAAhC,MADD;AAHF,IADD;AAUA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport NavigationInspector from '../navigation-inspector';\nimport { useHistory } from '../routes';\n\nexport default function SidebarNavigationScreenNavigationMenus() {\n\tconst history = useHistory();\n\tconst onSelect = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes, name } = selectedBlock;\n\t\t\tif (\n\t\t\t\tattributes.kind === 'post-type' &&\n\t\t\t\tattributes.id &&\n\t\t\t\tattributes.type &&\n\t\t\t\thistory\n\t\t\t) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType: attributes.type,\n\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tif ( name === 'core/page-list-item' && attributes.id && history ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType: 'page',\n\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\tcontent={\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus\">\n\t\t\t\t\t<NavigationInspector onSelect={ onSelect } />\n\t\t\t\t</div>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|