@wordpress/edit-site 5.9.0 → 5.11.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-generic-template-modal.js → add-custom-generic-template-modal-content.js} +7 -22
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +32 -27
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- 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 +104 -68
- 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 +1 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +6 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +20 -11
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +27 -6
- package/build/components/editor-canvas-container/index.js.map +1 -1
- 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/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/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 +235 -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 +141 -0
- package/build/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +130 -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 +121 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build/components/global-styles/screen-root.js +6 -6
- 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 +9 -18
- 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 +70 -117
- 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/document-actions/index.js +28 -103
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +15 -2
- 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/hooks.js +54 -0
- package/build/components/layout/hooks.js.map +1 -0
- package/build/components/layout/index.js +57 -104
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/index.js +5 -2
- package/build/components/list/actions/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 +1 -1
- 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/resizable-frame/index.js +242 -0
- package/build/components/resizable-frame/index.js.map +1 -0
- package/build/components/revisions/index.js +96 -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 +6 -10
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +19 -5
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
- 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} +2 -2
- 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-global-styles/index.js +75 -11
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +31 -23
- 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-menu/index.js +162 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +55 -93
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +87 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -71
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +53 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- 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 +39 -12
- 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 +34 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +12 -16
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +93 -19
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
- 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/use-edited-entity-record/index.js +8 -4
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +105 -0
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
- 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/actions.js +5 -3
- package/build/store/actions.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-generic-template-modal.js → add-custom-generic-template-modal-content.js} +8 -20
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +34 -28
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- 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 +102 -68
- 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 +1 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +7 -8
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +18 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +27 -8
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- 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/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/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 +229 -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 +121 -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 +118 -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 +107 -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 +6 -6
- 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 +10 -18
- 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 +71 -115
- 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/document-actions/index.js +31 -107
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +16 -4
- 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/hooks.js +41 -0
- package/build-module/components/layout/hooks.js.map +1 -0
- package/build-module/components/layout/index.js +53 -102
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +6 -3
- package/build-module/components/list/actions/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 +1 -1
- 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/resizable-frame/index.js +228 -0
- package/build-module/components/resizable-frame/index.js.map +1 -0
- package/build-module/components/revisions/index.js +78 -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 +6 -11
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +14 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
- 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} +2 -2
- 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-global-styles/index.js +70 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +30 -24
- 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-menu/index.js +141 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +52 -93
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +71 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +13 -72
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +40 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- 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 +38 -12
- 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 +32 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +13 -17
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +93 -20
- 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 +5 -1
- 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/use-edited-entity-record/index.js +8 -4
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +86 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
- 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/actions.js +5 -3
- package/build-module/store/actions.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 +409 -265
- package/build-style/style.css +410 -265
- package/package.json +37 -35
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
- package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +44 -34
- package/src/components/add-new-template/new-template-part.js +4 -1
- package/src/components/add-new-template/new-template.js +142 -154
- package/src/components/add-new-template/style.scss +120 -103
- 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 +2 -3
- package/src/components/block-editor/style.scss +15 -8
- package/src/components/create-template-part-modal/index.js +19 -25
- package/src/components/editor/index.js +20 -8
- package/src/components/editor/style.scss +21 -6
- package/src/components/editor-canvas-container/index.js +43 -21
- package/src/components/global-styles/block-preview-panel.js +1 -1
- 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/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 +255 -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 +169 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +139 -0
- package/src/components/global-styles/screen-revisions/style.scss +100 -0
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +138 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +99 -0
- package/src/components/global-styles/screen-root.js +7 -5
- 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 +17 -28
- package/src/components/global-styles/style.scss +4 -23
- package/src/components/global-styles/typography-panel.js +12 -13
- package/src/components/global-styles/ui.js +83 -110
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/document-actions/index.js +26 -129
- package/src/components/header-edit-mode/document-actions/style.scss +28 -59
- package/src/components/header-edit-mode/index.js +23 -2
- package/src/components/header-edit-mode/style.scss +1 -0
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/hooks.js +46 -0
- package/src/components/layout/index.js +60 -125
- package/src/components/layout/style.scss +9 -5
- package/src/components/list/actions/index.js +12 -5
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +5 -0
- package/src/components/list/table.js +3 -1
- package/src/components/plugin-template-setting-panel/index.js +33 -0
- package/src/components/resizable-frame/index.js +253 -0
- package/src/components/resizable-frame/style.scss +69 -0
- package/src/components/revisions/index.js +105 -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 +4 -7
- package/src/components/sidebar/index.js +15 -4
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +9 -7
- 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-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -2
- package/src/components/sidebar-navigation-item/index.js +13 -14
- package/src/components/sidebar-navigation-item/style.scss +17 -1
- package/src/components/sidebar-navigation-screen/index.js +26 -5
- package/src/components/sidebar-navigation-screen/style.scss +1 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +106 -21
- package/src/components/sidebar-navigation-screen-main/index.js +39 -35
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -105
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +8 -74
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +6 -20
- 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 +57 -14
- 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 +88 -58
- package/src/components/site-hub/style.scss +8 -0
- package/src/components/start-template-options/index.js +19 -27
- package/src/components/start-template-options/style.scss +28 -21
- package/src/components/style-book/index.js +132 -43
- package/src/components/style-book/style.scss +19 -0
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- 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/use-edited-entity-record/index.js +12 -3
- package/src/hooks/commands/use-edit-mode-commands.js +79 -0
- package/src/hooks/template-part-edit.js +4 -1
- package/src/index.js +1 -0
- package/src/store/actions.js +4 -5
- package/src/store/test/actions.js +6 -14
- package/src/store/test/utils.js +15 -5
- package/src/style.scss +5 -2
- package/src/utils/is-previewing-theme.js +18 -0
- package/src/utils/use-activate-theme.js +38 -0
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build/components/global-styles/border-panel.js +0 -133
- package/build/components/global-styles/border-panel.js.map +0 -1
- 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 -50
- 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/navigate-to-link/index.js +0 -51
- package/build/components/navigate-to-link/index.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/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build/components/template-details/edit-template-title.js +0 -42
- package/build/components/template-details/edit-template-title.js.map +0 -1
- package/build/components/template-details/index.js +0 -103
- package/build/components/template-details/index.js.map +0 -1
- package/build/components/template-details/template-areas.js +0 -160
- package/build/components/template-details/template-areas.js.map +0 -1
- package/build/components/template-details/template-part-area-selector.js +0 -48
- package/build/components/template-details/template-part-area-selector.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 -126
- package/build/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build/hooks/commands/use-wp-admin-commands.js +0 -97
- 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/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build-module/components/global-styles/border-panel.js +0 -123
- package/build-module/components/global-styles/border-panel.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 -40
- 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/navigate-to-link/index.js +0 -39
- package/build-module/components/navigate-to-link/index.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/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build-module/components/template-details/edit-template-title.js +0 -33
- package/build-module/components/template-details/edit-template-title.js.map +0 -1
- package/build-module/components/template-details/index.js +0 -83
- package/build-module/components/template-details/index.js.map +0 -1
- package/build-module/components/template-details/template-areas.js +0 -141
- package/build-module/components/template-details/template-areas.js.map +0 -1
- package/build-module/components/template-details/template-part-area-selector.js +0 -36
- package/build-module/components/template-details/template-part-area-selector.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 -109
- package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build-module/hooks/commands/use-wp-admin-commands.js +0 -81
- 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/add-new-template/add-custom-generic-template-modal.js +0 -101
- package/src/components/global-styles/border-panel.js +0 -112
- 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 -39
- 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/navigate-to-link/index.js +0 -46
- package/src/components/routes/index.js +0 -53
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
- package/src/components/template-details/edit-template-title.js +0 -41
- package/src/components/template-details/index.js +0 -113
- package/src/components/template-details/style.scss +0 -72
- package/src/components/template-details/template-areas.js +0 -164
- package/src/components/template-details/template-part-area-selector.js +0 -39
- package/src/hooks/commands/index.js +0 -10
- package/src/hooks/commands/use-navigation-commands.js +0 -112
- package/src/hooks/commands/use-wp-admin-commands.js +0 -79
- package/src/utils/history.js +0 -39
|
@@ -19,7 +19,10 @@ import { NavigableRegion } from '@wordpress/interface';
|
|
|
19
19
|
|
|
20
20
|
import { store as editSiteStore } from '../../store';
|
|
21
21
|
import { unlock } from '../../private-apis';
|
|
22
|
+
import { useActivateTheme } from '../../utils/use-activate-theme';
|
|
22
23
|
export default function SavePanel() {
|
|
24
|
+
var _window;
|
|
25
|
+
|
|
23
26
|
const {
|
|
24
27
|
isSaveViewOpen,
|
|
25
28
|
canvasMode
|
|
@@ -38,28 +41,37 @@ export default function SavePanel() {
|
|
|
38
41
|
const {
|
|
39
42
|
setIsSaveViewOpened
|
|
40
43
|
} = useDispatch(editSiteStore);
|
|
44
|
+
const activateTheme = useActivateTheme();
|
|
41
45
|
|
|
42
46
|
const onClose = () => setIsSaveViewOpened(false);
|
|
43
47
|
|
|
48
|
+
const onSave = async values => {
|
|
49
|
+
await activateTheme();
|
|
50
|
+
return values;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const entitySavedStates = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableThemePreviews ? createElement(EntitiesSavedStates, {
|
|
54
|
+
close: onClose,
|
|
55
|
+
onSave: onSave
|
|
56
|
+
}) : createElement(EntitiesSavedStates, {
|
|
57
|
+
close: onClose
|
|
58
|
+
});
|
|
59
|
+
|
|
44
60
|
if (canvasMode === 'view') {
|
|
45
61
|
return isSaveViewOpen ? createElement(Modal, {
|
|
46
62
|
className: "edit-site-save-panel__modal",
|
|
47
63
|
onRequestClose: onClose,
|
|
48
64
|
__experimentalHideHeader: true,
|
|
49
65
|
contentLabel: __('Save site, content, and template changes')
|
|
50
|
-
},
|
|
51
|
-
close: onClose
|
|
52
|
-
})) : null;
|
|
66
|
+
}, entitySavedStates) : null;
|
|
53
67
|
}
|
|
54
68
|
|
|
55
69
|
return createElement(NavigableRegion, {
|
|
56
70
|
className: classnames('edit-site-layout__actions', {
|
|
57
71
|
'is-entity-save-view-open': isSaveViewOpen
|
|
58
72
|
}),
|
|
59
|
-
ariaLabel: __('Save
|
|
60
|
-
}, isSaveViewOpen ? createElement(
|
|
61
|
-
close: onClose
|
|
62
|
-
}) : createElement("div", {
|
|
73
|
+
ariaLabel: __('Save panel')
|
|
74
|
+
}, isSaveViewOpen ? entitySavedStates : createElement("div", {
|
|
63
75
|
className: "edit-site-editor__toggle-save-panel"
|
|
64
76
|
}, createElement(Button, {
|
|
65
77
|
variant: "secondary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["classnames","Button","Modal","EntitiesSavedStates","useDispatch","useSelect","__","NavigableRegion","store","editSiteStore","unlock","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,sBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,eAAe,SAASC,SAAT,GAAqB;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["classnames","Button","Modal","EntitiesSavedStates","useDispatch","useSelect","__","NavigableRegion","store","editSiteStore","unlock","useActivateTheme","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","activateTheme","onClose","onSave","values","entitySavedStates","window","__experimentalEnableThemePreviews"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,sBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,gBAAT,QAAiC,gCAAjC;AAEA,eAAe,SAASC,SAAT,GAAqB;AAAA;;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAiCT,SAAS,CAAIU,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAsCP,MAAM,CACjDK,MAAM,CAAEN,aAAF,CAD2C,CAAlD,CAD+D,CAK/D;AACA;;AACA,WAAO;AACNI,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,UAAU,EAAEG,aAAa;AAFnB,KAAP;AAIA,GAX+C,EAW7C,EAX6C,CAAhD;AAYA,QAAM;AAAEC,IAAAA;AAAF,MAA0Bd,WAAW,CAAEK,aAAF,CAA3C;AACA,QAAMU,aAAa,GAAGR,gBAAgB,EAAtC;;AACA,QAAMS,OAAO,GAAG,MAAMF,mBAAmB,CAAE,KAAF,CAAzC;;AACA,QAAMG,MAAM,GAAG,MAAQC,MAAR,IAAoB;AAClC,UAAMH,aAAa,EAAnB;AACA,WAAOG,MAAP;AACA,GAHD;;AAKA,QAAMC,iBAAiB,GAAG,WAAAC,MAAM,UAAN,kCAAQC,iCAAR,GACzB,cAAC,mBAAD;AAAqB,IAAA,KAAK,EAAGL,OAA7B;AAAuC,IAAA,MAAM,EAAGC;AAAhD,IADyB,GAGzB,cAAC,mBAAD;AAAqB,IAAA,KAAK,EAAGD;AAA7B,IAHD;;AAMA,MAAKN,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,cAAC,KAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGO,OAFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAGd,EAAE,CAChB,0CADgB;AAJlB,OAQGiB,iBARH,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAGvB,UAAU,CAAE,2BAAF,EAA+B;AACpD,kCAA4Ba;AADwB,KAA/B,CADvB;AAIC,IAAA,SAAS,EAAGP,EAAE,CAAE,YAAF;AAJf,KAMGO,cAAc,GACfU,iBADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAML,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMGZ,EAAE,CAAE,iBAAF,CANL,CADD,CATF,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport { EntitiesSavedStates } from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst activateTheme = useActivateTheme();\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\tconst entitySavedStates = window?.__experimentalEnableThemePreviews ? (\n\t\t<EntitiesSavedStates close={ onClose } onSave={ onSave } />\n\t) : (\n\t\t<EntitiesSavedStates close={ onClose } />\n\t);\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ entitySavedStates }\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\tentitySavedStates\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
7
|
import { Button } from '@wordpress/components';
|
|
8
|
-
import { useFocusOnMount, useFocusReturn,
|
|
8
|
+
import { useFocusOnMount, useFocusReturn, useMergeRefs } from '@wordpress/compose';
|
|
9
9
|
import { useDispatch } from '@wordpress/data';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
import { closeSmall } from '@wordpress/icons';
|
|
@@ -16,6 +16,9 @@ import { ESCAPE } from '@wordpress/keycodes';
|
|
|
16
16
|
|
|
17
17
|
import { store as editSiteStore } from '../../store';
|
|
18
18
|
import { unlock } from '../../private-apis';
|
|
19
|
+
const {
|
|
20
|
+
PrivateListView
|
|
21
|
+
} = unlock(blockEditorPrivateApis);
|
|
19
22
|
export default function ListViewSidebar() {
|
|
20
23
|
const {
|
|
21
24
|
setIsListViewOpened
|
|
@@ -30,24 +33,16 @@ export default function ListViewSidebar() {
|
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
const instanceId = useInstanceId(ListViewSidebar);
|
|
34
|
-
const labelId = `edit-site-editor__list-view-panel-label-${instanceId}`;
|
|
35
|
-
const {
|
|
36
|
-
PrivateListView
|
|
37
|
-
} = unlock(blockEditorPrivateApis);
|
|
38
36
|
return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
39
37
|
createElement("div", {
|
|
40
|
-
"aria-labelledby": labelId,
|
|
41
38
|
className: "edit-site-editor__list-view-panel",
|
|
42
39
|
onKeyDown: closeOnEscape
|
|
43
40
|
}, createElement("div", {
|
|
44
41
|
className: "edit-site-editor__list-view-panel-header",
|
|
45
42
|
ref: headerFocusReturnRef
|
|
46
|
-
}, createElement("strong", {
|
|
47
|
-
id: labelId
|
|
48
|
-
}, __('List View')), createElement(Button, {
|
|
43
|
+
}, createElement("strong", null, __('List View')), createElement(Button, {
|
|
49
44
|
icon: closeSmall,
|
|
50
|
-
label: __('Close
|
|
45
|
+
label: __('Close'),
|
|
51
46
|
onClick: () => setIsListViewOpened(false)
|
|
52
47
|
})), createElement("div", {
|
|
53
48
|
className: "edit-site-editor__list-view-panel-content",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["privateApis","blockEditorPrivateApis","Button","useFocusOnMount","useFocusReturn","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["privateApis","blockEditorPrivateApis","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","__","closeSmall","ESCAPE","store","editSiteStore","unlock","PrivateListView","ListViewSidebar","setIsListViewOpened","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAsBD,MAAM,CAAEX,sBAAF,CAAlC;AAEA,eAAe,SAASa,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0BT,WAAW,CAAEK,aAAF,CAA3C;AAEA,QAAMK,eAAe,GAAGb,eAAe,CAAE,cAAF,CAAvC;AACA,QAAMc,oBAAoB,GAAGb,cAAc,EAA3C;AACA,QAAMc,qBAAqB,GAAGd,cAAc,EAA5C;;AACA,WAASe,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBZ,MAAlB,IAA4B,CAAEW,KAAK,CAACE,gBAAzC,EAA4D;AAC3DP,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD;;AAED,SACC;AACA;AACC,MAAA,SAAS,EAAC,mCADX;AAEC,MAAA,SAAS,EAAGI;AAFb,OAIC;AACC,MAAA,SAAS,EAAC,0CADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIC,8BAAUV,EAAE,CAAE,WAAF,CAAZ,CAJD,EAKC,cAAC,MAAD;AACC,MAAA,IAAI,EAAGC,UADR;AAEC,MAAA,KAAK,EAAGD,EAAE,CAAE,OAAF,CAFX;AAGC,MAAA,OAAO,EAAG,MAAMQ,mBAAmB,CAAE,KAAF;AAHpC,MALD,CAJD,EAeC;AACC,MAAA,SAAS,EAAC,2CADX;AAEC,MAAA,GAAG,EAAGV,YAAY,CAAE,CACnBa,qBADmB,EAEnBF,eAFmB,CAAF;AAFnB,OAOC,cAAC,eAAD,OAPD,CAfD;AAFD;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-site-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-header\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t<PrivateListView />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { memo, useRef } from '@wordpress/element';
|
|
7
7
|
import { __experimentalNavigatorProvider as NavigatorProvider, __experimentalNavigatorScreen as NavigatorScreen } from '@wordpress/components';
|
|
8
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
10
11
|
*/
|
|
@@ -14,11 +15,16 @@ import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templ
|
|
|
14
15
|
import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
|
|
15
16
|
import useSyncPathWithURL, { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';
|
|
16
17
|
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
18
|
+
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
17
19
|
import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
|
|
18
20
|
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
19
21
|
import SaveHub from '../save-hub';
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
+
import { unlock } from '../../private-apis';
|
|
23
|
+
import SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';
|
|
24
|
+
import SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';
|
|
25
|
+
const {
|
|
26
|
+
useLocation
|
|
27
|
+
} = unlock(routerPrivateApis);
|
|
22
28
|
|
|
23
29
|
function SidebarScreens() {
|
|
24
30
|
useSyncPathWithURL();
|
|
@@ -27,10 +33,14 @@ function SidebarScreens() {
|
|
|
27
33
|
}, createElement(SidebarNavigationScreenMain, null)), createElement(NavigatorScreen, {
|
|
28
34
|
path: "/navigation"
|
|
29
35
|
}, createElement(SidebarNavigationScreenNavigationMenus, null)), createElement(NavigatorScreen, {
|
|
36
|
+
path: "/navigation/:postType/:postId"
|
|
37
|
+
}, createElement(SidebarNavigationScreenNavigationMenu, null)), createElement(NavigatorScreen, {
|
|
30
38
|
path: "/wp_global_styles"
|
|
31
39
|
}, createElement(SidebarNavigationScreenGlobalStyles, null)), createElement(NavigatorScreen, {
|
|
32
|
-
path: "/
|
|
33
|
-
}, createElement(
|
|
40
|
+
path: "/page"
|
|
41
|
+
}, createElement(SidebarNavigationScreenPages, null)), createElement(NavigatorScreen, {
|
|
42
|
+
path: "/page/:postId"
|
|
43
|
+
}, createElement(SidebarNavigationScreenPage, null)), createElement(NavigatorScreen, {
|
|
34
44
|
path: "/:postType(wp_template|wp_template_part)"
|
|
35
45
|
}, createElement(SidebarNavigationScreenTemplates, null)), createElement(NavigatorScreen, {
|
|
36
46
|
path: "/:postType(wp_template|wp_template_part)/all"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPage","useLocation","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,MAAf,QAA6B,oBAA7B;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,wCAA7C;AACA,OAAOC,+BAAP,MAA4C,uCAA5C;AACA,OAAOC,kBAAP,IACCC,cADD,QAEO,+CAFP;AAGA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,qCAAP,MAAkD,8CAAlD;AACA,OAAOC,mCAAP,MAAgD,4CAAhD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,4BAAP,MAAyC,oCAAzC;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBH,MAAM,CAAEX,iBAAF,CAA9B;;AAEA,SAASe,cAAT,GAA0B;AACzBX,EAAAA,kBAAkB;AAElB,SACC,8BACC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,2BAAD,OADD,CADD,EAIC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,sCAAD,OADD,CAJD,EAOC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,qCAAD,OADD,CAPD,EAUC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,mCAAD,OADD,CAVD,EAaC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,4BAAD,OADD,CAbD,EAgBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,2BAAD,OADD,CAhBD,EAmBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,gCAAD,OADD,CAnBD,EAsBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,sCAAD,OADD,CAtBD,EAyBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,+BAAD,OADD,CAzBD,CADD;AA+BA;;AAED,SAASY,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwBJ,WAAW,EAAzC;AACA,QAAMK,WAAW,GAAGzB,MAAM,CAAEW,cAAc,CAAEa,SAAF,CAAhB,CAA1B;AAEA,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,cAAC,cAAD,OAJD,CADD,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,OAAD,OADD,CAPD,CADD;AAaA;;AAED,eAAe3B,IAAI,CAAEuB,OAAF,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../private-apis';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<div className=\"edit-site-sidebar__footer\">\n\t\t\t\t<SaveHub />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
|
|
@@ -26,12 +26,18 @@ export default function GlobalStylesSidebar() {
|
|
|
26
26
|
const {
|
|
27
27
|
getActiveComplementaryArea
|
|
28
28
|
} = select(interfaceStore);
|
|
29
|
+
const {
|
|
30
|
+
getEditorCanvasContainerView,
|
|
31
|
+
getCanvasMode
|
|
32
|
+
} = unlock(select(editSiteStore));
|
|
29
33
|
|
|
30
34
|
const _isVisualEditorMode = 'visual' === select(editSiteStore).getEditorMode();
|
|
31
35
|
|
|
36
|
+
const _isEditCanvasMode = 'edit' === getCanvasMode();
|
|
37
|
+
|
|
32
38
|
return {
|
|
33
|
-
isStyleBookOpened: 'style-book' ===
|
|
34
|
-
shouldClearCanvasContainerView: 'edit-site/global-styles' !== getActiveComplementaryArea('core/edit-site') || !_isVisualEditorMode
|
|
39
|
+
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
|
40
|
+
shouldClearCanvasContainerView: 'edit-site/global-styles' !== getActiveComplementaryArea('core/edit-site') || !_isVisualEditorMode || !_isEditCanvasMode
|
|
35
41
|
};
|
|
36
42
|
}, []);
|
|
37
43
|
const {
|
|
@@ -47,7 +53,7 @@ export default function GlobalStylesSidebar() {
|
|
|
47
53
|
identifier: "edit-site/global-styles",
|
|
48
54
|
title: __('Styles'),
|
|
49
55
|
icon: styles,
|
|
50
|
-
closeLabel: __('Close Styles
|
|
56
|
+
closeLabel: __('Close Styles'),
|
|
51
57
|
panelClassName: "edit-site-global-styles-sidebar__panel",
|
|
52
58
|
header: createElement(Flex, {
|
|
53
59
|
className: "edit-site-global-styles-sidebar__header"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["FlexItem","FlexBlock","Flex","Button","__","styles","seen","useSelect","useDispatch","useEffect","store","interfaceStore","DefaultSidebar","GlobalStylesUI","editSiteStore","GlobalStylesMenuSlot","unlock","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","select","getActiveComplementaryArea","_isVisualEditorMode","getEditorMode","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["FlexItem","FlexBlock","Flex","Button","__","styles","seen","useSelect","useDispatch","useEffect","store","interfaceStore","DefaultSidebar","GlobalStylesUI","editSiteStore","GlobalStylesMenuSlot","unlock","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","setEditorCanvasContainerView","undefined","minWidth"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,EAA8BC,IAA9B,EAAoCC,MAApC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,IAAjB,QAA6B,kBAA7B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,SAASC,cAAT,QAA+B,kBAA/B;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,aAAvC;AACA,SAASC,oBAAT,QAAqC,qBAArC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,QAAM;AAAEC,IAAAA,8BAAF;AAAkCC,IAAAA;AAAlC,MAAwDZ,SAAS,CACpEa,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAiCD,MAAM,CAAET,cAAF,CAA7C;AACA,UAAM;AAAEW,MAAAA,4BAAF;AAAgCC,MAAAA;AAAhC,QAAkDP,MAAM,CAC7DI,MAAM,CAAEN,aAAF,CADuD,CAA9D;;AAGA,UAAMU,mBAAmB,GACxB,aAAaJ,MAAM,CAAEN,aAAF,CAAN,CAAwBW,aAAxB,EADd;;AAEA,UAAMC,iBAAiB,GAAG,WAAWH,aAAa,EAAlD;;AAEA,WAAO;AACNJ,MAAAA,iBAAiB,EAChB,iBAAiBG,4BAA4B,EAFxC;AAGNJ,MAAAA,8BAA8B,EAC7B,8BACCG,0BAA0B,CAAE,gBAAF,CAD3B,IAEA,CAAEG,mBAFF,IAGA,CAAEE;AAPG,KAAP;AASA,GAnBqE,EAoBtE,EApBsE,CAAvE;AAsBA,QAAM;AAAEC,IAAAA;AAAF,MAAmCX,MAAM,CAC9CR,WAAW,CAAEM,aAAF,CADmC,CAA/C;AAIAL,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKS,8BAAL,EAAsC;AACrCS,MAAAA,4BAA4B,CAAEC,SAAF,CAA5B;AACA;AACD,GAJQ,EAIN,CAAEV,8BAAF,CAJM,CAAT;AAMA,SACC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAGd,EAAE,CAAE,QAAF,CAHX;AAIC,IAAA,IAAI,EAAGC,MAJR;AAKC,IAAA,UAAU,EAAGD,EAAE,CAAE,cAAF,CALhB;AAMC,IAAA,cAAc,EAAC,wCANhB;AAOC,IAAA,MAAM,EACL,cAAC,IAAD;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,cAAC,SAAD;AAAW,MAAA,KAAK,EAAG;AAAEyB,QAAAA,QAAQ,EAAE;AAAZ;AAAnB,OACC,8BAAUzB,EAAE,CAAE,QAAF,CAAZ,CADD,CADD,EAIC,cAAC,QAAD,QACC,cAAC,MAAD;AACC,MAAA,IAAI,EAAGE,IADR;AAEC,MAAA,KAAK,EAAGF,EAAE,CAAE,YAAF,CAFX;AAGC,MAAA,SAAS,EAAGe,iBAHb;AAIC,MAAA,QAAQ,EAAGD,8BAJZ;AAKC,MAAA,OAAO,EAAG,MACTS,4BAA4B,CAC3BR,iBAAiB,GAAGS,SAAH,GAAe,YADL;AAN9B,MADD,CAJD,EAiBC,cAAC,QAAD,QACC,cAAC,oBAAD,OADD,CAjBD;AARF,KA+BC,cAAC,cAAD,OA/BD,CADD;AAmCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexItem, FlexBlock, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../private-apis';\n\nexport default function GlobalStylesSidebar() {\n\tconst { shouldClearCanvasContainerView, isStyleBookOpened } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst _isVisualEditorMode =\n\t\t\t\t'visual' === select( editSiteStore ).getEditorMode();\n\t\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\n\t\t\treturn {\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\t\tgetActiveComplementaryArea( 'core/edit-site' ) ||\n\t\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t\t! _isEditCanvasMode,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex className=\"edit-site-global-styles-sidebar__header\">\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { createSlotFill, PanelBody } from '@wordpress/components';
|
|
6
|
+
import { createSlotFill, PanelBody, PanelRow } from '@wordpress/components';
|
|
7
7
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
8
8
|
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
9
|
-
import { useEffect
|
|
9
|
+
import { useEffect } from '@wordpress/element';
|
|
10
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
11
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
12
12
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -18,7 +18,9 @@ import DefaultSidebar from './default-sidebar';
|
|
|
18
18
|
import GlobalStylesSidebar from './global-styles-sidebar';
|
|
19
19
|
import { STORE_NAME } from '../../store/constants';
|
|
20
20
|
import SettingsHeader from './settings-header';
|
|
21
|
+
import LastRevision from './template-revisions';
|
|
21
22
|
import TemplateCard from './template-card';
|
|
23
|
+
import PluginTemplateSettingPanel from '../plugin-template-setting-panel';
|
|
22
24
|
import { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';
|
|
23
25
|
import { store as editSiteStore } from '../../store';
|
|
24
26
|
const {
|
|
@@ -67,12 +69,15 @@ export function SidebarComplementaryAreaFills() {
|
|
|
67
69
|
identifier: sidebarName,
|
|
68
70
|
title: __('Settings'),
|
|
69
71
|
icon: isRTL() ? drawerLeft : drawerRight,
|
|
70
|
-
closeLabel: __('Close
|
|
72
|
+
closeLabel: __('Close Settings'),
|
|
71
73
|
header: createElement(SettingsHeader, {
|
|
72
74
|
sidebarName: sidebarName
|
|
73
75
|
}),
|
|
74
76
|
headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
|
|
75
|
-
}, sidebarName === SIDEBAR_TEMPLATE && createElement(PanelBody, null, createElement(TemplateCard, null)
|
|
77
|
+
}, sidebarName === SIDEBAR_TEMPLATE && createElement(Fragment, null, createElement(PanelBody, null, createElement(TemplateCard, null), createElement(PanelRow, {
|
|
78
|
+
header: __('Editing history'),
|
|
79
|
+
className: "edit-site-template-revisions"
|
|
80
|
+
}, createElement(LastRevision, null))), createElement(PluginTemplateSettingPanel.Slot, null)), sidebarName === SIDEBAR_BLOCK && createElement(InspectorSlot, {
|
|
76
81
|
bubblesVirtually: true
|
|
77
82
|
})), supportsGlobalStyles && createElement(GlobalStylesSidebar, null));
|
|
78
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["createSlotFill","PanelBody","isRTL","__","drawerLeft","drawerRight","useEffect","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["createSlotFill","PanelBody","PanelRow","isRTL","__","drawerLeft","drawerRight","useEffect","useSelect","useDispatch","store","interfaceStore","blockEditorStore","DefaultSidebar","GlobalStylesSidebar","STORE_NAME","SettingsHeader","LastRevision","TemplateCard","PluginTemplateSettingPanel","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","editSiteStore","Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","select","_sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","settings","getSettings","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,EAAoCC,QAApC,QAAoD,uBAApD;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,kBAAxC;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,UAAT,QAA2B,uBAA3B;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,YAAP,MAAyB,sBAAzB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,0BAAP,MAAuC,kCAAvC;AACA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,aAAhD;AACA,SAASX,KAAK,IAAIY,aAAlB,QAAuC,aAAvC;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IAA+C1B,cAAc,CAClE,0BADkE,CAAnE;AAGA,OAAO,MAAM2B,oBAAoB,GAAGD,aAA7B;AAEP,OAAO,SAASE,6BAAT,GAAyC;AAC/C,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,qBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA;AAJK,MAKFxB,SAAS,CAAIyB,MAAF,IAAc;AAC5B,UAAMC,QAAQ,GACbD,MAAM,CAAEtB,cAAF,CAAN,CAAyBwB,0BAAzB,CAAqDpB,UAArD,CADD;;AAEA,UAAMqB,sBAAsB,GAAG,CAC9BhB,aAD8B,EAE9BC,gBAF8B,EAG7BgB,QAH6B,CAGnBH,QAHmB,CAA/B;;AAIA,UAAMI,QAAQ,GAAGL,MAAM,CAAEX,aAAF,CAAN,CAAwBiB,WAAxB,EAAjB;AACA,WAAO;AACNV,MAAAA,OAAO,EAAEK,QADH;AAENJ,MAAAA,qBAAqB,EAAEM,sBAFjB;AAGNL,MAAAA,iBAAiB,EAChB,CAAC,CAAEE,MAAM,CAAErB,gBAAF,CAAN,CAA2B4B,sBAA3B,EAJE;AAKNR,MAAAA,oBAAoB,EAAE,EAAEM,QAAF,aAAEA,QAAF,eAAEA,QAAQ,CAAEG,yBAAZ;AALhB,KAAP;AAOA,GAfY,EAeV,EAfU,CALb;AAqBA,QAAM;AAAEC,IAAAA;AAAF,MAA8BjC,WAAW,CAAEE,cAAF,CAA/C;AAEAJ,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAK,CAAEuB,qBAAP,EAA+B;;AAC/B,QAAKC,iBAAL,EAAyB;AACxBW,MAAAA,uBAAuB,CAAE3B,UAAF,EAAcK,aAAd,CAAvB;AACA,KAFD,MAEO;AACNsB,MAAAA,uBAAuB,CAAE3B,UAAF,EAAcM,gBAAd,CAAvB;AACA;AACD,GAPQ,EAON,CAAEU,iBAAF,EAAqBD,qBAArB,CAPM,CAAT;AASA,MAAIa,WAAW,GAAGd,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9Ba,IAAAA,WAAW,GAAGZ,iBAAiB,GAAGX,aAAH,GAAmBC,gBAAlD;AACA;;AAED,SACC,8BACC,cAAC,cAAD;AACC,IAAA,UAAU,EAAGsB,WADd;AAEC,IAAA,KAAK,EAAGvC,EAAE,CAAE,UAAF,CAFX;AAGC,IAAA,IAAI,EAAGD,KAAK,KAAKE,UAAL,GAAkBC,WAH/B;AAIC,IAAA,UAAU,EAAGF,EAAE,CAAE,gBAAF,CAJhB;AAKC,IAAA,MAAM,EAAG,cAAC,cAAD;AAAgB,MAAA,WAAW,EAAGuC;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKtB,gBAAhB,IACD,8BACC,cAAC,SAAD,QACC,cAAC,YAAD,OADD,EAEC,cAAC,QAAD;AACC,IAAA,MAAM,EAAGjB,EAAE,CAAE,iBAAF,CADZ;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,cAAC,YAAD,OAJD,CAFD,CADD,EAUC,cAAC,0BAAD,CAA4B,IAA5B,OAVD,CATF,EAsBGuC,WAAW,KAAKvB,aAAhB,IACD,cAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAvBF,CADD,EA2BGY,oBAAoB,IAAI,cAAC,mBAAD,OA3B3B,CADD;AA+BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody, PanelRow } from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport LastRevision from './template-revisions';\nimport TemplateCard from './template-card';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\nimport { store as editSiteStore } from '../../store';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst {\n\t\tsidebar,\n\t\tisEditorSidebarOpened,\n\t\thasBlockSelection,\n\t\tsupportsGlobalStyles,\n\t} = useSelect( ( select ) => {\n\t\tconst _sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( STORE_NAME );\n\t\tconst _isEditorSidebarOpened = [\n\t\t\tSIDEBAR_BLOCK,\n\t\t\tSIDEBAR_TEMPLATE,\n\t\t].includes( _sidebar );\n\t\tconst settings = select( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tsidebar: _sidebar,\n\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tsupportsGlobalStyles: ! settings?.supportsTemplatePartsMode,\n\t\t};\n\t}, [] );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) return;\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t\t\t<PanelRow\n\t\t\t\t\t\t\t\theader={ __( 'Editing history' ) }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-template-revisions\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<LastRevision />\n\t\t\t\t\t\t\t</PanelRow>\n\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { unlock } from '../../private-apis';
|
|
12
|
+
const {
|
|
13
|
+
createPrivateSlotFill
|
|
14
|
+
} = unlock(componentsPrivateApis);
|
|
15
|
+
const SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME = 'SidebarFixedBottom';
|
|
16
|
+
const {
|
|
17
|
+
Slot: SidebarFixedBottomSlot,
|
|
18
|
+
Fill: SidebarFixedBottomFill
|
|
19
|
+
} = createPrivateSlotFill(SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME);
|
|
20
|
+
export default function SidebarFixedBottom(_ref) {
|
|
21
|
+
let {
|
|
22
|
+
children
|
|
23
|
+
} = _ref;
|
|
24
|
+
return createElement(SidebarFixedBottomFill, null, createElement("div", {
|
|
25
|
+
className: "edit-site-sidebar-fixed-bottom-slot"
|
|
26
|
+
}, children));
|
|
27
|
+
}
|
|
28
|
+
export { SidebarFixedBottomSlot };
|
|
29
|
+
//# sourceMappingURL=sidebar-fixed-bottom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js"],"names":["privateApis","componentsPrivateApis","unlock","createPrivateSlotFill","SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME","Slot","SidebarFixedBottomSlot","Fill","SidebarFixedBottomFill","SidebarFixedBottom","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAxB,QAAqD,uBAArD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA4BD,MAAM,CAAED,qBAAF,CAAxC;AACA,MAAMG,mCAAmC,GAAG,oBAA5C;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,sBAAR;AAAgCC,EAAAA,IAAI,EAAEC;AAAtC,IACLL,qBAAqB,CAAEC,mCAAF,CADtB;AAGA,eAAe,SAASK,kBAAT,OAA4C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AAC1D,SACC,cAAC,sBAAD,QACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,QADH,CADD,CADD;AAOA;AAED,SAASJ,sBAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME = 'SidebarFixedBottom';\nconst { Slot: SidebarFixedBottomSlot, Fill: SidebarFixedBottomFill } =\n\tcreatePrivateSlotFill( SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME );\n\nexport default function SidebarFixedBottom( { children } ) {\n\treturn (\n\t\t<SidebarFixedBottomFill>\n\t\t\t<div className=\"edit-site-sidebar-fixed-bottom-slot\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</SidebarFixedBottomFill>\n\t);\n}\n\nexport { SidebarFixedBottomSlot };\n"]}
|
|
@@ -3,9 +3,8 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
6
|
import { useSelect } from '@wordpress/data';
|
|
8
|
-
import {
|
|
7
|
+
import { Icon } from '@wordpress/components';
|
|
9
8
|
import { store as editorStore } from '@wordpress/editor';
|
|
10
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
10
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -16,7 +15,6 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
16
15
|
import { store as editSiteStore } from '../../../store';
|
|
17
16
|
import TemplateActions from './template-actions';
|
|
18
17
|
import TemplateAreas from './template-areas';
|
|
19
|
-
import LastRevision from './last-revision';
|
|
20
18
|
export default function TemplateCard() {
|
|
21
19
|
const {
|
|
22
20
|
info: {
|
|
@@ -65,9 +63,6 @@ export default function TemplateCard() {
|
|
|
65
63
|
template: template
|
|
66
64
|
})), createElement("div", {
|
|
67
65
|
className: "edit-site-template-card__description"
|
|
68
|
-
}, decodeEntities(description)), createElement(TemplateAreas, null)))
|
|
69
|
-
header: __('Editing history'),
|
|
70
|
-
className: "edit-site-template-revisions"
|
|
71
|
-
}, createElement(LastRevision, null)));
|
|
66
|
+
}, decodeEntities(description)), createElement(TemplateAreas, null))));
|
|
72
67
|
}
|
|
73
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-card/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-card/index.js"],"names":["useSelect","Icon","store","editorStore","coreStore","decodeEntities","editSiteStore","TemplateActions","TemplateAreas","TemplateCard","info","title","description","icon","template","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","__experimentalGetTemplateInfo","getTemplateInfo","postType","postId","record"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,gBAAvC;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AAEA,eAAe,SAASC,YAAT,GAAwB;AACtC,QAAM;AACLC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,WAAT;AAAsBC,MAAAA;AAAtB,KADD;AAELC,IAAAA;AAFK,MAGFd,SAAS,CAAIe,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA,iBAAF;AAAqBC,MAAAA;AAArB,QAAyCF,MAAM,CAAET,aAAF,CAArD;AACA,UAAM;AAAEY,MAAAA;AAAF,QAA4BH,MAAM,CAAEX,SAAF,CAAxC;AACA,UAAM;AAAEe,MAAAA,6BAA6B,EAAEC;AAAjC,QACLL,MAAM,CAAEZ,WAAF,CADP;AAGA,UAAMkB,QAAQ,GAAGL,iBAAiB,EAAlC;AACA,UAAMM,MAAM,GAAGL,eAAe,EAA9B;AACA,UAAMM,MAAM,GAAGL,qBAAqB,CAAE,UAAF,EAAcG,QAAd,EAAwBC,MAAxB,CAApC;AAEA,UAAMZ,IAAI,GAAGa,MAAM,GAAGH,eAAe,CAAEG,MAAF,CAAlB,GAA+B,EAAlD;AAEA,WAAO;AAAEb,MAAAA,IAAF;AAAQI,MAAAA,QAAQ,EAAES;AAAlB,KAAP;AACA,GAbY,EAaV,EAbU,CAHb;;AAkBA,MAAK,CAAEZ,KAAF,IAAW,CAAEC,WAAlB,EAAgC;AAC/B,WAAO,IAAP;AACA;;AAED,SACC,8BACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,IAAD;AAAM,IAAA,SAAS,EAAC,+BAAhB;AAAgD,IAAA,IAAI,EAAGC;AAAvD,IADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGR,cAAc,CAAEM,KAAF,CADjB,CADD,EAIC,cAAC,eAAD;AAAiB,IAAA,QAAQ,EAAGG;AAA5B,IAJD,CADD,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGT,cAAc,CAAEO,WAAF,CADjB,CAPD,EAUC,cAAC,aAAD,OAVD,CAFD,CADD,CADD;AAmBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport TemplateActions from './template-actions';\nimport TemplateAreas from './template-areas';\n\nexport default function TemplateCard() {\n\tconst {\n\t\tinfo: { title, description, icon },\n\t\ttemplate,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } =\n\t\t\tselect( editorStore );\n\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\t\tconst record = getEditedEntityRecord( 'postType', postType, postId );\n\n\t\tconst info = record ? getTemplateInfo( record ) : {};\n\n\t\treturn { info, template: record };\n\t}, [] );\n\n\tif ( ! title && ! description ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-site-template-card\">\n\t\t\t\t<Icon className=\"edit-site-template-card__icon\" icon={ icon } />\n\t\t\t\t<div className=\"edit-site-template-card__content\">\n\t\t\t\t\t<div className=\"edit-site-template-card__header\">\n\t\t\t\t\t\t<h2 className=\"edit-site-template-card__title\">\n\t\t\t\t\t\t\t{ decodeEntities( title ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<TemplateActions template={ template } />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"edit-site-template-card__description\">\n\t\t\t\t\t\t{ decodeEntities( description ) }\n\t\t\t\t\t</div>\n\t\t\t\t\t<TemplateAreas />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -21,7 +21,7 @@ const useRevisionData = () => {
|
|
|
21
21
|
record: currentTemplate
|
|
22
22
|
} = useEditedEntityRecord();
|
|
23
23
|
const lastRevisionId = (_currentTemplate$_lin = currentTemplate === null || currentTemplate === void 0 ? void 0 : (_currentTemplate$_lin2 = currentTemplate._links) === null || _currentTemplate$_lin2 === void 0 ? void 0 : (_currentTemplate$_lin3 = _currentTemplate$_lin2['predecessor-version']) === null || _currentTemplate$_lin3 === void 0 ? void 0 : (_currentTemplate$_lin4 = _currentTemplate$_lin3[0]) === null || _currentTemplate$_lin4 === void 0 ? void 0 : _currentTemplate$_lin4.id) !== null && _currentTemplate$_lin !== void 0 ? _currentTemplate$_lin : null;
|
|
24
|
-
const revisionsCount = (
|
|
24
|
+
const revisionsCount = (_currentTemplate$_lin5 = currentTemplate === null || currentTemplate === void 0 ? void 0 : (_currentTemplate$_lin6 = currentTemplate._links) === null || _currentTemplate$_lin6 === void 0 ? void 0 : (_currentTemplate$_lin7 = _currentTemplate$_lin6['version-history']) === null || _currentTemplate$_lin7 === void 0 ? void 0 : (_currentTemplate$_lin8 = _currentTemplate$_lin7[0]) === null || _currentTemplate$_lin8 === void 0 ? void 0 : _currentTemplate$_lin8.count) !== null && _currentTemplate$_lin5 !== void 0 ? _currentTemplate$_lin5 : 0;
|
|
25
25
|
return {
|
|
26
26
|
currentTemplate,
|
|
27
27
|
lastRevisionId,
|
|
@@ -67,4 +67,4 @@ const PostLastRevision = () => {
|
|
|
67
67
|
export default function LastRevision() {
|
|
68
68
|
return createElement(PostLastRevisionCheck, null, createElement(PostLastRevision, null));
|
|
69
69
|
}
|
|
70
|
-
//# sourceMappingURL=
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-revisions/index.js"],"names":["Button","sprintf","_n","backup","addQueryArgs","PostTypeSupportCheck","useEditedEntityRecord","useRevisionData","record","currentTemplate","lastRevisionId","_links","id","revisionsCount","count","PostLastRevisionCheck","children","PostLastRevision","revision","gutenberg","LastRevision"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AACA,SAASC,MAAT,QAAuB,kBAAvB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,oBAAT,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,gCAAlC;;AAEA,MAAMC,eAAe,GAAG,MAAM;AAAA;;AAC7B,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAA8BH,qBAAqB,EAAzD;AAEA,QAAMI,cAAc,4BACnBD,eADmB,aACnBA,eADmB,iDACnBA,eAAe,CAAEE,MADE,qFACnB,uBAA2B,qBAA3B,CADmB,qFACnB,uBAAsD,CAAtD,CADmB,2DACnB,uBAA2DC,EADxC,yEAC8C,IADlE;AAGA,QAAMC,cAAc,6BACnBJ,eADmB,aACnBA,eADmB,iDACnBA,eAAe,CAAEE,MADE,qFACnB,uBAA2B,iBAA3B,CADmB,qFACnB,uBAAkD,CAAlD,CADmB,2DACnB,uBAAuDG,KADpC,2EAC6C,CADjE;AAGA,SAAO;AACNL,IAAAA,eADM;AAENC,IAAAA,cAFM;AAGNG,IAAAA;AAHM,GAAP;AAKA,CAdD;;AAgBA,SAASE,qBAAT,OAA+C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AAC9C,QAAM;AAAEN,IAAAA,cAAF;AAAkBG,IAAAA;AAAlB,MAAqCN,eAAe,EAA1D;;AAEA,MAAK,CAAEG,cAAF,IAAoBG,cAAc,GAAG,CAA1C,EAA8C;AAC7C,WAAO,IAAP;AACA;;AAED,SACC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACGG,QADH,CADD;AAKA;;AAED,MAAMC,gBAAgB,GAAG,MAAM;AAC9B,QAAM;AAAEP,IAAAA,cAAF;AAAkBG,IAAAA;AAAlB,MAAqCN,eAAe,EAA1D;AAEA,SACC,cAAC,qBAAD,QACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGH,YAAY,CAAE,cAAF,EAAkB;AACpCc,MAAAA,QAAQ,EAAER,cAD0B;AAEpCS,MAAAA,SAAS,EAAE;AAFyB,KAAlB,CADpB;AAKC,IAAA,SAAS,EAAC,yCALX;AAMC,IAAA,IAAI,EAAGhB;AANR,KAQGF,OAAO;AACR;AACAC,EAAAA,EAAE,CAAE,aAAF,EAAiB,cAAjB,EAAiCW,cAAjC,CAFM,EAGRA,cAHQ,CARV,CADD,CADD;AAkBA,CArBD;;AAuBA,eAAe,SAASO,YAAT,GAAwB;AACtC,SACC,cAAC,qBAAD,QACC,cAAC,gBAAD,OADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { sprintf, _n } from '@wordpress/i18n';\nimport { backup } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\nimport { PostTypeSupportCheck } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\n\nconst useRevisionData = () => {\n\tconst { record: currentTemplate } = useEditedEntityRecord();\n\n\tconst lastRevisionId =\n\t\tcurrentTemplate?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\n\tconst revisionsCount =\n\t\tcurrentTemplate?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\n\treturn {\n\t\tcurrentTemplate,\n\t\tlastRevisionId,\n\t\trevisionsCount,\n\t};\n};\n\nfunction PostLastRevisionCheck( { children } ) {\n\tconst { lastRevisionId, revisionsCount } = useRevisionData();\n\n\tif ( ! lastRevisionId || revisionsCount < 2 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"revisions\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nconst PostLastRevision = () => {\n\tconst { lastRevisionId, revisionsCount } = useRevisionData();\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t\tgutenberg: true,\n\t\t\t\t} ) }\n\t\t\t\tclassName=\"edit-site-template-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: %d: number of revisions */\n\t\t\t\t\t_n( '%d Revision', '%d Revisions', revisionsCount ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t</Button>\n\t\t</PostLastRevisionCheck>\n\t);\n};\n\nexport default function LastRevision() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostLastRevision />\n\t\t</PostLastRevisionCheck>\n\t);\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import classnames from 'classnames';
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { __experimentalItem as Item, __experimentalHStack as HStack, FlexBlock } from '@wordpress/components';
|
|
13
|
-
import {
|
|
13
|
+
import { chevronRightSmall, Icon } from '@wordpress/icons';
|
|
14
14
|
export default function SidebarNavigationItem(_ref) {
|
|
15
15
|
let {
|
|
16
16
|
className,
|
|
@@ -21,20 +21,18 @@ export default function SidebarNavigationItem(_ref) {
|
|
|
21
21
|
} = _ref;
|
|
22
22
|
return createElement(Item, _extends({
|
|
23
23
|
className: classnames('edit-site-sidebar-navigation-item', className)
|
|
24
|
-
}, props),
|
|
24
|
+
}, props), createElement(HStack, {
|
|
25
25
|
justify: "flex-start"
|
|
26
|
-
}, createElement(Icon, {
|
|
26
|
+
}, icon && createElement(Icon, {
|
|
27
27
|
style: {
|
|
28
28
|
fill: 'currentcolor'
|
|
29
29
|
},
|
|
30
30
|
icon: icon,
|
|
31
31
|
size: 24
|
|
32
32
|
}), createElement(FlexBlock, null, children), withChevron && createElement(Icon, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
icon: chevronRight,
|
|
33
|
+
icon: chevronRightSmall,
|
|
34
|
+
className: "edit-site-sidebar-navigation-item__drilldown-indicator",
|
|
37
35
|
size: 24
|
|
38
|
-
}))
|
|
36
|
+
})));
|
|
39
37
|
}
|
|
40
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"names":["classnames","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"names":["classnames","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","chevronRightSmall","Icon","SidebarNavigationItem","className","icon","withChevron","children","props","fill"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,kBAAkB,IAAIC,IADvB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,SAHD,QAIO,uBAJP;AAKA,SAASC,iBAAT,EAA4BC,IAA5B,QAAwC,kBAAxC;AAEA,eAAe,SAASC,qBAAT,OAMX;AAAA,MAN2C;AAC9CC,IAAAA,SAD8C;AAE9CC,IAAAA,IAF8C;AAG9CC,IAAAA,WAAW,GAAG,KAHgC;AAI9CC,IAAAA,QAJ8C;AAK9C,OAAGC;AAL2C,GAM3C;AACH,SACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAGb,UAAU,CACrB,mCADqB,EAErBS,SAFqB;AADvB,KAKMI,KALN,GAOC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACGH,IAAI,IACL,cAAC,IAAD;AACC,IAAA,KAAK,EAAG;AAAEI,MAAAA,IAAI,EAAE;AAAR,KADT;AAEC,IAAA,IAAI,EAAGJ,IAFR;AAGC,IAAA,IAAI,EAAG;AAHR,IAFF,EAQC,cAAC,SAAD,QAAaE,QAAb,CARD,EASGD,WAAW,IACZ,cAAC,IAAD;AACC,IAAA,IAAI,EAAGL,iBADR;AAEC,IAAA,SAAS,EAAC,wDAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAVF,CAPD,CADD;AA2BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { chevronRightSmall, Icon } from '@wordpress/icons';\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tchildren,\n\t...props\n} ) {\n\treturn (\n\t\t<Item\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"]}
|
|
@@ -4,8 +4,9 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalNavigatorToParentButton as NavigatorToParentButton, __experimentalHeading as Heading } from '@wordpress/components';
|
|
7
|
-
import { isRTL, __ } from '@wordpress/i18n';
|
|
7
|
+
import { isRTL, __, sprintf } from '@wordpress/i18n';
|
|
8
8
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
9
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
9
10
|
import { useSelect } from '@wordpress/data';
|
|
10
11
|
/**
|
|
11
12
|
* Internal dependencies
|
|
@@ -14,7 +15,10 @@ import { useSelect } from '@wordpress/data';
|
|
|
14
15
|
import { store as editSiteStore } from '../../store';
|
|
15
16
|
import { unlock } from '../../private-apis';
|
|
16
17
|
import SidebarButton from '../sidebar-button';
|
|
18
|
+
import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
17
19
|
export default function SidebarNavigationScreen(_ref) {
|
|
20
|
+
var _theme$name;
|
|
21
|
+
|
|
18
22
|
let {
|
|
19
23
|
isRoot,
|
|
20
24
|
title,
|
|
@@ -32,6 +36,10 @@ export default function SidebarNavigationScreen(_ref) {
|
|
|
32
36
|
dashboardLink: getSettings().__experimentalDashboardLink
|
|
33
37
|
};
|
|
34
38
|
}, []);
|
|
39
|
+
const {
|
|
40
|
+
getTheme
|
|
41
|
+
} = useSelect(coreStore);
|
|
42
|
+
const theme = getTheme(currentlyPreviewingTheme());
|
|
35
43
|
return createElement(VStack, {
|
|
36
44
|
spacing: 2
|
|
37
45
|
}, createElement(HStack, {
|
|
@@ -41,17 +49,17 @@ export default function SidebarNavigationScreen(_ref) {
|
|
|
41
49
|
}, !isRoot ? createElement(NavigatorToParentButton, {
|
|
42
50
|
as: SidebarButton,
|
|
43
51
|
icon: isRTL() ? chevronRight : chevronLeft,
|
|
44
|
-
|
|
52
|
+
label: __('Back')
|
|
45
53
|
}) : createElement(SidebarButton, {
|
|
46
54
|
icon: isRTL() ? chevronRight : chevronLeft,
|
|
47
|
-
label: __('Go back to the Dashboard'),
|
|
48
|
-
href: dashboardLink || 'index.php'
|
|
55
|
+
label: !isPreviewingTheme() ? __('Go back to the Dashboard') : __('Go back to the theme showcase'),
|
|
56
|
+
href: !isPreviewingTheme() ? dashboardLink || 'index.php' : 'themes.php'
|
|
49
57
|
}), createElement(Heading, {
|
|
50
58
|
className: "edit-site-sidebar-navigation-screen__title",
|
|
51
59
|
color: 'white',
|
|
52
60
|
level: 2,
|
|
53
61
|
size: 20
|
|
54
|
-
}, title), actions), createElement("nav", {
|
|
62
|
+
}, !isPreviewingTheme() ? title : sprintf('Previewing %1$s: %2$s', theme === null || theme === void 0 ? void 0 : (_theme$name = theme.name) === null || _theme$name === void 0 ? void 0 : _theme$name.rendered, title)), actions), createElement("nav", {
|
|
55
63
|
className: "edit-site-sidebar-navigation-screen__content"
|
|
56
64
|
}, description && createElement("p", {
|
|
57
65
|
className: "edit-site-sidebar-navigation-screen__description"
|