@wordpress/edit-site 5.3.2 → 5.4.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 +3 -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 +9 -25
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +4 -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 +28 -24
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +6 -6
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +7 -4
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/color-utils.js +1 -1
- package/build/components/global-styles/color-utils.js.map +1 -1
- package/build/components/global-styles/context-menu.js +16 -3
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +3 -3
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +10 -9
- 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 +10 -5
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +4 -2
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +16 -53
- 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 +5 -3
- 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 +5 -4
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +14 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +9 -7
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +10 -8
- 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 +10 -8
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +5 -4
- 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 +5 -4
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +4 -5
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/subtitle.js +3 -2
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +24 -301
- 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/index.js +0 -29
- package/build/components/navigation-inspector/index.js.map +1 -1
- package/build/components/navigation-inspector/navigation-menu.js +6 -4
- 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 +18 -23
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -1
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-card/index.js +9 -2
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js +84 -0
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
- 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/start-template-options/index.js +175 -0
- package/build/components/start-template-options/index.js.map +1 -0
- 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 +7 -6
- 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 +8 -22
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +2 -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 +27 -25
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +8 -8
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +8 -5
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/color-utils.js +2 -2
- package/build-module/components/global-styles/color-utils.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +13 -2
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +4 -4
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +12 -11
- 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 +11 -6
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +5 -3
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +15 -52
- 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 +6 -4
- 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 +7 -6
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +12 -3
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +11 -9
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +12 -10
- 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 +12 -10
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -6
- 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 +7 -6
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -4
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +6 -7
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +3 -2
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +29 -302
- 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/index.js +0 -27
- package/build-module/components/navigation-inspector/index.js.map +1 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +7 -5
- 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 +15 -21
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-card/index.js +9 -4
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js +70 -0
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
- 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/start-template-options/index.js +156 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- 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 +9 -8
- 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 +91 -41
- package/build-style/style.css +91 -41
- package/package.json +31 -31
- package/src/components/add-new-template/new-template-part.js +7 -4
- package/src/components/add-new-template/new-template.js +9 -22
- package/src/components/app/index.js +0 -1
- package/src/components/block-editor/editor-canvas.js +2 -1
- package/src/components/block-editor/index.js +3 -3
- package/src/components/editor/index.js +31 -28
- package/src/components/global-styles/border-panel.js +8 -8
- package/src/components/global-styles/color-palette-panel.js +6 -3
- package/src/components/global-styles/color-utils.js +2 -3
- package/src/components/global-styles/context-menu.js +17 -2
- package/src/components/global-styles/custom-css.js +4 -4
- package/src/components/global-styles/dimensions-panel.js +15 -11
- package/src/components/global-styles/global-styles-provider.js +3 -3
- package/src/components/global-styles/gradients-palette-panel.js +7 -4
- package/src/components/global-styles/header.js +9 -3
- package/src/components/global-styles/hooks.js +20 -93
- package/src/components/global-styles/navigation-button.js +4 -2
- package/src/components/global-styles/palette.js +4 -4
- package/src/components/global-styles/preview.js +3 -3
- package/src/components/global-styles/screen-background-color.js +6 -5
- package/src/components/global-styles/screen-block-list.js +19 -3
- package/src/components/global-styles/screen-button-color.js +11 -9
- package/src/components/global-styles/screen-colors.js +10 -10
- package/src/components/global-styles/screen-css.js +14 -7
- package/src/components/global-styles/screen-heading-color.js +12 -10
- package/src/components/global-styles/screen-link-color.js +6 -5
- 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 +6 -5
- package/src/components/global-styles/screen-typography.js +4 -4
- package/src/components/global-styles/shadow-panel.js +9 -6
- package/src/components/global-styles/style.scss +7 -1
- package/src/components/global-styles/subtitle.js +5 -2
- package/src/components/global-styles/typography-panel.js +31 -395
- 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/index.js +0 -32
- package/src/components/navigation-inspector/navigation-menu.js +10 -4
- package/src/components/save-panel/index.js +4 -1
- package/src/components/sidebar/index.js +14 -19
- package/src/components/sidebar-edit-mode/index.js +1 -1
- package/src/components/sidebar-edit-mode/template-card/index.js +24 -14
- package/src/components/sidebar-edit-mode/template-card/last-revision.js +75 -0
- package/src/components/sidebar-edit-mode/template-card/style.scss +4 -0
- 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-navigation-menus/style.scss +0 -4
- 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/start-template-options/index.js +171 -0
- package/src/components/start-template-options/style.scss +76 -0
- 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 +29 -24
- package/src/{experiments.js → private-apis.js} +1 -1
- package/src/store/index.js +1 -1
- package/src/style.scss +1 -0
- 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,5 +1,3 @@
|
|
|
1
|
-
$hub-height: $grid-unit-20 * 2 + $button-size;
|
|
2
|
-
|
|
3
1
|
.edit-site-layout {
|
|
4
2
|
height: 100%;
|
|
5
3
|
background: $gray-900;
|
|
@@ -10,24 +8,23 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
|
|
|
10
8
|
|
|
11
9
|
.edit-site-layout__hub {
|
|
12
10
|
position: fixed;
|
|
13
|
-
top:
|
|
14
|
-
left:
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
15
13
|
width: calc(100vw - #{$canvas-padding * 2});
|
|
16
|
-
height: $
|
|
14
|
+
height: $header-height;
|
|
17
15
|
z-index: z-index(".edit-site-layout__hub");
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
.edit-site-layout.is-full-canvas.is-edit-mode & {
|
|
18
|
+
width: auto;
|
|
19
|
+
padding-right: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@include break-medium {
|
|
23
|
+
width: calc(#{$nav-sidebar-width} - #{$canvas-padding * 2});
|
|
24
|
+
}
|
|
24
25
|
|
|
25
26
|
.edit-site-layout.is-full-canvas & {
|
|
26
|
-
top: 0;
|
|
27
|
-
left: 0;
|
|
28
|
-
padding: 0;
|
|
29
27
|
padding-right: $grid-unit-20;
|
|
30
|
-
height: $header-height;
|
|
31
28
|
border-radius: 0;
|
|
32
29
|
width: 100vw;
|
|
33
30
|
box-shadow: none;
|
|
@@ -37,15 +34,6 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
|
|
|
37
34
|
padding-right: 0;
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
|
-
|
|
41
|
-
.edit-site-layout.is-full-canvas.is-edit-mode & {
|
|
42
|
-
width: auto;
|
|
43
|
-
padding-right: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@include break-medium {
|
|
47
|
-
width: calc(#{$nav-sidebar-width} - #{$canvas-padding * 2});
|
|
48
|
-
}
|
|
49
37
|
}
|
|
50
38
|
|
|
51
39
|
.edit-site-layout__header {
|
|
@@ -24,7 +24,7 @@ export default function RenameMenuItem( { template, onClose } ) {
|
|
|
24
24
|
const { createSuccessNotice, createErrorNotice } =
|
|
25
25
|
useDispatch( noticesStore );
|
|
26
26
|
|
|
27
|
-
if ( ! template.is_custom ) {
|
|
27
|
+
if ( template.type === 'wp_template' && ! template.is_custom ) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -84,6 +84,10 @@ export default function Table( { templateType } ) {
|
|
|
84
84
|
<Heading level={ 4 }>
|
|
85
85
|
<Link
|
|
86
86
|
params={ {
|
|
87
|
+
path:
|
|
88
|
+
template.type === 'wp_template'
|
|
89
|
+
? '/templates/single'
|
|
90
|
+
: '/template-parts/single',
|
|
87
91
|
postId: template.id,
|
|
88
92
|
postType: template.type,
|
|
89
93
|
} }
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import { useState, useEffect } from '@wordpress/element';
|
|
6
|
-
import { SelectControl } from '@wordpress/components';
|
|
7
6
|
import { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';
|
|
8
7
|
import {
|
|
9
8
|
store as blockEditorStore,
|
|
10
9
|
BlockEditorProvider,
|
|
11
10
|
} from '@wordpress/block-editor';
|
|
12
11
|
import { speak } from '@wordpress/a11y';
|
|
13
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
14
12
|
import { __ } from '@wordpress/i18n';
|
|
15
13
|
|
|
16
14
|
/**
|
|
@@ -71,11 +69,6 @@ export default function NavigationInspector( { onSelect } ) {
|
|
|
71
69
|
};
|
|
72
70
|
}, [] );
|
|
73
71
|
|
|
74
|
-
const navMenuListId = useInstanceId(
|
|
75
|
-
NavigationMenu,
|
|
76
|
-
'edit-site-navigation-inspector-menu'
|
|
77
|
-
);
|
|
78
|
-
|
|
79
72
|
const firstNavRefInTemplate = clientIdToRef[ firstNavigationBlockId ];
|
|
80
73
|
const firstNavigationMenuRef = navigationMenus?.[ 0 ]?.id;
|
|
81
74
|
|
|
@@ -99,14 +92,6 @@ export default function NavigationInspector( { onSelect } ) {
|
|
|
99
92
|
}
|
|
100
93
|
}, [ selectedNavigationBlockId ] );
|
|
101
94
|
|
|
102
|
-
let options = [];
|
|
103
|
-
if ( navigationMenus ) {
|
|
104
|
-
options = navigationMenus.map( ( { id, title } ) => ( {
|
|
105
|
-
value: id,
|
|
106
|
-
label: title.rendered,
|
|
107
|
-
} ) );
|
|
108
|
-
}
|
|
109
|
-
|
|
110
95
|
const [ innerBlocks, onInput, onChange ] = useEntityBlockEditor(
|
|
111
96
|
'postType',
|
|
112
97
|
'wp_navigation',
|
|
@@ -137,8 +122,6 @@ export default function NavigationInspector( { onSelect } ) {
|
|
|
137
122
|
|
|
138
123
|
const isLoading = ! ( hasResolvedNavigationMenus && hasLoadedInnerBlocks );
|
|
139
124
|
|
|
140
|
-
const hasMoreThanOneNavigationMenu = navigationMenus?.length > 1;
|
|
141
|
-
|
|
142
125
|
const hasNavigationMenus = !! navigationMenus?.length;
|
|
143
126
|
|
|
144
127
|
// Entity block editor will return entities that are not currently published.
|
|
@@ -178,21 +161,6 @@ export default function NavigationInspector( { onSelect } ) {
|
|
|
178
161
|
{ ! hasResolvedNavigationMenus && (
|
|
179
162
|
<div className="edit-site-navigation-inspector__placeholder" />
|
|
180
163
|
) }
|
|
181
|
-
{ hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && (
|
|
182
|
-
<SelectControl
|
|
183
|
-
__nextHasNoMarginBottom
|
|
184
|
-
className="edit-site-navigation-inspector__select-menu"
|
|
185
|
-
aria-controls={
|
|
186
|
-
// aria-controls should only apply when referenced element is in DOM
|
|
187
|
-
hasLoadedInnerBlocks ? navMenuListId : undefined
|
|
188
|
-
}
|
|
189
|
-
value={ currentMenuId || defaultNavigationMenuId }
|
|
190
|
-
options={ options }
|
|
191
|
-
onChange={ ( newMenuId ) =>
|
|
192
|
-
setCurrentMenuId( Number( newMenuId ) )
|
|
193
|
-
}
|
|
194
|
-
/>
|
|
195
|
-
) }
|
|
196
164
|
{ isLoading && (
|
|
197
165
|
<>
|
|
198
166
|
<div className="edit-site-navigation-inspector__placeholder is-child" />
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
privateApis as blockEditorPrivateApis,
|
|
6
6
|
store as blockEditorStore,
|
|
7
7
|
} from '@wordpress/block-editor';
|
|
8
8
|
import { useEffect } from '@wordpress/element';
|
|
@@ -11,7 +11,7 @@ import { useDispatch } from '@wordpress/data';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { unlock } from '../../
|
|
14
|
+
import { unlock } from '../../private-apis';
|
|
15
15
|
|
|
16
16
|
const ALLOWED_BLOCKS = {
|
|
17
17
|
'core/navigation': [
|
|
@@ -39,7 +39,7 @@ const ALLOWED_BLOCKS = {
|
|
|
39
39
|
export default function NavigationMenu( { innerBlocks, onSelect } ) {
|
|
40
40
|
const { updateBlockListSettings } = useDispatch( blockEditorStore );
|
|
41
41
|
|
|
42
|
-
const { OffCanvasEditor } = unlock(
|
|
42
|
+
const { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );
|
|
43
43
|
|
|
44
44
|
//TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
|
|
45
45
|
//Think through a better way of doing this, possible with adding allowed blocks to block library metadata
|
|
@@ -56,5 +56,11 @@ export default function NavigationMenu( { innerBlocks, onSelect } ) {
|
|
|
56
56
|
} );
|
|
57
57
|
}, [ updateBlockListSettings, innerBlocks ] );
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return (
|
|
60
|
+
<OffCanvasEditor
|
|
61
|
+
blocks={ innerBlocks }
|
|
62
|
+
onSelect={ onSelect }
|
|
63
|
+
LeafMoreMenu={ LeafMoreMenu }
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
60
66
|
}
|
|
@@ -11,7 +11,7 @@ import { NavigableRegion } from '@wordpress/interface';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import { store as editSiteStore } from '../../store';
|
|
14
|
-
import { unlock } from '../../
|
|
14
|
+
import { unlock } from '../../private-apis';
|
|
15
15
|
|
|
16
16
|
export default function SavePanel() {
|
|
17
17
|
const { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {
|
|
@@ -35,6 +35,9 @@ export default function SavePanel() {
|
|
|
35
35
|
className="edit-site-save-panel__modal"
|
|
36
36
|
onRequestClose={ onClose }
|
|
37
37
|
__experimentalHideHeader
|
|
38
|
+
contentLabel={ __(
|
|
39
|
+
'Save site, content, and template changes'
|
|
40
|
+
) }
|
|
38
41
|
>
|
|
39
42
|
<EntitiesSavedStates close={ onClose } />
|
|
40
43
|
</Modal>
|
|
@@ -2,43 +2,39 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { memo } from '@wordpress/element';
|
|
5
|
-
import { useSelect } from '@wordpress/data';
|
|
6
5
|
import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';
|
|
7
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Internal dependencies
|
|
11
9
|
*/
|
|
12
10
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
13
11
|
import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
|
|
14
|
-
import
|
|
12
|
+
import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
|
|
13
|
+
import useSyncPathWithURL from '../sync-state-with-url/use-sync-path-with-url';
|
|
15
14
|
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
15
|
+
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
16
16
|
import SaveButton from '../save-button';
|
|
17
|
+
import SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';
|
|
17
18
|
|
|
18
19
|
function SidebarScreens() {
|
|
19
|
-
|
|
20
|
+
useSyncPathWithURL();
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
23
|
<>
|
|
23
24
|
<SidebarNavigationScreenMain />
|
|
24
25
|
<SidebarNavigationScreenNavigationMenus />
|
|
26
|
+
<SidebarNavigationScreenNavigationItem />
|
|
25
27
|
<SidebarNavigationScreenTemplates postType="wp_template" />
|
|
26
28
|
<SidebarNavigationScreenTemplates postType="wp_template_part" />
|
|
29
|
+
<SidebarNavigationScreenTemplate postType="wp_template" />
|
|
30
|
+
<SidebarNavigationScreenTemplate postType="wp_template_part" />
|
|
31
|
+
<SidebarNavigationScreenTemplatesBrowse postType="wp_template" />
|
|
32
|
+
<SidebarNavigationScreenTemplatesBrowse postType="wp_template_part" />
|
|
27
33
|
</>
|
|
28
34
|
);
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
function Sidebar() {
|
|
32
|
-
const { isDirty } = useSelect( ( select ) => {
|
|
33
|
-
const { __experimentalGetDirtyEntityRecords } = select( coreStore );
|
|
34
|
-
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
35
|
-
// The currently selected entity to display.
|
|
36
|
-
// Typically template or template part in the site editor.
|
|
37
|
-
return {
|
|
38
|
-
isDirty: dirtyEntityRecords.length > 0,
|
|
39
|
-
};
|
|
40
|
-
}, [] );
|
|
41
|
-
|
|
42
38
|
return (
|
|
43
39
|
<>
|
|
44
40
|
<NavigatorProvider
|
|
@@ -47,11 +43,10 @@ function Sidebar() {
|
|
|
47
43
|
>
|
|
48
44
|
<SidebarScreens />
|
|
49
45
|
</NavigatorProvider>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
) }
|
|
46
|
+
|
|
47
|
+
<div className="edit-site-sidebar__footer">
|
|
48
|
+
<SaveButton />
|
|
49
|
+
</div>
|
|
55
50
|
</>
|
|
56
51
|
);
|
|
57
52
|
}
|
|
@@ -69,7 +69,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
69
69
|
identifier={ sidebarName }
|
|
70
70
|
title={ __( 'Settings' ) }
|
|
71
71
|
icon={ isRTL() ? drawerLeft : drawerRight }
|
|
72
|
-
closeLabel={ __( 'Close settings
|
|
72
|
+
closeLabel={ __( 'Close settings' ) }
|
|
73
73
|
header={ <SettingsHeader sidebarName={ sidebarName } /> }
|
|
74
74
|
headerClassName="edit-site-sidebar-edit-mode__panel-tabs"
|
|
75
75
|
>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
4
5
|
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { Icon } from '@wordpress/components';
|
|
6
|
+
import { PanelRow, Icon } from '@wordpress/components';
|
|
6
7
|
import { store as editorStore } from '@wordpress/editor';
|
|
7
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
9
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -13,6 +14,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
13
14
|
import { store as editSiteStore } from '../../../store';
|
|
14
15
|
import TemplateActions from './template-actions';
|
|
15
16
|
import TemplateAreas from './template-areas';
|
|
17
|
+
import LastRevision from './last-revision';
|
|
16
18
|
|
|
17
19
|
export default function TemplateCard() {
|
|
18
20
|
const {
|
|
@@ -38,20 +40,28 @@ export default function TemplateCard() {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
return (
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
<div className="edit-site-template-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
<>
|
|
44
|
+
<div className="edit-site-template-card">
|
|
45
|
+
<Icon className="edit-site-template-card__icon" icon={ icon } />
|
|
46
|
+
<div className="edit-site-template-card__content">
|
|
47
|
+
<div className="edit-site-template-card__header">
|
|
48
|
+
<h2 className="edit-site-template-card__title">
|
|
49
|
+
{ decodeEntities( title ) }
|
|
50
|
+
</h2>
|
|
51
|
+
<TemplateActions template={ template } />
|
|
52
|
+
</div>
|
|
53
|
+
<div className="edit-site-template-card__description">
|
|
54
|
+
{ decodeEntities( description ) }
|
|
55
|
+
</div>
|
|
56
|
+
<TemplateAreas />
|
|
49
57
|
</div>
|
|
50
|
-
<div className="edit-site-template-card__description">
|
|
51
|
-
{ decodeEntities( description ) }
|
|
52
|
-
</div>
|
|
53
|
-
<TemplateAreas />
|
|
54
58
|
</div>
|
|
55
|
-
|
|
59
|
+
<PanelRow
|
|
60
|
+
header={ __( 'Editing history' ) }
|
|
61
|
+
className="edit-site-template-revisions"
|
|
62
|
+
>
|
|
63
|
+
<LastRevision />
|
|
64
|
+
</PanelRow>
|
|
65
|
+
</>
|
|
56
66
|
);
|
|
57
67
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Button } from '@wordpress/components';
|
|
5
|
+
import { sprintf, _n } from '@wordpress/i18n';
|
|
6
|
+
import { backup } from '@wordpress/icons';
|
|
7
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
8
|
+
import { PostTypeSupportCheck } from '@wordpress/editor';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import useEditedEntityRecord from '../../use-edited-entity-record';
|
|
14
|
+
|
|
15
|
+
const useRevisionData = () => {
|
|
16
|
+
const { record: currentTemplate } = useEditedEntityRecord();
|
|
17
|
+
|
|
18
|
+
const lastRevisionId =
|
|
19
|
+
currentTemplate?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;
|
|
20
|
+
|
|
21
|
+
const revisionsCount =
|
|
22
|
+
( currentTemplate?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0 ) +
|
|
23
|
+
1;
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
currentTemplate,
|
|
27
|
+
lastRevisionId,
|
|
28
|
+
revisionsCount,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function PostLastRevisionCheck( { children } ) {
|
|
33
|
+
const { lastRevisionId, revisionsCount } = useRevisionData();
|
|
34
|
+
|
|
35
|
+
if ( ! lastRevisionId || revisionsCount < 2 ) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<PostTypeSupportCheck supportKeys="revisions">
|
|
41
|
+
{ children }
|
|
42
|
+
</PostTypeSupportCheck>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const PostLastRevision = () => {
|
|
47
|
+
const { lastRevisionId, revisionsCount } = useRevisionData();
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<PostLastRevisionCheck>
|
|
51
|
+
<Button
|
|
52
|
+
href={ addQueryArgs( 'revision.php', {
|
|
53
|
+
revision: lastRevisionId,
|
|
54
|
+
gutenberg: true,
|
|
55
|
+
} ) }
|
|
56
|
+
className="edit-site-template-last-revision__title"
|
|
57
|
+
icon={ backup }
|
|
58
|
+
>
|
|
59
|
+
{ sprintf(
|
|
60
|
+
/* translators: %d: number of revisions */
|
|
61
|
+
_n( '%d Revision', '%d Revisions', revisionsCount ),
|
|
62
|
+
revisionsCount
|
|
63
|
+
) }
|
|
64
|
+
</Button>
|
|
65
|
+
</PostLastRevisionCheck>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default function LastRevision() {
|
|
70
|
+
return (
|
|
71
|
+
<PostLastRevisionCheck>
|
|
72
|
+
<PostLastRevision />
|
|
73
|
+
</PostLastRevisionCheck>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -4,19 +4,33 @@
|
|
|
4
4
|
import {
|
|
5
5
|
__experimentalHStack as HStack,
|
|
6
6
|
__experimentalVStack as VStack,
|
|
7
|
-
|
|
7
|
+
__experimentalNavigatorToParentButton as NavigatorToParentButton,
|
|
8
|
+
Button,
|
|
8
9
|
__experimentalNavigatorScreen as NavigatorScreen,
|
|
9
10
|
} from '@wordpress/components';
|
|
10
|
-
import { isRTL, __
|
|
11
|
+
import { isRTL, __ } from '@wordpress/i18n';
|
|
11
12
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
13
|
+
import { useSelect } from '@wordpress/data';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import { store as editSiteStore } from '../../store';
|
|
19
|
+
import { unlock } from '../../private-apis';
|
|
12
20
|
|
|
13
21
|
export default function SidebarNavigationScreen( {
|
|
14
22
|
path,
|
|
15
|
-
parentTitle,
|
|
16
23
|
title,
|
|
17
24
|
actions,
|
|
18
25
|
content,
|
|
19
26
|
} ) {
|
|
27
|
+
const { dashboardLink } = useSelect( ( select ) => {
|
|
28
|
+
const { getSettings } = unlock( select( editSiteStore ) );
|
|
29
|
+
return {
|
|
30
|
+
dashboardLink: getSettings().__experimentalDashboardLink,
|
|
31
|
+
};
|
|
32
|
+
}, [] );
|
|
33
|
+
|
|
20
34
|
return (
|
|
21
35
|
<NavigatorScreen
|
|
22
36
|
className="edit-site-sidebar-navigation-screen"
|
|
@@ -28,18 +42,20 @@ export default function SidebarNavigationScreen( {
|
|
|
28
42
|
justify="flex-start"
|
|
29
43
|
className="edit-site-sidebar-navigation-screen__title-icon"
|
|
30
44
|
>
|
|
31
|
-
{
|
|
32
|
-
<
|
|
45
|
+
{ path !== '/' ? (
|
|
46
|
+
<NavigatorToParentButton
|
|
33
47
|
className="edit-site-sidebar-navigation-screen__back"
|
|
34
48
|
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
35
|
-
aria-label={
|
|
36
|
-
/* translators: %s: previous page. */
|
|
37
|
-
__( 'Navigate to the previous view: %s' ),
|
|
38
|
-
parentTitle
|
|
39
|
-
) }
|
|
49
|
+
aria-label={ __( 'Back' ) }
|
|
40
50
|
/>
|
|
41
51
|
) : (
|
|
42
|
-
<
|
|
52
|
+
<Button
|
|
53
|
+
className="edit-site-sidebar-navigation-screen__back"
|
|
54
|
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
55
|
+
aria-label={ __( 'Navigate to the Dashboard' ) }
|
|
56
|
+
href={ dashboardLink || 'index.php' }
|
|
57
|
+
label={ __( 'Dashboard' ) }
|
|
58
|
+
/>
|
|
43
59
|
) }
|
|
44
60
|
<h2 className="edit-site-sidebar-navigation-screen__title">
|
|
45
61
|
{ title }
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
.edit-site-sidebar-navigation-screen__content {
|
|
9
9
|
margin: 0 $grid-unit-20 $grid-unit-20 $button-size;
|
|
10
|
+
color: $gray-600;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
.edit-site-sidebar-navigation-screen__title-icon {
|
|
13
14
|
position: sticky;
|
|
14
15
|
top: 0;
|
|
15
16
|
background: $gray-900;
|
|
16
|
-
padding-top: $grid-unit-60 + $
|
|
17
|
+
padding-top: $grid-unit-60 + $header-height;
|
|
17
18
|
box-shadow: 0 $grid-unit-10 $grid-unit-20 $gray-900;
|
|
18
19
|
margin-bottom: $grid-unit-10;
|
|
19
20
|
padding-bottom: $grid-unit-10;
|
|
@@ -31,11 +32,8 @@
|
|
|
31
32
|
.edit-site-sidebar-navigation-screen__back {
|
|
32
33
|
color: $gray-200;
|
|
33
34
|
|
|
34
|
-
&:hover
|
|
35
|
+
&:hover,
|
|
36
|
+
&:not([aria-disabled="true"]):active {
|
|
35
37
|
color: $white;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
|
-
|
|
39
|
-
.edit-site-sidebar-navigation-screen__icon-placeholder {
|
|
40
|
-
width: $button-size;
|
|
41
|
-
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
import { Button } from '@wordpress/components';
|
|
7
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
14
|
+
import { unlock } from '../../private-apis';
|
|
15
|
+
import { store as editSiteStore } from '../../store';
|
|
16
|
+
|
|
17
|
+
export default function SidebarNavigationScreenNavigationItem() {
|
|
18
|
+
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
19
|
+
|
|
20
|
+
const { post } = useSelect( ( select ) => {
|
|
21
|
+
const { getEditedPostContext } = select( editSiteStore );
|
|
22
|
+
const { getEntityRecord } = select( coreStore );
|
|
23
|
+
const { postType, postId } = getEditedPostContext() ?? {};
|
|
24
|
+
|
|
25
|
+
// The currently selected entity to display.
|
|
26
|
+
// Typically template or template part in the site editor.
|
|
27
|
+
return {
|
|
28
|
+
post:
|
|
29
|
+
postId && postType
|
|
30
|
+
? getEntityRecord( 'postType', postType, postId )
|
|
31
|
+
: null,
|
|
32
|
+
};
|
|
33
|
+
}, [] );
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<SidebarNavigationScreen
|
|
37
|
+
path="/navigation/single"
|
|
38
|
+
title={ post ? decodeEntities( post?.title?.rendered ) : null }
|
|
39
|
+
actions={
|
|
40
|
+
<Button
|
|
41
|
+
variant="primary"
|
|
42
|
+
onClick={ () => setCanvasMode( 'edit' ) }
|
|
43
|
+
>
|
|
44
|
+
{ __( 'Edit' ) }
|
|
45
|
+
</Button>
|
|
46
|
+
}
|
|
47
|
+
content={
|
|
48
|
+
post ? decodeEntities( post?.description?.rendered ) : null
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -25,6 +25,7 @@ export default function SidebarNavigationScreenNavigationMenus() {
|
|
|
25
25
|
history.push( {
|
|
26
26
|
postType: attributes.type,
|
|
27
27
|
postId: attributes.id,
|
|
28
|
+
path: '/navigation/single',
|
|
28
29
|
} );
|
|
29
30
|
}
|
|
30
31
|
},
|
|
@@ -33,7 +34,6 @@ export default function SidebarNavigationScreenNavigationMenus() {
|
|
|
33
34
|
return (
|
|
34
35
|
<SidebarNavigationScreen
|
|
35
36
|
path="/navigation"
|
|
36
|
-
parentTitle={ __( 'Design' ) }
|
|
37
37
|
title={ __( 'Navigation' ) }
|
|
38
38
|
content={
|
|
39
39
|
<div className="edit-site-sidebar-navigation-screen-navigation-menus">
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
6
|
+
import { Button } from '@wordpress/components';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
12
|
+
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
13
|
+
import { unlock } from '../../private-apis';
|
|
14
|
+
import { store as editSiteStore } from '../../store';
|
|
15
|
+
|
|
16
|
+
const config = {
|
|
17
|
+
wp_template: {
|
|
18
|
+
path: '/templates/single',
|
|
19
|
+
},
|
|
20
|
+
wp_template_part: {
|
|
21
|
+
path: '/template-parts/single',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default function SidebarNavigationScreenTemplate( {
|
|
26
|
+
postType = 'wp_template',
|
|
27
|
+
} ) {
|
|
28
|
+
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
29
|
+
const { getDescription, getTitle, record } = useEditedEntityRecord();
|
|
30
|
+
let description = getDescription();
|
|
31
|
+
if ( ! description && record.is_custom ) {
|
|
32
|
+
description = __(
|
|
33
|
+
'This is a custom template that can be applied manually to any Post or Page.'
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<SidebarNavigationScreen
|
|
39
|
+
path={ config[ postType ].path }
|
|
40
|
+
title={ getTitle() }
|
|
41
|
+
actions={
|
|
42
|
+
<Button
|
|
43
|
+
variant="primary"
|
|
44
|
+
onClick={ () => setCanvasMode( 'edit' ) }
|
|
45
|
+
>
|
|
46
|
+
{ __( 'Edit' ) }
|
|
47
|
+
</Button>
|
|
48
|
+
}
|
|
49
|
+
content={ description ? <p>{ description }</p> : undefined }
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|