@wordpress/edit-site 5.8.0 → 5.10.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 +4 -0
- package/build/components/add-new-template/add-custom-template-modal.js +21 -6
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +8 -2
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +8 -4
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +8 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +10 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +39 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +7 -7
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/editor/index.js +43 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +131 -0
- package/build/components/editor-canvas-container/index.js.map +1 -0
- package/build/components/global-styles/block-preview-panel.js +1 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +53 -5
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +14 -3
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +17 -18
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +4 -18
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +14 -3
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/root-menu.js +61 -0
- package/build/components/global-styles/root-menu.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +3 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +158 -7
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +9 -26
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -15
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +4 -17
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +148 -0
- package/build/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +132 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +130 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- 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-typography-element.js +0 -3
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +11 -39
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +3 -8
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +7 -11
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +66 -120
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +4 -28
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/index.js +11 -7
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +1 -1
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +22 -14
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/index.js +9 -3
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +4 -4
- package/build/components/list/table.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +44 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build/components/revisions/index.js +95 -0
- package/build/components/revisions/index.js.map +1 -0
- package/build/components/routes/link.js +17 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +8 -2
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +31 -6
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +14 -31
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +20 -7
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +2 -7
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +16 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +35 -14
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +9 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +40 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-card/index.js +1 -8
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +5 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +14 -4
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +24 -7
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +17 -5
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +67 -0
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +74 -0
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +5 -3
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-subtitle/index.js +18 -0
- package/build/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build/components/site-hub/index.js +64 -12
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +8 -7
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +21 -24
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +9 -41
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -5
- 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 +9 -4
- 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-path-with-url.js +17 -3
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-details/index.js +3 -1
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +9 -3
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/hooks/template-part-edit.js +8 -2
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/store/private-actions.js +19 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +13 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +23 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/is-previewing-theme.js +27 -0
- package/build/utils/is-previewing-theme.js.map +1 -0
- package/build/utils/use-activate-theme.js +46 -0
- package/build/utils/use-activate-theme.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js +21 -6
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +5 -1
- 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 -3
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +6 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +6 -1
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +37 -6
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +6 -6
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +45 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +115 -0
- package/build-module/components/editor-canvas-container/index.js.map +1 -0
- package/build-module/components/global-styles/block-preview-panel.js +1 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +54 -5
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +13 -3
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +17 -18
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +5 -19
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +13 -3
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +47 -0
- package/build-module/components/global-styles/root-menu.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +4 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +151 -7
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +9 -25
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +20 -15
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -16
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +128 -0
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +121 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +116 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +2 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -3
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +11 -37
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +3 -7
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +7 -11
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +66 -118
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +3 -22
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +10 -7
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +1 -1
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +17 -10
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/index.js +5 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +4 -4
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +35 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build-module/components/revisions/index.js +77 -0
- package/build-module/components/revisions/index.js.map +1 -0
- package/build-module/components/routes/link.js +13 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +5 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +28 -6
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +13 -32
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +19 -7
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -8
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +35 -16
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +10 -5
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +29 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-card/index.js +2 -7
- 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 → template-revisions/index.js} +1 -1
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +6 -8
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +13 -5
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +25 -8
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +13 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +48 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -3
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +10 -0
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +64 -14
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +8 -7
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +22 -25
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +10 -41
- 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 +10 -4
- 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 +5 -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-path-with-url.js +13 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-details/index.js +3 -1
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +5 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +5 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/private-actions.js +15 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +11 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +23 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +17 -0
- package/build-module/utils/is-previewing-theme.js.map +1 -0
- package/build-module/utils/use-activate-theme.js +36 -0
- package/build-module/utils/use-activate-theme.js.map +1 -0
- package/build-style/style-rtl.css +310 -137
- package/build-style/style.css +310 -137
- package/package.json +37 -35
- package/src/components/add-new-template/add-custom-template-modal.js +31 -8
- package/src/components/add-new-template/new-template-part.js +4 -1
- package/src/components/add-new-template/new-template.js +6 -1
- package/src/components/add-new-template/style.scss +52 -48
- package/src/components/app/index.js +6 -3
- package/src/components/block-editor/back-button.js +4 -1
- package/src/components/block-editor/editor-canvas.js +36 -8
- package/src/components/block-editor/index.js +8 -8
- package/src/components/block-editor/style.scss +15 -8
- package/src/components/editor/index.js +48 -7
- package/src/components/editor-canvas-container/index.js +128 -0
- package/src/components/editor-canvas-container/style.scss +19 -0
- package/src/components/global-styles/block-preview-panel.js +1 -1
- package/src/components/global-styles/border-panel.js +46 -3
- package/src/components/global-styles/color-palette-panel.js +9 -0
- package/src/components/global-styles/dimensions-panel.js +15 -15
- package/src/components/global-styles/global-styles-provider.js +4 -18
- package/src/components/global-styles/gradients-palette-panel.js +8 -0
- package/src/components/global-styles/root-menu.js +66 -0
- package/src/components/global-styles/screen-block-list.js +2 -2
- package/src/components/global-styles/screen-block.js +184 -7
- package/src/components/global-styles/screen-colors.js +9 -16
- package/src/components/global-styles/screen-css.js +21 -21
- package/src/components/global-styles/screen-layout.js +5 -9
- package/src/components/global-styles/screen-revisions/index.js +177 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +131 -0
- package/src/components/global-styles/screen-revisions/style.scss +99 -0
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +125 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +103 -0
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography-element.js +1 -3
- package/src/components/global-styles/screen-typography.js +44 -79
- package/src/components/global-styles/style-variations-container.js +4 -10
- package/src/components/global-styles/style.scss +1 -23
- package/src/components/global-styles/typography-panel.js +12 -13
- package/src/components/global-styles/ui.js +82 -107
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/index.js +17 -5
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/index.js +16 -19
- package/src/components/layout/style.scss +32 -7
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +4 -0
- package/src/components/list/table.js +19 -3
- package/src/components/plugin-template-setting-panel/index.js +33 -0
- package/src/components/revisions/index.js +104 -0
- package/src/components/routes/link.js +16 -1
- package/src/components/routes/use-title.js +4 -1
- package/src/components/save-button/index.js +27 -6
- package/src/components/save-hub/index.js +17 -35
- package/src/components/save-panel/index.js +15 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +2 -6
- package/src/components/secondary-sidebar/style.scss +23 -5
- package/src/components/sidebar/index.js +12 -1
- package/src/components/sidebar/style.scss +2 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +39 -18
- package/src/components/sidebar-edit-mode/index.js +17 -6
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +26 -0
- package/src/components/sidebar-edit-mode/style.scss +10 -0
- package/src/components/sidebar-edit-mode/template-card/index.js +1 -9
- package/src/components/sidebar-navigation-item/index.js +13 -14
- package/src/components/sidebar-navigation-item/style.scss +8 -1
- package/src/components/sidebar-navigation-screen/index.js +26 -5
- package/src/components/sidebar-navigation-screen-main/index.js +43 -22
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +13 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/src/components/sidebar-navigation-screen-page/index.js +59 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +82 -0
- package/src/components/sidebar-navigation-screen-pages/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +5 -1
- package/src/components/sidebar-navigation-subtitle/index.js +5 -0
- package/src/components/sidebar-navigation-subtitle/style.scss +7 -0
- package/src/components/site-hub/index.js +92 -33
- package/src/components/site-hub/style.scss +8 -0
- package/src/components/site-icon/index.js +6 -11
- package/src/components/site-icon/style.scss +8 -3
- package/src/components/start-template-options/index.js +32 -39
- package/src/components/start-template-options/style.scss +36 -46
- package/src/components/style-book/index.js +7 -51
- package/src/components/style-book/style.scss +0 -18
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -4
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +14 -1
- package/src/components/template-details/index.js +1 -0
- package/src/components/template-details/template-areas.js +4 -1
- package/src/hooks/template-part-edit.js +4 -1
- package/src/index.js +1 -0
- package/src/store/private-actions.js +14 -0
- package/src/store/private-selectors.js +11 -0
- package/src/store/reducer.js +18 -0
- package/src/store/test/actions.js +6 -14
- package/src/style.scss +5 -1
- package/src/utils/is-previewing-theme.js +18 -0
- package/src/utils/use-activate-theme.js +38 -0
- package/build/components/global-styles/context-menu.js +0 -126
- package/build/components/global-styles/context-menu.js.map +0 -1
- package/build/components/global-styles/custom-css.js +0 -113
- package/build/components/global-styles/custom-css.js.map +0 -1
- package/build/components/global-styles/effects-panel.js +0 -53
- package/build/components/global-styles/effects-panel.js.map +0 -1
- package/build/components/global-styles/filters-panel.js +0 -45
- package/build/components/global-styles/filters-panel.js.map +0 -1
- package/build/components/global-styles/screen-border.js +0 -61
- package/build/components/global-styles/screen-border.js.map +0 -1
- package/build/components/global-styles/screen-effects.js +0 -61
- package/build/components/global-styles/screen-effects.js.map +0 -1
- package/build/components/global-styles/screen-filters.js +0 -46
- package/build/components/global-styles/screen-filters.js.map +0 -1
- package/build/components/global-styles/screen-variations.js +0 -71
- package/build/components/global-styles/screen-variations.js.map +0 -1
- package/build/components/routes/index.js +0 -60
- package/build/components/routes/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build/hooks/commands/index.js +0 -19
- package/build/hooks/commands/index.js.map +0 -1
- package/build/hooks/commands/use-navigation-commands.js +0 -117
- package/build/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build/hooks/commands/use-wp-admin-commands.js +0 -94
- package/build/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build/utils/history.js +0 -41
- package/build/utils/history.js.map +0 -1
- package/build-module/components/global-styles/context-menu.js +0 -107
- package/build-module/components/global-styles/context-menu.js.map +0 -1
- package/build-module/components/global-styles/custom-css.js +0 -98
- package/build-module/components/global-styles/custom-css.js.map +0 -1
- package/build-module/components/global-styles/effects-panel.js +0 -43
- package/build-module/components/global-styles/effects-panel.js.map +0 -1
- package/build-module/components/global-styles/filters-panel.js +0 -35
- package/build-module/components/global-styles/filters-panel.js.map +0 -1
- package/build-module/components/global-styles/screen-border.js +0 -44
- package/build-module/components/global-styles/screen-border.js.map +0 -1
- package/build-module/components/global-styles/screen-effects.js +0 -44
- package/build-module/components/global-styles/screen-effects.js.map +0 -1
- package/build-module/components/global-styles/screen-filters.js +0 -33
- package/build-module/components/global-styles/screen-filters.js.map +0 -1
- package/build-module/components/global-styles/screen-variations.js +0 -54
- package/build-module/components/global-styles/screen-variations.js.map +0 -1
- package/build-module/components/routes/index.js +0 -47
- package/build-module/components/routes/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build-module/hooks/commands/index.js +0 -10
- package/build-module/hooks/commands/index.js.map +0 -1
- package/build-module/hooks/commands/use-navigation-commands.js +0 -101
- package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build-module/hooks/commands/use-wp-admin-commands.js +0 -79
- package/build-module/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build-module/utils/history.js +0 -31
- package/build-module/utils/history.js.map +0 -1
- package/src/components/global-styles/context-menu.js +0 -175
- package/src/components/global-styles/custom-css.js +0 -131
- package/src/components/global-styles/effects-panel.js +0 -40
- package/src/components/global-styles/filters-panel.js +0 -33
- package/src/components/global-styles/screen-border.js +0 -35
- package/src/components/global-styles/screen-effects.js +0 -35
- package/src/components/global-styles/screen-filters.js +0 -27
- package/src/components/global-styles/screen-variations.js +0 -46
- package/src/components/routes/index.js +0 -53
- package/src/hooks/commands/index.js +0 -10
- package/src/hooks/commands/use-navigation-commands.js +0 -103
- package/src/hooks/commands/use-wp-admin-commands.js +0 -77
- package/src/utils/history.js +0 -39
- /package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { unlock } from '../../private-apis';
|
|
10
|
+
|
|
11
|
+
const { createPrivateSlotFill } = unlock( componentsPrivateApis );
|
|
12
|
+
const SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME = 'SidebarFixedBottom';
|
|
13
|
+
const { Slot: SidebarFixedBottomSlot, Fill: SidebarFixedBottomFill } =
|
|
14
|
+
createPrivateSlotFill( SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME );
|
|
15
|
+
|
|
16
|
+
export default function SidebarFixedBottom( { children } ) {
|
|
17
|
+
return (
|
|
18
|
+
<SidebarFixedBottomFill>
|
|
19
|
+
<div className="edit-site-sidebar-fixed-bottom-slot">
|
|
20
|
+
{ children }
|
|
21
|
+
</div>
|
|
22
|
+
</SidebarFixedBottomFill>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { SidebarFixedBottomSlot };
|
|
@@ -99,3 +99,13 @@
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
.edit-site-sidebar-fixed-bottom-slot {
|
|
104
|
+
position: sticky;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
background: $white;
|
|
107
|
+
display: flex;
|
|
108
|
+
padding: $grid-unit-20;
|
|
109
|
+
border-top: $border-width solid $gray-300;
|
|
110
|
+
box-sizing: content-box;
|
|
111
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
4
|
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import {
|
|
5
|
+
import { Icon } from '@wordpress/components';
|
|
7
6
|
import { store as editorStore } from '@wordpress/editor';
|
|
8
7
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
8
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -14,7 +13,6 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
14
13
|
import { store as editSiteStore } from '../../../store';
|
|
15
14
|
import TemplateActions from './template-actions';
|
|
16
15
|
import TemplateAreas from './template-areas';
|
|
17
|
-
import LastRevision from './last-revision';
|
|
18
16
|
|
|
19
17
|
export default function TemplateCard() {
|
|
20
18
|
const {
|
|
@@ -56,12 +54,6 @@ export default function TemplateCard() {
|
|
|
56
54
|
<TemplateAreas />
|
|
57
55
|
</div>
|
|
58
56
|
</div>
|
|
59
|
-
<PanelRow
|
|
60
|
-
header={ __( 'Editing history' ) }
|
|
61
|
-
className="edit-site-template-revisions"
|
|
62
|
-
>
|
|
63
|
-
<LastRevision />
|
|
64
|
-
</PanelRow>
|
|
65
57
|
</>
|
|
66
58
|
);
|
|
67
59
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
__experimentalHStack as HStack,
|
|
12
12
|
FlexBlock,
|
|
13
13
|
} from '@wordpress/components';
|
|
14
|
-
import {
|
|
14
|
+
import { chevronRightSmall, Icon } from '@wordpress/icons';
|
|
15
15
|
|
|
16
16
|
export default function SidebarNavigationItem( {
|
|
17
17
|
className,
|
|
@@ -28,24 +28,23 @@ export default function SidebarNavigationItem( {
|
|
|
28
28
|
) }
|
|
29
29
|
{ ...props }
|
|
30
30
|
>
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
<HStack justify="flex-start">
|
|
32
|
+
{ icon && (
|
|
33
33
|
<Icon
|
|
34
34
|
style={ { fill: 'currentcolor' } }
|
|
35
35
|
icon={ icon }
|
|
36
36
|
size={ 24 }
|
|
37
37
|
/>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{ ! icon && children }
|
|
38
|
+
) }
|
|
39
|
+
<FlexBlock>{ children }</FlexBlock>
|
|
40
|
+
{ withChevron && (
|
|
41
|
+
<Icon
|
|
42
|
+
icon={ chevronRightSmall }
|
|
43
|
+
className="edit-site-sidebar-navigation-item__drilldown-indicator"
|
|
44
|
+
size={ 24 }
|
|
45
|
+
/>
|
|
46
|
+
) }
|
|
47
|
+
</HStack>
|
|
49
48
|
</Item>
|
|
50
49
|
);
|
|
51
50
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
.edit-site-sidebar-navigation-item.components-item {
|
|
2
2
|
color: $gray-600;
|
|
3
|
-
|
|
3
|
+
// 6px right padding to align with + button
|
|
4
|
+
padding: $grid-unit-10 6px $grid-unit-10 $grid-unit-20;
|
|
5
|
+
border: none;
|
|
6
|
+
min-height: $grid-unit-50;
|
|
4
7
|
|
|
5
8
|
&:hover,
|
|
6
9
|
&:focus,
|
|
@@ -12,6 +15,10 @@
|
|
|
12
15
|
&[aria-current] {
|
|
13
16
|
background: var(--wp-admin-theme-color);
|
|
14
17
|
}
|
|
18
|
+
|
|
19
|
+
.edit-site-sidebar-navigation-item__drilldown-indicator {
|
|
20
|
+
fill: $gray-700;
|
|
21
|
+
}
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
.edit-site-sidebar-navigation-screen__content .block-editor-list-view-block-select-button {
|
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
__experimentalNavigatorToParentButton as NavigatorToParentButton,
|
|
8
8
|
__experimentalHeading as Heading,
|
|
9
9
|
} from '@wordpress/components';
|
|
10
|
-
import { isRTL, __ } from '@wordpress/i18n';
|
|
10
|
+
import { isRTL, __, sprintf } from '@wordpress/i18n';
|
|
11
11
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
12
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
12
13
|
import { useSelect } from '@wordpress/data';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -17,6 +18,10 @@ import { useSelect } from '@wordpress/data';
|
|
|
17
18
|
import { store as editSiteStore } from '../../store';
|
|
18
19
|
import { unlock } from '../../private-apis';
|
|
19
20
|
import SidebarButton from '../sidebar-button';
|
|
21
|
+
import {
|
|
22
|
+
isPreviewingTheme,
|
|
23
|
+
currentlyPreviewingTheme,
|
|
24
|
+
} from '../../utils/is-previewing-theme';
|
|
20
25
|
|
|
21
26
|
export default function SidebarNavigationScreen( {
|
|
22
27
|
isRoot,
|
|
@@ -31,6 +36,8 @@ export default function SidebarNavigationScreen( {
|
|
|
31
36
|
dashboardLink: getSettings().__experimentalDashboardLink,
|
|
32
37
|
};
|
|
33
38
|
}, [] );
|
|
39
|
+
const { getTheme } = useSelect( coreStore );
|
|
40
|
+
const theme = getTheme( currentlyPreviewingTheme() );
|
|
34
41
|
|
|
35
42
|
return (
|
|
36
43
|
<VStack spacing={ 2 }>
|
|
@@ -43,13 +50,21 @@ export default function SidebarNavigationScreen( {
|
|
|
43
50
|
<NavigatorToParentButton
|
|
44
51
|
as={ SidebarButton }
|
|
45
52
|
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
46
|
-
|
|
53
|
+
label={ __( 'Back' ) }
|
|
47
54
|
/>
|
|
48
55
|
) : (
|
|
49
56
|
<SidebarButton
|
|
50
57
|
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
51
|
-
label={
|
|
52
|
-
|
|
58
|
+
label={
|
|
59
|
+
! isPreviewingTheme()
|
|
60
|
+
? __( 'Go back to the Dashboard' )
|
|
61
|
+
: __( 'Go back to the theme showcase' )
|
|
62
|
+
}
|
|
63
|
+
href={
|
|
64
|
+
! isPreviewingTheme()
|
|
65
|
+
? dashboardLink || 'index.php'
|
|
66
|
+
: 'themes.php'
|
|
67
|
+
}
|
|
53
68
|
/>
|
|
54
69
|
) }
|
|
55
70
|
<Heading
|
|
@@ -58,7 +73,13 @@ export default function SidebarNavigationScreen( {
|
|
|
58
73
|
level={ 2 }
|
|
59
74
|
size={ 20 }
|
|
60
75
|
>
|
|
61
|
-
{
|
|
76
|
+
{ ! isPreviewingTheme()
|
|
77
|
+
? title
|
|
78
|
+
: sprintf(
|
|
79
|
+
'Previewing %1$s: %2$s',
|
|
80
|
+
theme?.name?.rendered,
|
|
81
|
+
title
|
|
82
|
+
) }
|
|
62
83
|
</Heading>
|
|
63
84
|
{ actions }
|
|
64
85
|
</HStack>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
__experimentalNavigatorButton as NavigatorButton,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { layout,
|
|
9
|
+
import { layout, symbol, navigation, styles, page } from '@wordpress/icons';
|
|
10
10
|
import { useSelect } from '@wordpress/data';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
|
|
@@ -17,23 +17,33 @@ import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
|
17
17
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
18
18
|
|
|
19
19
|
export default function SidebarNavigationScreenMain() {
|
|
20
|
-
const hasNavigationMenus = useSelect(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
const { hasNavigationMenus, hasGlobalStyleVariations } = useSelect(
|
|
21
|
+
( select ) => {
|
|
22
|
+
const {
|
|
23
|
+
getEntityRecords,
|
|
24
|
+
__experimentalGetCurrentThemeGlobalStylesVariations,
|
|
25
|
+
} = select( coreStore );
|
|
26
|
+
// The query needs to be the same as in the "SidebarNavigationScreenNavigationMenus" component,
|
|
27
|
+
// to avoid double network calls.
|
|
28
|
+
const navigationMenus = getEntityRecords(
|
|
29
|
+
'postType',
|
|
30
|
+
'wp_navigation',
|
|
31
|
+
{
|
|
32
|
+
per_page: 1,
|
|
33
|
+
status: 'publish',
|
|
34
|
+
order: 'desc',
|
|
35
|
+
orderby: 'date',
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
return {
|
|
39
|
+
hasNavigationMenus: !! navigationMenus?.length,
|
|
40
|
+
hasGlobalStyleVariations:
|
|
41
|
+
!! __experimentalGetCurrentThemeGlobalStylesVariations()
|
|
42
|
+
?.length,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
[]
|
|
46
|
+
);
|
|
37
47
|
const showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN
|
|
38
48
|
? hasNavigationMenus
|
|
39
49
|
: false;
|
|
@@ -56,13 +66,24 @@ export default function SidebarNavigationScreenMain() {
|
|
|
56
66
|
{ __( 'Navigation' ) }
|
|
57
67
|
</NavigatorButton>
|
|
58
68
|
) }
|
|
69
|
+
{ hasGlobalStyleVariations && (
|
|
70
|
+
<NavigatorButton
|
|
71
|
+
as={ SidebarNavigationItem }
|
|
72
|
+
path="/wp_global_styles"
|
|
73
|
+
withChevron
|
|
74
|
+
icon={ styles }
|
|
75
|
+
>
|
|
76
|
+
{ __( 'Styles' ) }
|
|
77
|
+
</NavigatorButton>
|
|
78
|
+
) }
|
|
79
|
+
|
|
59
80
|
<NavigatorButton
|
|
60
81
|
as={ SidebarNavigationItem }
|
|
61
|
-
path="/
|
|
82
|
+
path="/page"
|
|
62
83
|
withChevron
|
|
63
|
-
icon={
|
|
84
|
+
icon={ page }
|
|
64
85
|
>
|
|
65
|
-
{ __( '
|
|
86
|
+
{ __( 'Pages' ) }
|
|
66
87
|
</NavigatorButton>
|
|
67
88
|
<NavigatorButton
|
|
68
89
|
as={ SidebarNavigationItem }
|
|
@@ -76,7 +97,7 @@ export default function SidebarNavigationScreenMain() {
|
|
|
76
97
|
as={ SidebarNavigationItem }
|
|
77
98
|
path="/wp_template_part"
|
|
78
99
|
withChevron
|
|
79
|
-
icon={
|
|
100
|
+
icon={ symbol }
|
|
80
101
|
>
|
|
81
102
|
{ __( 'Template Parts' ) }
|
|
82
103
|
</NavigatorButton>
|
|
@@ -36,15 +36,9 @@ export default function SidebarNavigationScreenNavigationItem() {
|
|
|
36
36
|
icon={ pencil }
|
|
37
37
|
/>
|
|
38
38
|
}
|
|
39
|
-
description={
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
'Pages are static and are not listed by date. Pages do not use tags or categories.'
|
|
43
|
-
)
|
|
44
|
-
: __(
|
|
45
|
-
'Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'
|
|
46
|
-
)
|
|
47
|
-
}
|
|
39
|
+
description={ __(
|
|
40
|
+
'Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'
|
|
41
|
+
) }
|
|
48
42
|
content={
|
|
49
43
|
<>
|
|
50
44
|
{ record?.link ? (
|
|
@@ -7,16 +7,22 @@ import { useSelect } from '@wordpress/data';
|
|
|
7
7
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
8
|
import { BlockEditorProvider } from '@wordpress/block-editor';
|
|
9
9
|
import { createBlock } from '@wordpress/blocks';
|
|
10
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
13
14
|
*/
|
|
14
15
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
15
|
-
import { useHistory } from '../routes';
|
|
16
16
|
import NavigationMenuContent from './navigation-menu-content';
|
|
17
17
|
import { NavigationMenuLoader } from './loader';
|
|
18
18
|
import { unlock } from '../../private-apis';
|
|
19
19
|
import { store as editSiteStore } from '../../store';
|
|
20
|
+
import {
|
|
21
|
+
isPreviewingTheme,
|
|
22
|
+
currentlyPreviewingTheme,
|
|
23
|
+
} from '../../utils/is-previewing-theme';
|
|
24
|
+
|
|
25
|
+
const { useHistory } = unlock( routerPrivateApis );
|
|
20
26
|
|
|
21
27
|
const noop = () => {};
|
|
22
28
|
const NAVIGATION_MENUS_QUERY = {
|
|
@@ -84,12 +90,18 @@ export default function SidebarNavigationScreenNavigationMenus() {
|
|
|
84
90
|
history.push( {
|
|
85
91
|
postType: attributes.type,
|
|
86
92
|
postId: attributes.id,
|
|
93
|
+
...( isPreviewingTheme() && {
|
|
94
|
+
theme_preview: currentlyPreviewingTheme(),
|
|
95
|
+
} ),
|
|
87
96
|
} );
|
|
88
97
|
}
|
|
89
98
|
if ( name === 'core/page-list-item' && attributes.id && history ) {
|
|
90
99
|
history.push( {
|
|
91
100
|
postType: 'page',
|
|
92
101
|
postId: attributes.id,
|
|
102
|
+
...( isPreviewingTheme() && {
|
|
103
|
+
theme_preview: currentlyPreviewingTheme(),
|
|
104
|
+
} ),
|
|
93
105
|
} );
|
|
94
106
|
}
|
|
95
107
|
},
|
package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js
CHANGED
|
@@ -144,7 +144,7 @@ export default function NavigationMenuContent( { rootClientId, onSelect } ) {
|
|
|
144
144
|
};
|
|
145
145
|
}, [ shouldKeepLoading, clientIdsTree, isLoading ] );
|
|
146
146
|
|
|
147
|
-
const {
|
|
147
|
+
const { PrivateListView, LeafMoreMenu } = unlock( blockEditorPrivateApis );
|
|
148
148
|
|
|
149
149
|
const offCanvasOnselect = useCallback(
|
|
150
150
|
( block ) => {
|
|
@@ -181,14 +181,14 @@ export default function NavigationMenuContent( { rootClientId, onSelect } ) {
|
|
|
181
181
|
<>
|
|
182
182
|
{ isLoading && <NavigationMenuLoader /> }
|
|
183
183
|
{ ! isLoading && (
|
|
184
|
-
<
|
|
184
|
+
<PrivateListView
|
|
185
185
|
blocks={
|
|
186
186
|
isSinglePageList
|
|
187
187
|
? clientIdsTree[ 0 ].innerBlocks
|
|
188
188
|
: clientIdsTree
|
|
189
189
|
}
|
|
190
190
|
onSelect={ offCanvasOnselect }
|
|
191
|
-
|
|
191
|
+
blockSettingsMenu={ LeafMoreMenu }
|
|
192
192
|
showAppender={ false }
|
|
193
193
|
renderAdditionalBlockUI={ renderAdditionalBlockUICallback }
|
|
194
194
|
/>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
6
|
+
import {
|
|
7
|
+
__experimentalUseNavigator as useNavigator,
|
|
8
|
+
ExternalLink,
|
|
9
|
+
} from '@wordpress/components';
|
|
10
|
+
import { useEntityRecord } from '@wordpress/core-data';
|
|
11
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
12
|
+
import { pencil } from '@wordpress/icons';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
18
|
+
import { unlock } from '../../private-apis';
|
|
19
|
+
import { store as editSiteStore } from '../../store';
|
|
20
|
+
import SidebarButton from '../sidebar-button';
|
|
21
|
+
|
|
22
|
+
export default function SidebarNavigationScreenPage() {
|
|
23
|
+
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
24
|
+
const {
|
|
25
|
+
params: { postId },
|
|
26
|
+
} = useNavigator();
|
|
27
|
+
const { record } = useEntityRecord( 'postType', 'page', postId );
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<SidebarNavigationScreen
|
|
31
|
+
title={ record ? decodeEntities( record?.title?.rendered ) : null }
|
|
32
|
+
actions={
|
|
33
|
+
<SidebarButton
|
|
34
|
+
onClick={ () => setCanvasMode( 'edit' ) }
|
|
35
|
+
label={ __( 'Edit' ) }
|
|
36
|
+
icon={ pencil }
|
|
37
|
+
/>
|
|
38
|
+
}
|
|
39
|
+
description={ __(
|
|
40
|
+
'Pages are static and are not listed by date. Pages do not use tags or categories.'
|
|
41
|
+
) }
|
|
42
|
+
content={
|
|
43
|
+
<>
|
|
44
|
+
{ record?.link ? (
|
|
45
|
+
<ExternalLink
|
|
46
|
+
className="edit-site-sidebar-navigation-screen__page-link"
|
|
47
|
+
href={ record.link }
|
|
48
|
+
>
|
|
49
|
+
{ record.link }
|
|
50
|
+
</ExternalLink>
|
|
51
|
+
) : null }
|
|
52
|
+
{ record
|
|
53
|
+
? decodeEntities( record?.description?.rendered )
|
|
54
|
+
: null }
|
|
55
|
+
</>
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
__experimentalItemGroup as ItemGroup,
|
|
6
|
+
__experimentalItem as Item,
|
|
7
|
+
} from '@wordpress/components';
|
|
8
|
+
import { __ } from '@wordpress/i18n';
|
|
9
|
+
import { useEntityRecords } from '@wordpress/core-data';
|
|
10
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
16
|
+
import { useLink } from '../routes/link';
|
|
17
|
+
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
18
|
+
import SidebarNavigationSubtitle from '../sidebar-navigation-subtitle';
|
|
19
|
+
|
|
20
|
+
const PageItem = ( { postId, ...props } ) => {
|
|
21
|
+
const linkInfo = useLink( {
|
|
22
|
+
postType: 'page',
|
|
23
|
+
postId,
|
|
24
|
+
} );
|
|
25
|
+
return <SidebarNavigationItem { ...linkInfo } { ...props } />;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function SidebarNavigationScreenPages() {
|
|
29
|
+
const { records: pages, isResolving: isLoading } = useEntityRecords(
|
|
30
|
+
'postType',
|
|
31
|
+
'page'
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<SidebarNavigationScreen
|
|
36
|
+
title={ __( 'Pages' ) }
|
|
37
|
+
description={ __( 'Browse and edit pages on your site.' ) }
|
|
38
|
+
content={
|
|
39
|
+
<>
|
|
40
|
+
{ isLoading && (
|
|
41
|
+
<ItemGroup>
|
|
42
|
+
<Item>{ __( 'Loading pages' ) }</Item>
|
|
43
|
+
</ItemGroup>
|
|
44
|
+
) }
|
|
45
|
+
{ ! isLoading && (
|
|
46
|
+
<>
|
|
47
|
+
<SidebarNavigationSubtitle>
|
|
48
|
+
{ __( 'Recent' ) }
|
|
49
|
+
</SidebarNavigationSubtitle>
|
|
50
|
+
<ItemGroup>
|
|
51
|
+
{ ! pages?.length && (
|
|
52
|
+
<Item>{ __( 'No page found' ) }</Item>
|
|
53
|
+
) }
|
|
54
|
+
{ pages?.map( ( page ) => (
|
|
55
|
+
<PageItem
|
|
56
|
+
postId={ page.id }
|
|
57
|
+
key={ page.id }
|
|
58
|
+
withChevron
|
|
59
|
+
>
|
|
60
|
+
{ decodeEntities(
|
|
61
|
+
page.title?.rendered
|
|
62
|
+
) ?? __( '(no title)' ) }
|
|
63
|
+
</PageItem>
|
|
64
|
+
) ) }
|
|
65
|
+
<SidebarNavigationItem
|
|
66
|
+
className="edit-site-sidebar-navigation-screen-pages__see-all"
|
|
67
|
+
href="edit.php?post_type=page"
|
|
68
|
+
onClick={ () => {
|
|
69
|
+
document.location =
|
|
70
|
+
'edit.php?post_type=page';
|
|
71
|
+
} }
|
|
72
|
+
>
|
|
73
|
+
{ __( 'Manage all pages' ) }
|
|
74
|
+
</SidebarNavigationItem>
|
|
75
|
+
</ItemGroup>
|
|
76
|
+
</>
|
|
77
|
+
) }
|
|
78
|
+
</>
|
|
79
|
+
}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -74,7 +74,9 @@ export default function SidebarNavigationScreenTemplates() {
|
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
const sortedTemplates = templates ? [ ...templates ] : [];
|
|
77
|
-
sortedTemplates.sort( ( a, b ) =>
|
|
77
|
+
sortedTemplates.sort( ( a, b ) =>
|
|
78
|
+
a.title.rendered.localeCompare( b.title.rendered )
|
|
79
|
+
);
|
|
78
80
|
|
|
79
81
|
const browseAllLink = useLink( {
|
|
80
82
|
path: '/' + postType + '/all',
|
|
@@ -112,6 +114,7 @@ export default function SidebarNavigationScreenTemplates() {
|
|
|
112
114
|
postType={ postType }
|
|
113
115
|
postId={ template.id }
|
|
114
116
|
key={ template.id }
|
|
117
|
+
withChevron
|
|
115
118
|
>
|
|
116
119
|
{ decodeEntities(
|
|
117
120
|
template.title?.rendered ||
|
|
@@ -126,6 +129,7 @@ export default function SidebarNavigationScreenTemplates() {
|
|
|
126
129
|
children={
|
|
127
130
|
config[ postType ].labels.manage
|
|
128
131
|
}
|
|
132
|
+
withChevron
|
|
129
133
|
/>
|
|
130
134
|
) }
|
|
131
135
|
</ItemGroup>
|