@wordpress/edit-site 5.3.2 → 5.3.4
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 +1 -0
- package/build/components/add-new-template/new-template-part.js +8 -5
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +8 -5
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +3 -3
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +3 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/editor/index.js +25 -23
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -2
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +2 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/custom-css.js +2 -2
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +2 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +2 -2
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +2 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +2 -2
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +2 -2
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +2 -2
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +2 -2
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +2 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +5 -5
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +2 -2
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +2 -2
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +2 -2
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +2 -2
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +2 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +2 -2
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +3 -10
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +2 -2
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +6 -3
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/layout/index.js +10 -23
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +1 -1
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/table.js +1 -0
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-inspector/navigation-menu.js +2 -2
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build/components/save-panel/index.js +4 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +17 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +28 -7
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +72 -0
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +70 -0
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +32 -82
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +43 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build/components/site-hub/index.js +14 -49
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +10 -3
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -20
- 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-canvas-mode-with-url.js +3 -3
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +12 -12
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build/components/use-edited-entity-record/index.js +6 -2
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +2 -2
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/{experiments.js → private-apis.js} +3 -3
- package/build/private-apis.js.map +1 -0
- package/build/store/index.js +3 -3
- package/build/store/index.js.map +1 -1
- package/build/utils/get-is-list-page.js +5 -6
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +7 -4
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +7 -4
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +1 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +3 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +25 -24
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -3
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +3 -3
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +3 -3
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +3 -3
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +3 -3
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +3 -3
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -2
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +3 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +2 -2
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +3 -3
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +3 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +3 -3
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +3 -3
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +3 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +5 -5
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +3 -3
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +3 -3
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +3 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +3 -3
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +3 -3
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +3 -3
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +3 -3
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +3 -3
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +3 -3
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -11
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +3 -3
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +6 -3
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/layout/index.js +10 -23
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +1 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/table.js +1 -0
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +3 -3
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build-module/components/save-panel/index.js +3 -2
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +14 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +27 -9
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +55 -0
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +53 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +34 -81
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +14 -46
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +11 -4
- 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 +55 -21
- 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-canvas-mode-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +11 -11
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build-module/components/use-edited-entity-record/index.js +6 -2
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +3 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/{experiments.js → private-apis.js} +2 -2
- package/build-module/private-apis.js.map +1 -0
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +5 -6
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +18 -37
- package/build-style/style.css +18 -37
- package/package.json +20 -20
- package/src/components/add-new-template/new-template-part.js +7 -4
- package/src/components/add-new-template/new-template.js +8 -6
- package/src/components/block-editor/editor-canvas.js +1 -1
- package/src/components/block-editor/index.js +3 -3
- package/src/components/editor/index.js +29 -28
- package/src/components/global-styles/border-panel.js +3 -3
- package/src/components/global-styles/color-palette-panel.js +3 -3
- package/src/components/global-styles/custom-css.js +3 -3
- package/src/components/global-styles/dimensions-panel.js +3 -3
- package/src/components/global-styles/global-styles-provider.js +3 -3
- package/src/components/global-styles/gradients-palette-panel.js +3 -3
- package/src/components/global-styles/header.js +2 -2
- package/src/components/global-styles/hooks.js +3 -3
- package/src/components/global-styles/navigation-button.js +4 -2
- package/src/components/global-styles/palette.js +3 -3
- package/src/components/global-styles/preview.js +3 -3
- package/src/components/global-styles/screen-background-color.js +3 -3
- package/src/components/global-styles/screen-button-color.js +3 -3
- package/src/components/global-styles/screen-colors.js +3 -3
- package/src/components/global-styles/screen-css.js +14 -7
- package/src/components/global-styles/screen-heading-color.js +3 -3
- package/src/components/global-styles/screen-link-color.js +3 -3
- package/src/components/global-styles/screen-root.js +3 -3
- package/src/components/global-styles/screen-style-variations.js +3 -3
- package/src/components/global-styles/screen-text-color.js +3 -3
- package/src/components/global-styles/screen-typography.js +3 -3
- package/src/components/global-styles/shadow-panel.js +3 -3
- package/src/components/global-styles/style.scss +2 -1
- package/src/components/global-styles/typography-panel.js +3 -3
- package/src/components/global-styles/typography-preview.js +3 -3
- package/src/components/global-styles/ui.js +3 -8
- package/src/components/global-styles-renderer/index.js +3 -3
- package/src/components/header-edit-mode/index.js +6 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/src/components/layout/index.js +35 -48
- package/src/components/layout/style.scss +11 -23
- package/src/components/list/actions/rename-menu-item.js +1 -1
- package/src/components/list/table.js +4 -0
- package/src/components/navigation-inspector/navigation-menu.js +3 -3
- package/src/components/save-panel/index.js +4 -1
- package/src/components/sidebar/index.js +10 -2
- package/src/components/sidebar-navigation-screen/index.js +27 -11
- package/src/components/sidebar-navigation-screen/style.scss +4 -6
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +52 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-template/index.js +52 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +49 -83
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/src/components/site-hub/index.js +67 -122
- package/src/components/site-hub/style.scss +1 -11
- package/src/components/style-book/index.js +11 -7
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +48 -14
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/src/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +10 -10
- package/src/components/use-edited-entity-record/index.js +6 -2
- package/src/hooks/push-changes-to-global-styles/index.js +3 -3
- package/src/{experiments.js → private-apis.js} +1 -1
- package/src/store/index.js +1 -1
- package/src/utils/get-is-list-page.js +5 -5
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build/experiments.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build-module/experiments.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-inspector/navigation-menu.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-inspector/navigation-menu.js"],"names":["privateApis","blockEditorPrivateApis","store","blockEditorStore","useEffect","useDispatch","unlock","ALLOWED_BLOCKS","NavigationMenu","innerBlocks","onSelect","updateBlockListSettings","OffCanvasEditor","allowedBlocks","forEach","block","name","clientId"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,sBADhB,EAECC,KAAK,IAAIC,gBAFV,QAGO,yBAHP;AAIA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAMC,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;AAjBF,CAAvB;AAuBA,eAAe,SAASC,cAAT,OAAqD;AAAA,MAA5B;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,GAA4B;AACnE,QAAM;AAAEC,IAAAA;AAAF,MAA8BN,WAAW,CAAEF,gBAAF,CAA/C;AAEA,QAAM;AAAES,IAAAA;AAAF,MAAsBN,MAAM,CAAEL,sBAAF,CAAlC,CAHmE,CAKnE;AACA;;AACAG,EAAAA,SAAS,CAAE,MAAM;AAChBO,IAAAA,uBAAuB,CAAE,EAAF,EAAM;AAC5BE,MAAAA,aAAa,EAAEN,cAAc,CAAE,iBAAF;AADD,KAAN,CAAvB;AAGAE,IAAAA,WAAW,CAACK,OAAZ,CAAuBC,KAAF,IAAa;AACjC,UAAKR,cAAc,CAAEQ,KAAK,CAACC,IAAR,CAAnB,EAAoC;AACnCL,QAAAA,uBAAuB,CAAEI,KAAK,CAACE,QAAR,EAAkB;AACxCJ,UAAAA,aAAa,EAAEN,cAAc,CAAEQ,KAAK,CAACC,IAAR;AADW,SAAlB,CAAvB;AAGA;AACD,KAND;AAOA,GAXQ,EAWN,CAAEL,uBAAF,EAA2BF,WAA3B,CAXM,CAAT;AAaA,SAAO,cAAC,eAAD;AAAiB,IAAA,MAAM,EAAGA,WAA1B;AAAwC,IAAA,QAAQ,EAAGC;AAAnD,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { 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};\n\nexport default function NavigationMenu( { innerBlocks, onSelect } ) {\n\tconst { updateBlockListSettings } = useDispatch( blockEditorStore );\n\n\tconst { OffCanvasEditor } = 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\treturn <OffCanvasEditor blocks={ innerBlocks } onSelect={ onSelect } />;\n}\n"]}
|
|
@@ -13,7 +13,7 @@ import { NavigableRegion } from '@wordpress/interface';
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { store as editSiteStore } from '../../store';
|
|
16
|
-
import { unlock } from '../../
|
|
16
|
+
import { unlock } from '../../private-apis';
|
|
17
17
|
export default function SavePanel() {
|
|
18
18
|
const {
|
|
19
19
|
isSaveViewOpen,
|
|
@@ -40,7 +40,8 @@ export default function SavePanel() {
|
|
|
40
40
|
return isSaveViewOpen ? createElement(Modal, {
|
|
41
41
|
className: "edit-site-save-panel__modal",
|
|
42
42
|
onRequestClose: onClose,
|
|
43
|
-
__experimentalHideHeader: true
|
|
43
|
+
__experimentalHideHeader: true,
|
|
44
|
+
contentLabel: __('Save site, content, and template changes')
|
|
44
45
|
}, createElement(EntitiesSavedStates, {
|
|
45
46
|
close: onClose
|
|
46
47
|
})) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["Button","Modal","EntitiesSavedStates","useDispatch","useSelect","__","NavigableRegion","store","editSiteStore","unlock","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,sBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["Button","Modal","EntitiesSavedStates","useDispatch","useSelect","__","NavigableRegion","store","editSiteStore","unlock","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,sBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,eAAe,SAASC,SAAT,GAAqB;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAiCR,SAAS,CAAIS,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAsCN,MAAM,CACjDI,MAAM,CAAEL,aAAF,CAD2C,CAAlD,CAD+D,CAK/D;AACA;;AACA,WAAO;AACNG,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,UAAU,EAAEG,aAAa;AAFnB,KAAP;AAIA,GAX+C,EAW7C,EAX6C,CAAhD;AAYA,QAAM;AAAEC,IAAAA;AAAF,MAA0Bb,WAAW,CAAEK,aAAF,CAA3C;;AACA,QAAMS,OAAO,GAAG,MAAMD,mBAAmB,CAAE,KAAF,CAAzC;;AAEA,MAAKJ,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,cAAC,KAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGM,OAFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAGZ,EAAE,CAChB,0CADgB;AAJlB,OAQC,cAAC,mBAAD;AAAqB,MAAA,KAAK,EAAGY;AAA7B,MARD,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAC,2BADX;AAEC,IAAA,SAAS,EAAGZ,EAAE,CAAE,cAAF;AAFf,KAIGM,cAAc,GACf,cAAC,mBAAD;AAAqB,IAAA,KAAK,EAAGM;AAA7B,IADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMD,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMGX,EAAE,CAAE,iBAAF,CANL,CADD,CAPF,CADD;AAqBA","sourcesContent":["/**\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=\"edit-site-layout__actions\"\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"]}
|
|
@@ -13,16 +13,27 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
13
13
|
|
|
14
14
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
15
15
|
import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
|
|
16
|
-
import
|
|
16
|
+
import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
|
|
17
|
+
import useSyncPathWithURL from '../sync-state-with-url/use-sync-path-with-url';
|
|
17
18
|
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
19
|
+
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
18
20
|
import SaveButton from '../save-button';
|
|
21
|
+
import SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';
|
|
19
22
|
|
|
20
23
|
function SidebarScreens() {
|
|
21
|
-
|
|
22
|
-
return createElement(Fragment, null, createElement(SidebarNavigationScreenMain, null), createElement(SidebarNavigationScreenNavigationMenus, null), createElement(SidebarNavigationScreenTemplates, {
|
|
24
|
+
useSyncPathWithURL();
|
|
25
|
+
return createElement(Fragment, null, createElement(SidebarNavigationScreenMain, null), createElement(SidebarNavigationScreenNavigationMenus, null), createElement(SidebarNavigationScreenNavigationItem, null), createElement(SidebarNavigationScreenTemplates, {
|
|
23
26
|
postType: "wp_template"
|
|
24
27
|
}), createElement(SidebarNavigationScreenTemplates, {
|
|
25
28
|
postType: "wp_template_part"
|
|
29
|
+
}), createElement(SidebarNavigationScreenTemplate, {
|
|
30
|
+
postType: "wp_template"
|
|
31
|
+
}), createElement(SidebarNavigationScreenTemplate, {
|
|
32
|
+
postType: "wp_template_part"
|
|
33
|
+
}), createElement(SidebarNavigationScreenTemplatesBrowse, {
|
|
34
|
+
postType: "wp_template"
|
|
35
|
+
}), createElement(SidebarNavigationScreenTemplatesBrowse, {
|
|
36
|
+
postType: "wp_template_part"
|
|
26
37
|
}));
|
|
27
38
|
}
|
|
28
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useSelect","__experimentalNavigatorProvider","NavigatorProvider","store","coreStore","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useSelect","__experimentalNavigatorProvider","NavigatorProvider","store","coreStore","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","useSyncPathWithURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenTemplatesBrowse","SaveButton","SidebarNavigationScreenNavigationItem","SidebarScreens","Sidebar","isDirty","select","__experimentalGetDirtyEntityRecords","dirtyEntityRecords","length"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,oBAArB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,+BAA+B,IAAIC,iBAA5C,QAAqE,uBAArE;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,wCAA7C;AACA,OAAOC,+BAAP,MAA4C,uCAA5C;AACA,OAAOC,kBAAP,MAA+B,+CAA/B;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,qCAAP,MAAkD,8CAAlD;;AAEA,SAASC,cAAT,GAA0B;AACzBL,EAAAA,kBAAkB;AAElB,SACC,8BACC,cAAC,2BAAD,OADD,EAEC,cAAC,sCAAD,OAFD,EAGC,cAAC,qCAAD,OAHD,EAIC,cAAC,gCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAJD,EAKC,cAAC,gCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IALD,EAMC,cAAC,+BAAD;AAAiC,IAAA,QAAQ,EAAC;AAA1C,IAND,EAOC,cAAC,+BAAD;AAAiC,IAAA,QAAQ,EAAC;AAA1C,IAPD,EAQC,cAAC,sCAAD;AAAwC,IAAA,QAAQ,EAAC;AAAjD,IARD,EASC,cAAC,sCAAD;AAAwC,IAAA,QAAQ,EAAC;AAAjD,IATD,CADD;AAaA;;AAED,SAASM,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA;AAAF,MAAcf,SAAS,CAAIgB,MAAF,IAAc;AAC5C,UAAM;AAAEC,MAAAA;AAAF,QAA0CD,MAAM,CAAEZ,SAAF,CAAtD;;AACA,UAAMc,kBAAkB,GAAGD,mCAAmC,EAA9D,CAF4C,CAG5C;AACA;;;AACA,WAAO;AACNF,MAAAA,OAAO,EAAEG,kBAAkB,CAACC,MAAnB,GAA4B;AAD/B,KAAP;AAGA,GAR4B,EAQ1B,EAR0B,CAA7B;AAUA,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAC;AAFb,KAIC,cAAC,cAAD,OAJD,CADD,EAOGJ,OAAO,IACR;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,UAAD,OADD,CARF,CADD;AAeA;;AAED,eAAehB,IAAI,CAAEe,OAAF,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\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 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';\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenMain />\n\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t<SidebarNavigationScreenNavigationItem />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template_part\" />\n\t\t\t<SidebarNavigationScreenTemplate postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplate postType=\"wp_template_part\" />\n\t\t\t<SidebarNavigationScreenTemplatesBrowse postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplatesBrowse postType=\"wp_template_part\" />\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { isDirty } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords } = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\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\tisDirty: dirtyEntityRecords.length > 0,\n\t\t};\n\t}, [] );\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=\"/\"\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t{ isDirty && (\n\t\t\t\t<div className=\"edit-site-sidebar__footer\">\n\t\t\t\t\t<SaveButton />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
|
|
@@ -3,17 +3,33 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { __experimentalHStack as HStack, __experimentalVStack as VStack,
|
|
7
|
-
import { isRTL, __
|
|
6
|
+
import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalNavigatorToParentButton as NavigatorToParentButton, Button, __experimentalNavigatorScreen as NavigatorScreen } from '@wordpress/components';
|
|
7
|
+
import { isRTL, __ } from '@wordpress/i18n';
|
|
8
8
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
9
|
+
import { useSelect } from '@wordpress/data';
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { store as editSiteStore } from '../../store';
|
|
15
|
+
import { unlock } from '../../private-apis';
|
|
9
16
|
export default function SidebarNavigationScreen(_ref) {
|
|
10
17
|
let {
|
|
11
18
|
path,
|
|
12
|
-
parentTitle,
|
|
13
19
|
title,
|
|
14
20
|
actions,
|
|
15
21
|
content
|
|
16
22
|
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
dashboardLink
|
|
25
|
+
} = useSelect(select => {
|
|
26
|
+
const {
|
|
27
|
+
getSettings
|
|
28
|
+
} = unlock(select(editSiteStore));
|
|
29
|
+
return {
|
|
30
|
+
dashboardLink: getSettings().__experimentalDashboardLink
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
17
33
|
return createElement(NavigatorScreen, {
|
|
18
34
|
className: "edit-site-sidebar-navigation-screen",
|
|
19
35
|
path: path
|
|
@@ -23,14 +39,16 @@ export default function SidebarNavigationScreen(_ref) {
|
|
|
23
39
|
spacing: 4,
|
|
24
40
|
justify: "flex-start",
|
|
25
41
|
className: "edit-site-sidebar-navigation-screen__title-icon"
|
|
26
|
-
},
|
|
42
|
+
}, path !== '/' ? createElement(NavigatorToParentButton, {
|
|
43
|
+
className: "edit-site-sidebar-navigation-screen__back",
|
|
44
|
+
icon: isRTL() ? chevronRight : chevronLeft,
|
|
45
|
+
"aria-label": __('Back')
|
|
46
|
+
}) : createElement(Button, {
|
|
27
47
|
className: "edit-site-sidebar-navigation-screen__back",
|
|
28
48
|
icon: isRTL() ? chevronRight : chevronLeft,
|
|
29
|
-
"aria-label":
|
|
30
|
-
|
|
31
|
-
__('
|
|
32
|
-
}) : createElement("div", {
|
|
33
|
-
className: "edit-site-sidebar-navigation-screen__icon-placeholder"
|
|
49
|
+
"aria-label": __('Navigate to the Dashboard'),
|
|
50
|
+
href: dashboardLink || 'index.php',
|
|
51
|
+
label: __('Dashboard')
|
|
34
52
|
}), createElement("h2", {
|
|
35
53
|
className: "edit-site-sidebar-navigation-screen__title"
|
|
36
54
|
}, title), actions), createElement("nav", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalNavigatorToParentButton","NavigatorToParentButton","Button","__experimentalNavigatorScreen","NavigatorScreen","isRTL","__","chevronRight","chevronLeft","useSelect","store","editSiteStore","unlock","SidebarNavigationScreen","path","title","actions","content","dashboardLink","select","getSettings","__experimentalDashboardLink"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,qCAAqC,IAAIC,uBAH1C,EAICC,MAJD,EAKCC,6BAA6B,IAAIC,eALlC,QAMO,uBANP;AAOA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kBAA1C;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,eAAe,SAASC,uBAAT,OAKX;AAAA,MAL6C;AAChDC,IAAAA,IADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,OAHgD;AAIhDC,IAAAA;AAJgD,GAK7C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoBT,SAAS,CAAIU,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkBR,MAAM,CAAEO,MAAM,CAAER,aAAF,CAAR,CAA9B;AACA,WAAO;AACNO,MAAAA,aAAa,EAAEE,WAAW,GAAGC;AADvB,KAAP;AAGA,GALkC,EAKhC,EALgC,CAAnC;AAOA,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,IAAI,EAAGP;AAFR,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,OAAO,EAAC,YAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGA,IAAI,KAAK,GAAT,GACD,cAAC,uBAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAGT,KAAK,KAAKE,YAAL,GAAoBC,WAFjC;AAGC,kBAAaF,EAAE,CAAE,MAAF;AAHhB,IADC,GAOD,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAGD,KAAK,KAAKE,YAAL,GAAoBC,WAFjC;AAGC,kBAAaF,EAAE,CAAE,2BAAF,CAHhB;AAIC,IAAA,IAAI,EAAGY,aAAa,IAAI,WAJzB;AAKC,IAAA,KAAK,EAAGZ,EAAE,CAAE,WAAF;AALX,IAZF,EAoBC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGS,KADH,CApBD,EAuBGC,OAvBH,CADD,EA2BC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGC,OADH,CA3BD,CAJD,CADD;AAsCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\tButton,\n\t__experimentalNavigatorScreen as NavigatorScreen,\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';\n\nexport default function SidebarNavigationScreen( {\n\tpath,\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<NavigatorScreen\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen\"\n\t\t\tpath={ path }\n\t\t>\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ path !== '/' ? (\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__back\"\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\taria-label={ __( 'Back' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__back\"\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\taria-label={ __( 'Navigate to the Dashboard' ) }\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t\tlabel={ __( 'Dashboard' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<h2 className=\"edit-site-sidebar-navigation-screen__title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</h2>\n\t\t\t\t\t{ actions }\n\t\t\t\t</HStack>\n\n\t\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ content }\n\t\t\t\t</nav>\n\t\t\t</VStack>\n\t\t</NavigatorScreen>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
|
+
import { Button } from '@wordpress/components';
|
|
9
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
16
|
+
import { unlock } from '../../private-apis';
|
|
17
|
+
import { store as editSiteStore } from '../../store';
|
|
18
|
+
export default function SidebarNavigationScreenNavigationItem() {
|
|
19
|
+
var _post$title, _post$description;
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
setCanvasMode
|
|
23
|
+
} = unlock(useDispatch(editSiteStore));
|
|
24
|
+
const {
|
|
25
|
+
post
|
|
26
|
+
} = useSelect(select => {
|
|
27
|
+
var _getEditedPostContext;
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
getEditedPostContext
|
|
31
|
+
} = select(editSiteStore);
|
|
32
|
+
const {
|
|
33
|
+
getEntityRecord
|
|
34
|
+
} = select(coreStore);
|
|
35
|
+
const {
|
|
36
|
+
postType,
|
|
37
|
+
postId
|
|
38
|
+
} = (_getEditedPostContext = getEditedPostContext()) !== null && _getEditedPostContext !== void 0 ? _getEditedPostContext : {}; // The currently selected entity to display.
|
|
39
|
+
// Typically template or template part in the site editor.
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
post: postId && postType ? getEntityRecord('postType', postType, postId) : null
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
return createElement(SidebarNavigationScreen, {
|
|
46
|
+
path: "/navigation/single",
|
|
47
|
+
title: post ? decodeEntities(post === null || post === void 0 ? void 0 : (_post$title = post.title) === null || _post$title === void 0 ? void 0 : _post$title.rendered) : null,
|
|
48
|
+
actions: createElement(Button, {
|
|
49
|
+
variant: "primary",
|
|
50
|
+
onClick: () => setCanvasMode('edit')
|
|
51
|
+
}, __('Edit')),
|
|
52
|
+
content: post ? decodeEntities(post === null || post === void 0 ? void 0 : (_post$description = post.description) === null || _post$description === void 0 ? void 0 : _post$description.rendered) : null
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["__","useDispatch","useSelect","Button","store","coreStore","decodeEntities","SidebarNavigationScreen","unlock","editSiteStore","SidebarNavigationScreenNavigationItem","setCanvasMode","post","select","getEditedPostContext","getEntityRecord","postType","postId","title","rendered","description"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoBH,MAAM,CAAEP,WAAW,CAAEQ,aAAF,CAAb,CAAhC;AAEA,QAAM;AAAEG,IAAAA;AAAF,MAAWV,SAAS,CAAIW,MAAF,IAAc;AAAA;;AACzC,UAAM;AAAEC,MAAAA;AAAF,QAA2BD,MAAM,CAAEJ,aAAF,CAAvC;AACA,UAAM;AAAEM,MAAAA;AAAF,QAAsBF,MAAM,CAAER,SAAF,CAAlC;AACA,UAAM;AAAEW,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,iCAAuBH,oBAAoB,EAA3C,yEAAiD,EAAvD,CAHyC,CAKzC;AACA;;AACA,WAAO;AACNF,MAAAA,IAAI,EACHK,MAAM,IAAID,QAAV,GACGD,eAAe,CAAE,UAAF,EAAcC,QAAd,EAAwBC,MAAxB,CADlB,GAEG;AAJE,KAAP;AAMA,GAbyB,EAavB,EAbuB,CAA1B;AAeA,SACC,cAAC,uBAAD;AACC,IAAA,IAAI,EAAC,oBADN;AAEC,IAAA,KAAK,EAAGL,IAAI,GAAGN,cAAc,CAAEM,IAAF,aAAEA,IAAF,sCAAEA,IAAI,CAAEM,KAAR,gDAAE,YAAaC,QAAf,CAAjB,GAA6C,IAF1D;AAGC,IAAA,OAAO,EACN,cAAC,MAAD;AACC,MAAA,OAAO,EAAC,SADT;AAEC,MAAA,OAAO,EAAG,MAAMR,aAAa,CAAE,MAAF;AAF9B,OAIGX,EAAE,CAAE,MAAF,CAJL,CAJF;AAWC,IAAA,OAAO,EACNY,IAAI,GAAGN,cAAc,CAAEM,IAAF,aAAEA,IAAF,4CAAEA,IAAI,CAAEQ,WAAR,sDAAE,kBAAmBD,QAArB,CAAjB,GAAmD;AAZzD,IADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nexport default function SidebarNavigationScreenNavigationItem() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst { post } = useSelect( ( select ) => {\n\t\tconst { getEditedPostContext } = select( editSiteStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst { postType, postId } = getEditedPostContext() ?? {};\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\tpost:\n\t\t\t\tpostId && postType\n\t\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath=\"/navigation/single\"\n\t\t\ttitle={ post ? decodeEntities( post?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t</Button>\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"]}
|
|
@@ -22,13 +22,13 @@ export default function SidebarNavigationScreenNavigationMenus() {
|
|
|
22
22
|
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
|
23
23
|
history.push({
|
|
24
24
|
postType: attributes.type,
|
|
25
|
-
postId: attributes.id
|
|
25
|
+
postId: attributes.id,
|
|
26
|
+
path: '/navigation/single'
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
}, [history]);
|
|
29
30
|
return createElement(SidebarNavigationScreen, {
|
|
30
31
|
path: "/navigation",
|
|
31
|
-
parentTitle: __('Design'),
|
|
32
32
|
title: __('Navigation'),
|
|
33
33
|
content: createElement("div", {
|
|
34
34
|
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":["__","useCallback","SidebarNavigationScreen","NavigationInspector","useHistory","SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,oBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,UAAT,QAA2B,WAA3B;AAEA,eAAe,SAASC,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,QAAMG,QAAQ,GAAGN,WAAW,CACzBO,aAAF,IAAqB;AACpB,UAAM;AAAEC,MAAAA;AAAF,QAAiBD,aAAvB;;AACA,QACCC,UAAU,CAACC,IAAX,KAAoB,WAApB,IACAD,UAAU,CAACE,EADX,IAEAF,UAAU,CAACG,IAFX,IAGAN,OAJD,EAKE;AACDA,MAAAA,OAAO,CAACO,IAAR,CAAc;AACbC,QAAAA,QAAQ,EAAEL,UAAU,CAACG,IADR;AAEbG,QAAAA,MAAM,EAAEN,UAAU,CAACE;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["__","useCallback","SidebarNavigationScreen","NavigationInspector","useHistory","SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId","path"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,oBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,UAAT,QAA2B,WAA3B;AAEA,eAAe,SAASC,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,QAAMG,QAAQ,GAAGN,WAAW,CACzBO,aAAF,IAAqB;AACpB,UAAM;AAAEC,MAAAA;AAAF,QAAiBD,aAAvB;;AACA,QACCC,UAAU,CAACC,IAAX,KAAoB,WAApB,IACAD,UAAU,CAACE,EADX,IAEAF,UAAU,CAACG,IAFX,IAGAN,OAJD,EAKE;AACDA,MAAAA,OAAO,CAACO,IAAR,CAAc;AACbC,QAAAA,QAAQ,EAAEL,UAAU,CAACG,IADR;AAEbG,QAAAA,MAAM,EAAEN,UAAU,CAACE,EAFN;AAGbK,QAAAA,IAAI,EAAE;AAHO,OAAd;AAKA;AACD,GAf0B,EAgB3B,CAAEV,OAAF,CAhB2B,CAA5B;AAkBA,SACC,cAAC,uBAAD;AACC,IAAA,IAAI,EAAC,aADN;AAEC,IAAA,KAAK,EAAGN,EAAE,CAAE,YAAF,CAFX;AAGC,IAAA,OAAO,EACN;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,cAAC,mBAAD;AAAqB,MAAA,QAAQ,EAAGO;AAAhC,MADD;AAJF,IADD;AAWA","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 } = 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\tpath: '/navigation/single',\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\tpath=\"/navigation\"\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"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { Button } from '@wordpress/components';
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
14
|
+
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
15
|
+
import { unlock } from '../../private-apis';
|
|
16
|
+
import { store as editSiteStore } from '../../store';
|
|
17
|
+
const config = {
|
|
18
|
+
wp_template: {
|
|
19
|
+
path: '/templates/single'
|
|
20
|
+
},
|
|
21
|
+
wp_template_part: {
|
|
22
|
+
path: '/template-parts/single'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export default function SidebarNavigationScreenTemplate(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
postType = 'wp_template'
|
|
28
|
+
} = _ref;
|
|
29
|
+
const {
|
|
30
|
+
setCanvasMode
|
|
31
|
+
} = unlock(useDispatch(editSiteStore));
|
|
32
|
+
const {
|
|
33
|
+
getDescription,
|
|
34
|
+
getTitle,
|
|
35
|
+
record
|
|
36
|
+
} = useEditedEntityRecord();
|
|
37
|
+
let description = getDescription();
|
|
38
|
+
|
|
39
|
+
if (!description && record.is_custom) {
|
|
40
|
+
description = __('This is a custom template that can be applied manually to any Post or Page.');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return createElement(SidebarNavigationScreen, {
|
|
44
|
+
path: config[postType].path,
|
|
45
|
+
title: getTitle(),
|
|
46
|
+
actions: createElement(Button, {
|
|
47
|
+
variant: "primary",
|
|
48
|
+
onClick: () => setCanvasMode('edit')
|
|
49
|
+
}, __('Edit')),
|
|
50
|
+
content: description ? createElement("p", null, description) : undefined
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/index.js"],"names":["__","useDispatch","Button","SidebarNavigationScreen","useEditedEntityRecord","unlock","store","editSiteStore","config","wp_template","path","wp_template_part","SidebarNavigationScreenTemplate","postType","setCanvasMode","getDescription","getTitle","record","description","is_custom","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,MAAMC,MAAM,GAAG;AACdC,EAAAA,WAAW,EAAE;AACZC,IAAAA,IAAI,EAAE;AADM,GADC;AAIdC,EAAAA,gBAAgB,EAAE;AACjBD,IAAAA,IAAI,EAAE;AADW;AAJJ,CAAf;AASA,eAAe,SAASE,+BAAT,OAEX;AAAA,MAFqD;AACxDC,IAAAA,QAAQ,GAAG;AAD6C,GAErD;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoBT,MAAM,CAAEJ,WAAW,CAAEM,aAAF,CAAb,CAAhC;AACA,QAAM;AAAEQ,IAAAA,cAAF;AAAkBC,IAAAA,QAAlB;AAA4BC,IAAAA;AAA5B,MAAuCb,qBAAqB,EAAlE;AACA,MAAIc,WAAW,GAAGH,cAAc,EAAhC;;AACA,MAAK,CAAEG,WAAF,IAAiBD,MAAM,CAACE,SAA7B,EAAyC;AACxCD,IAAAA,WAAW,GAAGlB,EAAE,CACf,6EADe,CAAhB;AAGA;;AAED,SACC,cAAC,uBAAD;AACC,IAAA,IAAI,EAAGQ,MAAM,CAAEK,QAAF,CAAN,CAAmBH,IAD3B;AAEC,IAAA,KAAK,EAAGM,QAAQ,EAFjB;AAGC,IAAA,OAAO,EACN,cAAC,MAAD;AACC,MAAA,OAAO,EAAC,SADT;AAEC,MAAA,OAAO,EAAG,MAAMF,aAAa,CAAE,MAAF;AAF9B,OAIGd,EAAE,CAAE,MAAF,CAJL,CAJF;AAWC,IAAA,OAAO,EAAGkB,WAAW,GAAG,yBAAKA,WAAL,CAAH,GAA4BE;AAXlD,IADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nconst config = {\n\twp_template: {\n\t\tpath: '/templates/single',\n\t},\n\twp_template_part: {\n\t\tpath: '/template-parts/single',\n\t},\n};\n\nexport default function SidebarNavigationScreenTemplate( {\n\tpostType = 'wp_template',\n} ) {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord();\n\tlet description = getDescription();\n\tif ( ! description && record.is_custom ) {\n\t\tdescription = __(\n\t\t\t'This is a custom template that can be applied manually to any Post or Page.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath={ config[ postType ].path }\n\t\t\ttitle={ getTitle() }\n\t\t\tactions={\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t\tcontent={ description ? <p>{ description }</p> : undefined }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -4,9 +4,8 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
4
4
|
/**
|
|
5
5
|
* WordPress dependencies
|
|
6
6
|
*/
|
|
7
|
-
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
7
|
+
import { __experimentalItemGroup as ItemGroup, __experimentalItem as Item } from '@wordpress/components';
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { useSelect } from '@wordpress/data';
|
|
10
9
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
11
10
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
12
11
|
import { useViewportMatch } from '@wordpress/compose';
|
|
@@ -17,28 +16,7 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
17
16
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
18
17
|
import { useLink } from '../routes/link';
|
|
19
18
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
20
|
-
import { useLocation } from '../routes';
|
|
21
|
-
import { store as editSiteStore } from '../../store';
|
|
22
19
|
import AddNewTemplate from '../add-new-template';
|
|
23
|
-
|
|
24
|
-
function omit(object, keys) {
|
|
25
|
-
return Object.fromEntries(Object.entries(object).filter(_ref => {
|
|
26
|
-
let [key] = _ref;
|
|
27
|
-
return !keys.includes(key);
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const Item = _ref2 => {
|
|
32
|
-
let {
|
|
33
|
-
item
|
|
34
|
-
} = _ref2;
|
|
35
|
-
const linkInfo = useLink(item.params);
|
|
36
|
-
const props = item.params ? { ...omit(item, 'params'),
|
|
37
|
-
...linkInfo
|
|
38
|
-
} : item;
|
|
39
|
-
return createElement(SidebarNavigationItem, props);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
20
|
const config = {
|
|
43
21
|
wp_template: {
|
|
44
22
|
path: '/templates',
|
|
@@ -59,65 +37,39 @@ const config = {
|
|
|
59
37
|
}
|
|
60
38
|
}
|
|
61
39
|
};
|
|
62
|
-
|
|
40
|
+
|
|
41
|
+
const TemplateItem = _ref => {
|
|
63
42
|
let {
|
|
64
|
-
postType
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
43
|
+
postType,
|
|
44
|
+
postId,
|
|
45
|
+
...props
|
|
46
|
+
} = _ref;
|
|
47
|
+
const linkInfo = useLink({
|
|
48
|
+
postType,
|
|
49
|
+
postId,
|
|
50
|
+
path: config[postType].path + '/single'
|
|
51
|
+
});
|
|
52
|
+
return createElement(SidebarNavigationItem, _extends({}, linkInfo, props));
|
|
53
|
+
};
|
|
72
54
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
} =
|
|
77
|
-
|
|
78
|
-
getEditedPostType,
|
|
79
|
-
getEditedPostId
|
|
80
|
-
} = select(editSiteStore);
|
|
81
|
-
return {
|
|
82
|
-
editedPostId: getEditedPostId(),
|
|
83
|
-
editedPostType: getEditedPostType()
|
|
84
|
-
};
|
|
85
|
-
}, []);
|
|
55
|
+
export default function SidebarNavigationScreenTemplates(_ref2) {
|
|
56
|
+
let {
|
|
57
|
+
postType = 'wp_template'
|
|
58
|
+
} = _ref2;
|
|
59
|
+
const isMobileViewport = useViewportMatch('medium', '<');
|
|
86
60
|
const {
|
|
87
61
|
records: templates,
|
|
88
62
|
isResolving: isLoading
|
|
89
63
|
} = useEntityRecords('postType', postType, {
|
|
90
64
|
per_page: -1
|
|
91
65
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}];
|
|
98
|
-
} else if (!templates && !isLoading) {
|
|
99
|
-
items = [{
|
|
100
|
-
children: config[postType].labels.notFound
|
|
101
|
-
}];
|
|
102
|
-
} else {
|
|
103
|
-
items = templates === null || templates === void 0 ? void 0 : templates.map(template => {
|
|
104
|
-
var _template$title;
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
params: {
|
|
108
|
-
postType,
|
|
109
|
-
postId: template.id
|
|
110
|
-
},
|
|
111
|
-
children: decodeEntities(((_template$title = template.title) === null || _template$title === void 0 ? void 0 : _template$title.rendered) || template.slug),
|
|
112
|
-
'aria-current': params.postType === postType && params.postId === template.id || // This is a special case for the home page.
|
|
113
|
-
editedPostId === template.id && editedPostType === postType && !!params.postId ? 'page' : undefined
|
|
114
|
-
};
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
66
|
+
const browseAllLink = useLink({
|
|
67
|
+
postType,
|
|
68
|
+
postId: undefined,
|
|
69
|
+
path: config[postType].path + '/all'
|
|
70
|
+
});
|
|
118
71
|
return createElement(SidebarNavigationScreen, {
|
|
119
72
|
path: config[postType].path,
|
|
120
|
-
parentTitle: __('Design'),
|
|
121
73
|
title: config[postType].labels.title,
|
|
122
74
|
actions: !isMobileViewport && createElement(AddNewTemplate, {
|
|
123
75
|
templateType: postType,
|
|
@@ -125,16 +77,17 @@ export default function SidebarNavigationScreenTemplates(_ref3) {
|
|
|
125
77
|
className: 'edit-site-sidebar-navigation-screen-templates__add-button'
|
|
126
78
|
}
|
|
127
79
|
}),
|
|
128
|
-
content: createElement(Fragment, null, createElement(ItemGroup, null,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
80
|
+
content: createElement(Fragment, null, isLoading && config[postType].labels.loading, !isLoading && createElement(ItemGroup, null, !(templates !== null && templates !== void 0 && templates.length) && createElement(Item, null, config[postType].labels.notFound), (templates !== null && templates !== void 0 ? templates : []).map(template => {
|
|
81
|
+
var _template$title;
|
|
82
|
+
|
|
83
|
+
return createElement(TemplateItem, {
|
|
84
|
+
postType: postType,
|
|
85
|
+
postId: template.id,
|
|
86
|
+
key: template.id
|
|
87
|
+
}, decodeEntities(((_template$title = template.title) === null || _template$title === void 0 ? void 0 : _template$title.rendered) || template.slug));
|
|
88
|
+
}), !isMobileViewport && createElement(SidebarNavigationItem, _extends({
|
|
132
89
|
className: "edit-site-sidebar-navigation-screen-templates__see-all"
|
|
133
|
-
},
|
|
134
|
-
postType,
|
|
135
|
-
postId: undefined
|
|
136
|
-
}), {
|
|
137
|
-
"aria-current": params.postType === postType && !params.postId ? 'page' : undefined,
|
|
90
|
+
}, browseAllLink, {
|
|
138
91
|
children: config[postType].labels.manage
|
|
139
92
|
}))))
|
|
140
93
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates/index.js"],"names":["__experimentalItemGroup","ItemGroup","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates/index.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__","useEntityRecords","decodeEntities","useViewportMatch","SidebarNavigationScreen","useLink","SidebarNavigationItem","AddNewTemplate","config","wp_template","path","labels","title","loading","notFound","manage","wp_template_part","TemplateItem","postType","postId","props","linkInfo","SidebarNavigationScreenTemplates","isMobileViewport","records","templates","isResolving","isLoading","per_page","browseAllLink","undefined","className","length","map","template","id","rendered","slug"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,kBAAkB,IAAIC,IAFvB,QAGO,uBAHP;AAIA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,gBAAT,QAAiC,sBAAjC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,SAASC,OAAT,QAAwB,gBAAxB;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AAEA,MAAMC,MAAM,GAAG;AACdC,EAAAA,WAAW,EAAE;AACZC,IAAAA,IAAI,EAAE,YADM;AAEZC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAEZ,EAAE,CAAE,WAAF,CADF;AAEPa,MAAAA,OAAO,EAAEb,EAAE,CAAE,mBAAF,CAFJ;AAGPc,MAAAA,QAAQ,EAAEd,EAAE,CAAE,oBAAF,CAHL;AAIPe,MAAAA,MAAM,EAAEf,EAAE,CAAE,sBAAF;AAJH;AAFI,GADC;AAUdgB,EAAAA,gBAAgB,EAAE;AACjBN,IAAAA,IAAI,EAAE,iBADW;AAEjBC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAEZ,EAAE,CAAE,gBAAF,CADF;AAEPa,MAAAA,OAAO,EAAEb,EAAE,CAAE,wBAAF,CAFJ;AAGPc,MAAAA,QAAQ,EAAEd,EAAE,CAAE,yBAAF,CAHL;AAIPe,MAAAA,MAAM,EAAEf,EAAE,CAAE,2BAAF;AAJH;AAFS;AAVJ,CAAf;;AAqBA,MAAMiB,YAAY,GAAG,QAAsC;AAAA,MAApC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,MAAZ;AAAoB,OAAGC;AAAvB,GAAoC;AAC1D,QAAMC,QAAQ,GAAGhB,OAAO,CAAE;AACzBa,IAAAA,QADyB;AAEzBC,IAAAA,MAFyB;AAGzBT,IAAAA,IAAI,EAAEF,MAAM,CAAEU,QAAF,CAAN,CAAmBR,IAAnB,GAA0B;AAHP,GAAF,CAAxB;AAKA,SAAO,cAAC,qBAAD,eAA4BW,QAA5B,EAA4CD,KAA5C,EAAP;AACA,CAPD;;AASA,eAAe,SAASE,gCAAT,QAEX;AAAA,MAFsD;AACzDJ,IAAAA,QAAQ,GAAG;AAD8C,GAEtD;AACH,QAAMK,gBAAgB,GAAGpB,gBAAgB,CAAE,QAAF,EAAY,GAAZ,CAAzC;AAEA,QAAM;AAAEqB,IAAAA,OAAO,EAAEC,SAAX;AAAsBC,IAAAA,WAAW,EAAEC;AAAnC,MAAiD1B,gBAAgB,CACtE,UADsE,EAEtEiB,QAFsE,EAGtE;AACCU,IAAAA,QAAQ,EAAE,CAAC;AADZ,GAHsE,CAAvE;AAQA,QAAMC,aAAa,GAAGxB,OAAO,CAAE;AAC9Ba,IAAAA,QAD8B;AAE9BC,IAAAA,MAAM,EAAEW,SAFsB;AAG9BpB,IAAAA,IAAI,EAAEF,MAAM,CAAEU,QAAF,CAAN,CAAmBR,IAAnB,GAA0B;AAHF,GAAF,CAA7B;AAMA,SACC,cAAC,uBAAD;AACC,IAAA,IAAI,EAAGF,MAAM,CAAEU,QAAF,CAAN,CAAmBR,IAD3B;AAEC,IAAA,KAAK,EAAGF,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BC,KAFnC;AAGC,IAAA,OAAO,EACN,CAAEW,gBAAF,IACC,cAAC,cAAD;AACC,MAAA,YAAY,EAAGL,QADhB;AAEC,MAAA,WAAW,EAAG;AACba,QAAAA,SAAS,EACR;AAFY;AAFf,MALH;AAcC,IAAA,OAAO,EACN,8BACGJ,SAAS,IAAInB,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BE,OAD1C,EAEG,CAAEc,SAAF,IACD,cAAC,SAAD,QACG,EAAEF,SAAF,aAAEA,SAAF,eAAEA,SAAS,CAAEO,MAAb,KACD,cAAC,IAAD,QACGxB,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BG,QAD7B,CAFF,EAMG,CAAEW,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAe,EAAf,EAAoBQ,GAApB,CAA2BC,QAAF;AAAA;;AAAA,aAC1B,cAAC,YAAD;AACC,QAAA,QAAQ,EAAGhB,QADZ;AAEC,QAAA,MAAM,EAAGgB,QAAQ,CAACC,EAFnB;AAGC,QAAA,GAAG,EAAGD,QAAQ,CAACC;AAHhB,SAKGjC,cAAc,CACf,oBAAAgC,QAAQ,CAACtB,KAAT,oEAAgBwB,QAAhB,KACCF,QAAQ,CAACG,IAFK,CALjB,CAD0B;AAAA,KAAzB,CANH,EAkBG,CAAEd,gBAAF,IACD,cAAC,qBAAD;AACC,MAAA,SAAS,EAAC;AADX,OAEMM,aAFN;AAGC,MAAA,QAAQ,EACPrB,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BI;AAJ5B,OAnBF,CAHF;AAfF,IADD;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport AddNewTemplate from '../add-new-template';\n\nconst config = {\n\twp_template: {\n\t\tpath: '/templates',\n\t\tlabels: {\n\t\t\ttitle: __( 'Templates' ),\n\t\t\tloading: __( 'Loading templates' ),\n\t\t\tnotFound: __( 'No templates found' ),\n\t\t\tmanage: __( 'Manage all templates' ),\n\t\t},\n\t},\n\twp_template_part: {\n\t\tpath: '/template-parts',\n\t\tlabels: {\n\t\t\ttitle: __( 'Template parts' ),\n\t\t\tloading: __( 'Loading template parts' ),\n\t\t\tnotFound: __( 'No template parts found' ),\n\t\t\tmanage: __( 'Manage all template parts' ),\n\t\t},\n\t},\n};\n\nconst TemplateItem = ( { postType, postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostType,\n\t\tpostId,\n\t\tpath: config[ postType ].path + '/single',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n\nexport default function SidebarNavigationScreenTemplates( {\n\tpostType = 'wp_template',\n} ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tconst { records: templates, isResolving: isLoading } = useEntityRecords(\n\t\t'postType',\n\t\tpostType,\n\t\t{\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\n\tconst browseAllLink = useLink( {\n\t\tpostType,\n\t\tpostId: undefined,\n\t\tpath: config[ postType ].path + '/all',\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath={ config[ postType ].path }\n\t\t\ttitle={ config[ postType ].labels.title }\n\t\t\tactions={\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<AddNewTemplate\n\t\t\t\t\t\ttemplateType={ postType }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t'edit-site-sidebar-navigation-screen-templates__add-button',\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && config[ postType ].labels.loading }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t{ ! templates?.length && (\n\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t{ config[ postType ].labels.notFound }\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ( templates ?? [] ).map( ( template ) => (\n\t\t\t\t\t\t\t\t<TemplateItem\n\t\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\t\tpostId={ template.id }\n\t\t\t\t\t\t\t\t\tkey={ template.id }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\ttemplate.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\ttemplate.slug\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</TemplateItem>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-templates__see-all\"\n\t\t\t\t\t\t\t\t\t{ ...browseAllLink }\n\t\t\t\t\t\t\t\t\tchildren={\n\t\t\t\t\t\t\t\t\t\tconfig[ postType ].labels.manage\n\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</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
12
|
+
const config = {
|
|
13
|
+
wp_template: {
|
|
14
|
+
path: '/templates/all',
|
|
15
|
+
title: __('All templates')
|
|
16
|
+
},
|
|
17
|
+
wp_template_part: {
|
|
18
|
+
path: '/template-parts/all',
|
|
19
|
+
title: __('All template parts')
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default function SidebarNavigationScreenTemplatesBrowse(_ref) {
|
|
23
|
+
let {
|
|
24
|
+
postType = 'wp_template'
|
|
25
|
+
} = _ref;
|
|
26
|
+
return createElement(SidebarNavigationScreen, {
|
|
27
|
+
path: config[postType].path,
|
|
28
|
+
title: config[postType].title
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/index.js"],"names":["__","SidebarNavigationScreen","config","wp_template","path","title","wp_template_part","SidebarNavigationScreenTemplatesBrowse","postType"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AAEA,MAAMC,MAAM,GAAG;AACdC,EAAAA,WAAW,EAAE;AACZC,IAAAA,IAAI,EAAE,gBADM;AAEZC,IAAAA,KAAK,EAAEL,EAAE,CAAE,eAAF;AAFG,GADC;AAKdM,EAAAA,gBAAgB,EAAE;AACjBF,IAAAA,IAAI,EAAE,qBADW;AAEjBC,IAAAA,KAAK,EAAEL,EAAE,CAAE,oBAAF;AAFQ;AALJ,CAAf;AAWA,eAAe,SAASO,sCAAT,OAEX;AAAA,MAF4D;AAC/DC,IAAAA,QAAQ,GAAG;AADoD,GAE5D;AACH,SACC,cAAC,uBAAD;AACC,IAAA,IAAI,EAAGN,MAAM,CAAEM,QAAF,CAAN,CAAmBJ,IAD3B;AAEC,IAAA,KAAK,EAAGF,MAAM,CAAEM,QAAF,CAAN,CAAmBH;AAF5B,IADD;AAMA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\n\nconst config = {\n\twp_template: {\n\t\tpath: '/templates/all',\n\t\ttitle: __( 'All templates' ),\n\t},\n\twp_template_part: {\n\t\tpath: '/template-parts/all',\n\t\ttitle: __( 'All template parts' ),\n\t},\n};\n\nexport default function SidebarNavigationScreenTemplatesBrowse( {\n\tpostType = 'wp_template',\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath={ config[ postType ].path }\n\t\t\ttitle={ config[ postType ].title }\n\t\t/>\n\t);\n}\n"]}
|