@wordpress/edit-site 5.8.0 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-template/add-custom-template-modal.js +21 -6
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +8 -2
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +8 -4
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +8 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +10 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +39 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +7 -7
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/editor/index.js +43 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +131 -0
- package/build/components/editor-canvas-container/index.js.map +1 -0
- package/build/components/global-styles/block-preview-panel.js +1 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +53 -5
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +14 -3
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +17 -18
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +4 -18
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +14 -3
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/root-menu.js +61 -0
- package/build/components/global-styles/root-menu.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +3 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +158 -7
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +9 -26
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -15
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +4 -17
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +148 -0
- package/build/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +132 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +130 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +0 -3
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +11 -39
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +3 -8
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +7 -11
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +66 -120
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +4 -28
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/index.js +11 -7
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +1 -1
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +22 -14
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/index.js +9 -3
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +4 -4
- package/build/components/list/table.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +44 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build/components/revisions/index.js +95 -0
- package/build/components/revisions/index.js.map +1 -0
- package/build/components/routes/link.js +17 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +8 -2
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +31 -6
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +14 -31
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +20 -7
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +2 -7
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +16 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +35 -14
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +9 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +40 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-card/index.js +1 -8
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +5 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +14 -4
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +24 -7
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +17 -5
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +67 -0
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +74 -0
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +5 -3
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-subtitle/index.js +18 -0
- package/build/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build/components/site-hub/index.js +64 -12
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +8 -7
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +21 -24
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +9 -41
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -5
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +9 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +17 -3
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-details/index.js +3 -1
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +9 -3
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/hooks/template-part-edit.js +8 -2
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/store/private-actions.js +19 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +13 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +23 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/is-previewing-theme.js +27 -0
- package/build/utils/is-previewing-theme.js.map +1 -0
- package/build/utils/use-activate-theme.js +46 -0
- package/build/utils/use-activate-theme.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js +21 -6
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +5 -1
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +7 -3
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +6 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +6 -1
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +37 -6
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +6 -6
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +45 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +115 -0
- package/build-module/components/editor-canvas-container/index.js.map +1 -0
- package/build-module/components/global-styles/block-preview-panel.js +1 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +54 -5
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +13 -3
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +17 -18
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +5 -19
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +13 -3
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +47 -0
- package/build-module/components/global-styles/root-menu.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +4 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +151 -7
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +9 -25
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +20 -15
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -16
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +128 -0
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +121 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +116 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +2 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -3
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +11 -37
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +3 -7
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +7 -11
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +66 -118
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +3 -22
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +10 -7
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +1 -1
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +17 -10
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/index.js +5 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +4 -4
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +35 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build-module/components/revisions/index.js +77 -0
- package/build-module/components/revisions/index.js.map +1 -0
- package/build-module/components/routes/link.js +13 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +5 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +28 -6
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +13 -32
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +19 -7
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -8
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +35 -16
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +10 -5
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +29 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-card/index.js +2 -7
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -1
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +6 -8
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +13 -5
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +25 -8
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +13 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +48 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -3
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +10 -0
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +64 -14
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +8 -7
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +22 -25
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +10 -41
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -4
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +13 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-details/index.js +3 -1
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +5 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +5 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/private-actions.js +15 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +11 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +23 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +17 -0
- package/build-module/utils/is-previewing-theme.js.map +1 -0
- package/build-module/utils/use-activate-theme.js +36 -0
- package/build-module/utils/use-activate-theme.js.map +1 -0
- package/build-style/style-rtl.css +310 -137
- package/build-style/style.css +310 -137
- package/package.json +37 -35
- package/src/components/add-new-template/add-custom-template-modal.js +31 -8
- package/src/components/add-new-template/new-template-part.js +4 -1
- package/src/components/add-new-template/new-template.js +6 -1
- package/src/components/add-new-template/style.scss +52 -48
- package/src/components/app/index.js +6 -3
- package/src/components/block-editor/back-button.js +4 -1
- package/src/components/block-editor/editor-canvas.js +36 -8
- package/src/components/block-editor/index.js +8 -8
- package/src/components/block-editor/style.scss +15 -8
- package/src/components/editor/index.js +48 -7
- package/src/components/editor-canvas-container/index.js +128 -0
- package/src/components/editor-canvas-container/style.scss +19 -0
- package/src/components/global-styles/block-preview-panel.js +1 -1
- package/src/components/global-styles/border-panel.js +46 -3
- package/src/components/global-styles/color-palette-panel.js +9 -0
- package/src/components/global-styles/dimensions-panel.js +15 -15
- package/src/components/global-styles/global-styles-provider.js +4 -18
- package/src/components/global-styles/gradients-palette-panel.js +8 -0
- package/src/components/global-styles/root-menu.js +66 -0
- package/src/components/global-styles/screen-block-list.js +2 -2
- package/src/components/global-styles/screen-block.js +184 -7
- package/src/components/global-styles/screen-colors.js +9 -16
- package/src/components/global-styles/screen-css.js +21 -21
- package/src/components/global-styles/screen-layout.js +5 -9
- package/src/components/global-styles/screen-revisions/index.js +177 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +131 -0
- package/src/components/global-styles/screen-revisions/style.scss +99 -0
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +125 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +103 -0
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography-element.js +1 -3
- package/src/components/global-styles/screen-typography.js +44 -79
- package/src/components/global-styles/style-variations-container.js +4 -10
- package/src/components/global-styles/style.scss +1 -23
- package/src/components/global-styles/typography-panel.js +12 -13
- package/src/components/global-styles/ui.js +82 -107
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/index.js +17 -5
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/index.js +16 -19
- package/src/components/layout/style.scss +32 -7
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +4 -0
- package/src/components/list/table.js +19 -3
- package/src/components/plugin-template-setting-panel/index.js +33 -0
- package/src/components/revisions/index.js +104 -0
- package/src/components/routes/link.js +16 -1
- package/src/components/routes/use-title.js +4 -1
- package/src/components/save-button/index.js +27 -6
- package/src/components/save-hub/index.js +17 -35
- package/src/components/save-panel/index.js +15 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +2 -6
- package/src/components/secondary-sidebar/style.scss +23 -5
- package/src/components/sidebar/index.js +12 -1
- package/src/components/sidebar/style.scss +2 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +39 -18
- package/src/components/sidebar-edit-mode/index.js +17 -6
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +26 -0
- package/src/components/sidebar-edit-mode/style.scss +10 -0
- package/src/components/sidebar-edit-mode/template-card/index.js +1 -9
- package/src/components/sidebar-navigation-item/index.js +13 -14
- package/src/components/sidebar-navigation-item/style.scss +8 -1
- package/src/components/sidebar-navigation-screen/index.js +26 -5
- package/src/components/sidebar-navigation-screen-main/index.js +43 -22
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +13 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/src/components/sidebar-navigation-screen-page/index.js +59 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +82 -0
- package/src/components/sidebar-navigation-screen-pages/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +5 -1
- package/src/components/sidebar-navigation-subtitle/index.js +5 -0
- package/src/components/sidebar-navigation-subtitle/style.scss +7 -0
- package/src/components/site-hub/index.js +92 -33
- package/src/components/site-hub/style.scss +8 -0
- package/src/components/site-icon/index.js +6 -11
- package/src/components/site-icon/style.scss +8 -3
- package/src/components/start-template-options/index.js +32 -39
- package/src/components/start-template-options/style.scss +36 -46
- package/src/components/style-book/index.js +7 -51
- package/src/components/style-book/style.scss +0 -18
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -4
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +14 -1
- package/src/components/template-details/index.js +1 -0
- package/src/components/template-details/template-areas.js +4 -1
- package/src/hooks/template-part-edit.js +4 -1
- package/src/index.js +1 -0
- package/src/store/private-actions.js +14 -0
- package/src/store/private-selectors.js +11 -0
- package/src/store/reducer.js +18 -0
- package/src/store/test/actions.js +6 -14
- package/src/style.scss +5 -1
- package/src/utils/is-previewing-theme.js +18 -0
- package/src/utils/use-activate-theme.js +38 -0
- package/build/components/global-styles/context-menu.js +0 -126
- package/build/components/global-styles/context-menu.js.map +0 -1
- package/build/components/global-styles/custom-css.js +0 -113
- package/build/components/global-styles/custom-css.js.map +0 -1
- package/build/components/global-styles/effects-panel.js +0 -53
- package/build/components/global-styles/effects-panel.js.map +0 -1
- package/build/components/global-styles/filters-panel.js +0 -45
- package/build/components/global-styles/filters-panel.js.map +0 -1
- package/build/components/global-styles/screen-border.js +0 -61
- package/build/components/global-styles/screen-border.js.map +0 -1
- package/build/components/global-styles/screen-effects.js +0 -61
- package/build/components/global-styles/screen-effects.js.map +0 -1
- package/build/components/global-styles/screen-filters.js +0 -46
- package/build/components/global-styles/screen-filters.js.map +0 -1
- package/build/components/global-styles/screen-variations.js +0 -71
- package/build/components/global-styles/screen-variations.js.map +0 -1
- package/build/components/routes/index.js +0 -60
- package/build/components/routes/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build/hooks/commands/index.js +0 -19
- package/build/hooks/commands/index.js.map +0 -1
- package/build/hooks/commands/use-navigation-commands.js +0 -117
- package/build/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build/hooks/commands/use-wp-admin-commands.js +0 -94
- package/build/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build/utils/history.js +0 -41
- package/build/utils/history.js.map +0 -1
- package/build-module/components/global-styles/context-menu.js +0 -107
- package/build-module/components/global-styles/context-menu.js.map +0 -1
- package/build-module/components/global-styles/custom-css.js +0 -98
- package/build-module/components/global-styles/custom-css.js.map +0 -1
- package/build-module/components/global-styles/effects-panel.js +0 -43
- package/build-module/components/global-styles/effects-panel.js.map +0 -1
- package/build-module/components/global-styles/filters-panel.js +0 -35
- package/build-module/components/global-styles/filters-panel.js.map +0 -1
- package/build-module/components/global-styles/screen-border.js +0 -44
- package/build-module/components/global-styles/screen-border.js.map +0 -1
- package/build-module/components/global-styles/screen-effects.js +0 -44
- package/build-module/components/global-styles/screen-effects.js.map +0 -1
- package/build-module/components/global-styles/screen-filters.js +0 -33
- package/build-module/components/global-styles/screen-filters.js.map +0 -1
- package/build-module/components/global-styles/screen-variations.js +0 -54
- package/build-module/components/global-styles/screen-variations.js.map +0 -1
- package/build-module/components/routes/index.js +0 -47
- package/build-module/components/routes/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build-module/hooks/commands/index.js +0 -10
- package/build-module/hooks/commands/index.js.map +0 -1
- package/build-module/hooks/commands/use-navigation-commands.js +0 -101
- package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build-module/hooks/commands/use-wp-admin-commands.js +0 -79
- package/build-module/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build-module/utils/history.js +0 -31
- package/build-module/utils/history.js.map +0 -1
- package/src/components/global-styles/context-menu.js +0 -175
- package/src/components/global-styles/custom-css.js +0 -131
- package/src/components/global-styles/effects-panel.js +0 -40
- package/src/components/global-styles/filters-panel.js +0 -33
- package/src/components/global-styles/screen-border.js +0 -35
- package/src/components/global-styles/screen-effects.js +0 -35
- package/src/components/global-styles/screen-filters.js +0 -27
- package/src/components/global-styles/screen-variations.js +0 -46
- package/src/components/routes/index.js +0 -53
- package/src/hooks/commands/index.js +0 -10
- package/src/hooks/commands/use-navigation-commands.js +0 -103
- package/src/hooks/commands/use-wp-admin-commands.js +0 -77
- package/src/utils/history.js +0 -39
- /package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +0 -0
|
@@ -17,7 +17,9 @@ var _a11y = require("@wordpress/a11y");
|
|
|
17
17
|
|
|
18
18
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _router = require("@wordpress/router");
|
|
21
|
+
|
|
22
|
+
var _privateApis = require("../../private-apis");
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* WordPress dependencies
|
|
@@ -26,8 +28,12 @@ var _index = require("./index");
|
|
|
26
28
|
/**
|
|
27
29
|
* Internal dependencies
|
|
28
30
|
*/
|
|
31
|
+
const {
|
|
32
|
+
useLocation
|
|
33
|
+
} = (0, _privateApis.unlock)(_router.privateApis);
|
|
34
|
+
|
|
29
35
|
function useTitle(title) {
|
|
30
|
-
const location =
|
|
36
|
+
const location = useLocation();
|
|
31
37
|
const siteTitle = (0, _data.useSelect)(select => {
|
|
32
38
|
var _select$getEntityReco;
|
|
33
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"names":["useTitle","title","location","siteTitle","select","coreStore","getEntityRecord","isInitialLocationRef","current","formattedTitle","document"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"names":["useLocation","routerPrivateApis","useTitle","title","location","siteTitle","select","coreStore","getEntityRecord","isInitialLocationRef","current","formattedTitle","document"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAdA;AACA;AACA;;AASA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,yBAAQC,mBAAR,CAAxB;;AAEe,SAASC,QAAT,CAAmBC,KAAnB,EAA2B;AACzC,QAAMC,QAAQ,GAAGJ,WAAW,EAA5B;AACA,QAAMK,SAAS,GAAG,qBACfC,MAAF;AAAA;;AAAA,oCACCA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,CAAqC,MAArC,EAA6C,MAA7C,CADD,0DACC,sBAAuDL,KADxD;AAAA,GADiB,EAGjB,EAHiB,CAAlB;AAKA,QAAMM,oBAAoB,GAAG,qBAAQ,IAAR,CAA7B;AAEA,0BAAW,MAAM;AAChBA,IAAAA,oBAAoB,CAACC,OAArB,GAA+B,KAA/B;AACA,GAFD,EAEG,CAAEN,QAAF,CAFH;AAIA,0BAAW,MAAM;AAChB;AACA,QAAKK,oBAAoB,CAACC,OAA1B,EAAoC;AACnC;AACA;;AAED,QAAKP,KAAK,IAAIE,SAAd,EAA0B;AACzB;AACA,YAAMM,cAAc,GAAG;AACtB;AACA,oBAAI,yBAAJ,CAFsB,EAGtB,kCAAgBR,KAAhB,CAHsB,EAItB,kCAAgBE,SAAhB,CAJsB,CAAvB;AAOAO,MAAAA,QAAQ,CAACT,KAAT,GAAiBQ,cAAjB,CATyB,CAWzB;;AACA,uBACC;AACC;AACA,oBAAI,oBAAJ,CAFD,EAGCC,QAAQ,CAACT,KAHV,CADD,EAMC,WAND;AAQA;AACD,GA3BD,EA2BG,CAAEA,KAAF,EAASE,SAAT,EAAoBD,QAApB,CA3BH;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s — WordPress' ),\n\t\t\t\tdecodeEntities( title ),\n\t\t\t\tdecodeEntities( siteTitle )\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The page title that is currently displaying. */\n\t\t\t\t\t__( 'Now displaying: %s' ),\n\t\t\t\t\tdocument.title\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"]}
|
|
@@ -19,6 +19,8 @@ var _keycodes = require("@wordpress/keycodes");
|
|
|
19
19
|
|
|
20
20
|
var _store = require("../../store");
|
|
21
21
|
|
|
22
|
+
var _isPreviewingTheme = require("../../utils/is-previewing-theme");
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* WordPress dependencies
|
|
24
26
|
*/
|
|
@@ -26,7 +28,13 @@ var _store = require("../../store");
|
|
|
26
28
|
/**
|
|
27
29
|
* Internal dependencies
|
|
28
30
|
*/
|
|
29
|
-
function SaveButton() {
|
|
31
|
+
function SaveButton(_ref) {
|
|
32
|
+
let {
|
|
33
|
+
className = 'edit-site-save-button__button',
|
|
34
|
+
variant = 'primary',
|
|
35
|
+
showTooltip = true,
|
|
36
|
+
icon
|
|
37
|
+
} = _ref;
|
|
30
38
|
const {
|
|
31
39
|
isDirty,
|
|
32
40
|
isSaving,
|
|
@@ -51,11 +59,27 @@ function SaveButton() {
|
|
|
51
59
|
const {
|
|
52
60
|
setIsSaveViewOpened
|
|
53
61
|
} = (0, _data.useDispatch)(_store.store);
|
|
54
|
-
const
|
|
55
|
-
const
|
|
62
|
+
const activateSaveEnabled = (0, _isPreviewingTheme.isPreviewingTheme)() || isDirty;
|
|
63
|
+
const disabled = isSaving || !activateSaveEnabled;
|
|
64
|
+
|
|
65
|
+
const getLabel = () => {
|
|
66
|
+
if (disabled) {
|
|
67
|
+
return (0, _i18n.__)('Saved');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if ((0, _isPreviewingTheme.isPreviewingTheme)() && isDirty) {
|
|
71
|
+
return (0, _i18n.__)('Activate & Save');
|
|
72
|
+
} else if ((0, _isPreviewingTheme.isPreviewingTheme)()) {
|
|
73
|
+
return (0, _i18n.__)('Activate');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (0, _i18n.__)('Save');
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const label = getLabel();
|
|
56
80
|
return (0, _element.createElement)(_components.Button, {
|
|
57
|
-
variant:
|
|
58
|
-
className:
|
|
81
|
+
variant: variant,
|
|
82
|
+
className: className,
|
|
59
83
|
"aria-disabled": disabled,
|
|
60
84
|
"aria-expanded": isSaveViewOpen,
|
|
61
85
|
isBusy: isSaving,
|
|
@@ -74,7 +98,8 @@ function SaveButton() {
|
|
|
74
98
|
& the tooltip is always rendered even when there's no keyboard shortcut.
|
|
75
99
|
*/
|
|
76
100
|
,
|
|
77
|
-
showTooltip:
|
|
101
|
+
showTooltip: showTooltip,
|
|
102
|
+
icon: icon
|
|
78
103
|
}, label);
|
|
79
104
|
}
|
|
80
105
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","length","some","record","kind","name","key","setIsSaveViewOpened","disabled","label","undefined","displayShortcut","primary"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","className","variant","showTooltip","icon","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","length","some","record","kind","name","key","setIsSaveViewOpened","activateSaveEnabled","disabled","getLabel","label","undefined","displayShortcut","primary"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIe,SAASA,UAAT,OAKX;AAAA,MALgC;AACnCC,IAAAA,SAAS,GAAG,+BADuB;AAEnCC,IAAAA,OAAO,GAAG,SAFyB;AAGnCC,IAAAA,WAAW,GAAG,IAHqB;AAInCC,IAAAA;AAJmC,GAKhC;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAX;AAAqBC,IAAAA;AAArB,MAAwC,qBAAaC,MAAF,IAAc;AACtE,UAAM;AAAEC,MAAAA,mCAAF;AAAuCC,MAAAA;AAAvC,QACLF,MAAM,CAAEG,eAAF,CADP;;AAEA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,UAAM;AAAEI,MAAAA;AAAF,QAAuBL,MAAM,CAAEM,YAAF,CAAnC;AACA,WAAO;AACNT,MAAAA,OAAO,EAAEO,kBAAkB,CAACG,MAAnB,GAA4B,CAD/B;AAENT,MAAAA,QAAQ,EAAEM,kBAAkB,CAACI,IAAnB,CAA2BC,MAAF,IAClCP,oBAAoB,CAAEO,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX,CAFJ;AAKNb,MAAAA,cAAc,EAAEM,gBAAgB;AAL1B,KAAP;AAOA,GAZ6C,EAY3C,EAZ2C,CAA9C;AAaA,QAAM;AAAEQ,IAAAA;AAAF,MAA0B,uBAAaP,YAAb,CAAhC;AAEA,QAAMQ,mBAAmB,GAAG,+CAAuBjB,OAAnD;AACA,QAAMkB,QAAQ,GAAGjB,QAAQ,IAAI,CAAEgB,mBAA/B;;AAEA,QAAME,QAAQ,GAAG,MAAM;AACtB,QAAKD,QAAL,EAAgB;AACf,aAAO,cAAI,OAAJ,CAAP;AACA;;AAED,QAAK,+CAAuBlB,OAA5B,EAAsC;AACrC,aAAO,cAAI,iBAAJ,CAAP;AACA,KAFD,MAEO,IAAK,2CAAL,EAA2B;AACjC,aAAO,cAAI,UAAJ,CAAP;AACA;;AAED,WAAO,cAAI,MAAJ,CAAP;AACA,GAZD;;AAaA,QAAMoB,KAAK,GAAGD,QAAQ,EAAtB;AAEA,SACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGtB,OADX;AAEC,IAAA,SAAS,EAAGD,SAFb;AAGC,qBAAgBsB,QAHjB;AAIC,qBAAgBhB,cAJjB;AAKC,IAAA,MAAM,EAAGD,QALV;AAMC,IAAA,OAAO,EAAGiB,QAAQ,GAAGG,SAAH,GAAe,MAAML,mBAAmB,CAAE,IAAF,CAN3D;AAOC,IAAA,KAAK,EAAGI;AACR;AACH;AACA;AACA;AAXE;AAYC,IAAA,QAAQ,EAAGF,QAAQ,GAAGG,SAAH,GAAeC,0BAAgBC,OAAhB,CAAyB,GAAzB;AAClC;AACH;AACA;AACA;AACA;AACA;AAlBE;AAmBC,IAAA,WAAW,EAAGzB,WAnBf;AAoBC,IAAA,IAAI,EAAGC;AApBR,KAsBGqB,KAtBH,CADD;AA0BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\ticon,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\n\t\tif ( isPreviewingTheme() && isDirty ) {\n\t\t\treturn __( 'Activate & Save' );\n\t\t} else if ( isPreviewingTheme() ) {\n\t\t\treturn __( 'Activate' );\n\t\t}\n\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t & the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
exports.default =
|
|
8
|
+
exports.default = SaveHub;
|
|
7
9
|
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
9
11
|
|
|
@@ -15,11 +17,11 @@ var _i18n = require("@wordpress/i18n");
|
|
|
15
17
|
|
|
16
18
|
var _coreData = require("@wordpress/core-data");
|
|
17
19
|
|
|
18
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
19
|
-
|
|
20
20
|
var _icons = require("@wordpress/icons");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _saveButton = _interopRequireDefault(require("../save-button"));
|
|
23
|
+
|
|
24
|
+
var _isPreviewingTheme = require("../../utils/is-previewing-theme");
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* WordPress dependencies
|
|
@@ -28,12 +30,11 @@ var _store = require("../../store");
|
|
|
28
30
|
/**
|
|
29
31
|
* Internal dependencies
|
|
30
32
|
*/
|
|
31
|
-
function
|
|
33
|
+
function SaveHub() {
|
|
32
34
|
const {
|
|
33
35
|
countUnsavedChanges,
|
|
34
36
|
isDirty,
|
|
35
|
-
isSaving
|
|
36
|
-
isSaveViewOpen
|
|
37
|
+
isSaving
|
|
37
38
|
} = (0, _data.useSelect)(select => {
|
|
38
39
|
const {
|
|
39
40
|
__experimentalGetDirtyEntityRecords,
|
|
@@ -42,41 +43,23 @@ function SaveButton() {
|
|
|
42
43
|
|
|
43
44
|
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
44
45
|
|
|
45
|
-
const {
|
|
46
|
-
isSaveViewOpened
|
|
47
|
-
} = select(_store.store);
|
|
48
46
|
return {
|
|
49
47
|
isDirty: dirtyEntityRecords.length > 0,
|
|
50
48
|
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
|
|
51
|
-
isSaveViewOpen: isSaveViewOpened(),
|
|
52
49
|
countUnsavedChanges: dirtyEntityRecords.length
|
|
53
50
|
};
|
|
54
51
|
}, []);
|
|
55
|
-
const
|
|
56
|
-
setIsSaveViewOpened
|
|
57
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
58
|
-
const disabled = !isDirty || isSaving;
|
|
59
|
-
const label = disabled ? (0, _i18n.__)('Saved') : (0, _i18n.__)('Save');
|
|
52
|
+
const disabled = isSaving || !isDirty && !(0, _isPreviewingTheme.isPreviewingTheme)();
|
|
60
53
|
return (0, _element.createElement)(_components.__experimentalHStack, {
|
|
61
54
|
className: "edit-site-save-hub",
|
|
62
55
|
alignment: "right",
|
|
63
56
|
spacing: 4
|
|
64
57
|
}, isDirty && (0, _element.createElement)("span", null, (0, _i18n.sprintf)( // translators: %d: number of unsaved changes (number).
|
|
65
|
-
(0, _i18n._n)('%d unsaved change', '%d unsaved changes', countUnsavedChanges), countUnsavedChanges)), (0, _element.createElement)(
|
|
58
|
+
(0, _i18n._n)('%d unsaved change', '%d unsaved changes', countUnsavedChanges), countUnsavedChanges)), (0, _element.createElement)(_saveButton.default, {
|
|
66
59
|
className: "edit-site-save-hub__button",
|
|
67
|
-
variant: disabled ?
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
onClick: disabled ? undefined : () => setIsSaveViewOpened(true),
|
|
72
|
-
label: label
|
|
73
|
-
/*
|
|
74
|
-
* We want the tooltip to show the keyboard shortcut only when the
|
|
75
|
-
* button does something, i.e. when it's not disabled.
|
|
76
|
-
*/
|
|
77
|
-
,
|
|
78
|
-
shortcut: disabled ? undefined : _keycodes.displayShortcut.primary('s'),
|
|
79
|
-
icon: disabled ? _icons.check : undefined
|
|
80
|
-
}, label));
|
|
60
|
+
variant: disabled ? null : 'primary',
|
|
61
|
+
showTooltip: false,
|
|
62
|
+
icon: disabled ? _icons.check : null
|
|
63
|
+
}));
|
|
81
64
|
}
|
|
82
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"names":["SaveHub","countUnsavedChanges","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","length","some","record","kind","name","key","disabled","check"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIe,SAASA,OAAT,GAAmB;AACjC,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,OAAvB;AAAgCC,IAAAA;AAAhC,MAA6C,qBAChDC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEM,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENN,MAAAA,QAAQ,EAAEK,kBAAkB,CAACE,IAAnB,CAA2BC,MAAF,IAClCL,oBAAoB,CAAEK,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX,CAFJ;AAKNb,MAAAA,mBAAmB,EAAEO,kBAAkB,CAACC;AALlC,KAAP;AAOA,GAdiD,EAelD,EAfkD,CAAnD;AAkBA,QAAMM,QAAQ,GAAGZ,QAAQ,IAAM,CAAED,OAAF,IAAa,CAAE,2CAA9C;AAEA,SACC,4BAAC,gCAAD;AAAQ,IAAA,SAAS,EAAC,oBAAlB;AAAuC,IAAA,SAAS,EAAC,OAAjD;AAAyD,IAAA,OAAO,EAAG;AAAnE,KACGA,OAAO,IACR,0CACG,oBACD;AACA,gBACC,mBADD,EAEC,oBAFD,EAGCD,mBAHD,CAFC,EAODA,mBAPC,CADH,CAFF,EAcC,4BAAC,mBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAGc,QAAQ,GAAG,IAAH,GAAU,SAF7B;AAGC,IAAA,WAAW,EAAG,KAHf;AAIC,IAAA,IAAI,EAAGA,QAAQ,GAAGC,YAAH,GAAW;AAJ3B,IAdD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { countUnsavedChanges, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\treturn {\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t),\n\t\t\t\tcountUnsavedChanges: dirtyEntityRecords.length,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disabled = isSaving || ( ! isDirty && ! isPreviewingTheme() );\n\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t{ isDirty && (\n\t\t\t\t<span>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d unsaved change',\n\t\t\t\t\t\t\t'%d unsaved changes',\n\t\t\t\t\t\t\tcountUnsavedChanges\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcountUnsavedChanges\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ disabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ disabled ? check : null }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"]}
|
|
@@ -25,6 +25,8 @@ var _store = require("../../store");
|
|
|
25
25
|
|
|
26
26
|
var _privateApis = require("../../private-apis");
|
|
27
27
|
|
|
28
|
+
var _useActivateTheme = require("../../utils/use-activate-theme");
|
|
29
|
+
|
|
28
30
|
/**
|
|
29
31
|
* External dependencies
|
|
30
32
|
*/
|
|
@@ -37,6 +39,8 @@ var _privateApis = require("../../private-apis");
|
|
|
37
39
|
* Internal dependencies
|
|
38
40
|
*/
|
|
39
41
|
function SavePanel() {
|
|
42
|
+
var _window;
|
|
43
|
+
|
|
40
44
|
const {
|
|
41
45
|
isSaveViewOpen,
|
|
42
46
|
canvasMode
|
|
@@ -55,28 +59,37 @@ function SavePanel() {
|
|
|
55
59
|
const {
|
|
56
60
|
setIsSaveViewOpened
|
|
57
61
|
} = (0, _data.useDispatch)(_store.store);
|
|
62
|
+
const activateTheme = (0, _useActivateTheme.useActivateTheme)();
|
|
58
63
|
|
|
59
64
|
const onClose = () => setIsSaveViewOpened(false);
|
|
60
65
|
|
|
66
|
+
const onSave = async values => {
|
|
67
|
+
await activateTheme();
|
|
68
|
+
return values;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const entitySavedStates = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableThemePreviews ? (0, _element.createElement)(_editor.EntitiesSavedStates, {
|
|
72
|
+
close: onClose,
|
|
73
|
+
onSave: onSave
|
|
74
|
+
}) : (0, _element.createElement)(_editor.EntitiesSavedStates, {
|
|
75
|
+
close: onClose
|
|
76
|
+
});
|
|
77
|
+
|
|
61
78
|
if (canvasMode === 'view') {
|
|
62
79
|
return isSaveViewOpen ? (0, _element.createElement)(_components.Modal, {
|
|
63
80
|
className: "edit-site-save-panel__modal",
|
|
64
81
|
onRequestClose: onClose,
|
|
65
82
|
__experimentalHideHeader: true,
|
|
66
83
|
contentLabel: (0, _i18n.__)('Save site, content, and template changes')
|
|
67
|
-
},
|
|
68
|
-
close: onClose
|
|
69
|
-
})) : null;
|
|
84
|
+
}, entitySavedStates) : null;
|
|
70
85
|
}
|
|
71
86
|
|
|
72
87
|
return (0, _element.createElement)(_interface.NavigableRegion, {
|
|
73
88
|
className: (0, _classnames.default)('edit-site-layout__actions', {
|
|
74
89
|
'is-entity-save-view-open': isSaveViewOpen
|
|
75
90
|
}),
|
|
76
|
-
ariaLabel: (0, _i18n.__)('Save
|
|
77
|
-
}, isSaveViewOpen ? (0, _element.createElement)(
|
|
78
|
-
close: onClose
|
|
79
|
-
}) : (0, _element.createElement)("div", {
|
|
91
|
+
ariaLabel: (0, _i18n.__)('Save panel')
|
|
92
|
+
}, isSaveViewOpen ? entitySavedStates : (0, _element.createElement)("div", {
|
|
80
93
|
className: "edit-site-editor__toggle-save-panel"
|
|
81
94
|
}, (0, _element.createElement)(_components.Button, {
|
|
82
95
|
variant: "secondary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened","activateTheme","onClose","onSave","values","entitySavedStates","window","__experimentalEnableThemePreviews"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAKe,SAASA,SAAT,GAAqB;AAAA;;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAiC,qBAAaC,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAsC,yBAC3CF,MAAM,CAAEG,YAAF,CADqC,CAA5C,CAD+D,CAK/D;AACA;;AACA,WAAO;AACNL,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,UAAU,EAAEG,aAAa;AAFnB,KAAP;AAIA,GAXsC,EAWpC,EAXoC,CAAvC;AAYA,QAAM;AAAEE,IAAAA;AAAF,MAA0B,uBAAaD,YAAb,CAAhC;AACA,QAAME,aAAa,GAAG,yCAAtB;;AACA,QAAMC,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,4BAAC,2BAAD;AAAqB,IAAA,KAAK,EAAGL,OAA7B;AAAuC,IAAA,MAAM,EAAGC;AAAhD,IADyB,GAGzB,4BAAC,2BAAD;AAAqB,IAAA,KAAK,EAAGD;AAA7B,IAHD;;AAMA,MAAKP,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGQ,OAFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAG,cACd,0CADc;AAJhB,OAQGG,iBARH,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,4BAAC,0BAAD;AACC,IAAA,SAAS,EAAG,yBAAY,2BAAZ,EAAyC;AACpD,kCAA4BX;AADwB,KAAzC,CADb;AAIC,IAAA,SAAS,EAAG,cAAI,YAAJ;AAJb,KAMGA,cAAc,GACfW,iBADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAML,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMG,cAAI,iBAAJ,CANH,CADD,CATF,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport { EntitiesSavedStates } from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\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"]}
|
|
@@ -46,24 +46,19 @@ function ListViewSidebar() {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const instanceId = (0, _compose.useInstanceId)(ListViewSidebar);
|
|
50
|
-
const labelId = `edit-site-editor__list-view-panel-label-${instanceId}`;
|
|
51
49
|
const {
|
|
52
50
|
PrivateListView
|
|
53
51
|
} = (0, _privateApis.unlock)(_blockEditor.privateApis);
|
|
54
52
|
return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
55
53
|
(0, _element.createElement)("div", {
|
|
56
|
-
"aria-labelledby": labelId,
|
|
57
54
|
className: "edit-site-editor__list-view-panel",
|
|
58
55
|
onKeyDown: closeOnEscape
|
|
59
56
|
}, (0, _element.createElement)("div", {
|
|
60
57
|
className: "edit-site-editor__list-view-panel-header",
|
|
61
58
|
ref: headerFocusReturnRef
|
|
62
|
-
}, (0, _element.createElement)("strong", {
|
|
63
|
-
id: labelId
|
|
64
|
-
}, (0, _i18n.__)('List View')), (0, _element.createElement)(_components.Button, {
|
|
59
|
+
}, (0, _element.createElement)("strong", null, (0, _i18n.__)('List View')), (0, _element.createElement)(_components.Button, {
|
|
65
60
|
icon: _icons.closeSmall,
|
|
66
|
-
label: (0, _i18n.__)('Close
|
|
61
|
+
label: (0, _i18n.__)('Close'),
|
|
67
62
|
onClick: () => setIsListViewOpened(false)
|
|
68
63
|
})), (0, _element.createElement)("div", {
|
|
69
64
|
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":["ListViewSidebar","setIsListViewOpened","editSiteStore","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["ListViewSidebar","setIsListViewOpened","editSiteStore","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","PrivateListView","blockEditorPrivateApis","closeSmall"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAaA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC;AAEA,QAAMC,eAAe,GAAG,8BAAiB,cAAjB,CAAxB;AACA,QAAMC,oBAAoB,GAAG,8BAA7B;AACA,QAAMC,qBAAqB,GAAG,8BAA9B;;AACA,WAASC,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBC,gBAAlB,IAA4B,CAAEF,KAAK,CAACG,gBAAzC,EAA4D;AAC3DT,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD;;AAED,QAAM;AAAEU,IAAAA;AAAF,MAAsB,yBAAQC,wBAAR,CAA5B;AACA,SACC;AACA;AACC,MAAA,SAAS,EAAC,mCADX;AAEC,MAAA,SAAS,EAAGN;AAFb,OAIC;AACC,MAAA,SAAS,EAAC,0CADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIC,4CAAU,cAAI,WAAJ,CAAV,CAJD,EAKC,4BAAC,kBAAD;AACC,MAAA,IAAI,EAAGS,iBADR;AAEC,MAAA,KAAK,EAAG,cAAI,OAAJ,CAFT;AAGC,MAAA,OAAO,EAAG,MAAMZ,mBAAmB,CAAE,KAAF;AAHpC,MALD,CAJD,EAeC;AACC,MAAA,SAAS,EAAC,2CADX;AAEC,MAAA,GAAG,EAAG,2BAAc,CACnBI,qBADmB,EAEnBF,eAFmB,CAAd;AAFP,OAOC,4BAAC,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\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\tconst { PrivateListView } = unlock( blockEditorPrivateApis );\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"]}
|
|
@@ -11,6 +11,8 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _components = require("@wordpress/components");
|
|
13
13
|
|
|
14
|
+
var _router = require("@wordpress/router");
|
|
15
|
+
|
|
14
16
|
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
15
17
|
|
|
16
18
|
var _sidebarNavigationScreenTemplates = _interopRequireDefault(require("../sidebar-navigation-screen-templates"));
|
|
@@ -29,7 +31,11 @@ var _saveHub = _interopRequireDefault(require("../save-hub"));
|
|
|
29
31
|
|
|
30
32
|
var _sidebarNavigationScreenNavigationItem = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-item"));
|
|
31
33
|
|
|
32
|
-
var
|
|
34
|
+
var _privateApis = require("../../private-apis");
|
|
35
|
+
|
|
36
|
+
var _sidebarNavigationScreenPages = _interopRequireDefault(require("../sidebar-navigation-screen-pages"));
|
|
37
|
+
|
|
38
|
+
var _sidebarNavigationScreenPage = _interopRequireDefault(require("../sidebar-navigation-screen-page"));
|
|
33
39
|
|
|
34
40
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
41
|
|
|
@@ -42,6 +48,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
42
48
|
/**
|
|
43
49
|
* Internal dependencies
|
|
44
50
|
*/
|
|
51
|
+
const {
|
|
52
|
+
useLocation
|
|
53
|
+
} = (0, _privateApis.unlock)(_router.privateApis);
|
|
54
|
+
|
|
45
55
|
function SidebarScreens() {
|
|
46
56
|
(0, _useSyncPathWithUrl.default)();
|
|
47
57
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
@@ -53,6 +63,10 @@ function SidebarScreens() {
|
|
|
53
63
|
}, (0, _element.createElement)(_sidebarNavigationScreenGlobalStyles.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
54
64
|
path: "/navigation/:postType/:postId"
|
|
55
65
|
}, (0, _element.createElement)(_sidebarNavigationScreenNavigationItem.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
66
|
+
path: "/page"
|
|
67
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenPages.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
68
|
+
path: "/page/:postId"
|
|
69
|
+
}, (0, _element.createElement)(_sidebarNavigationScreenPage.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
56
70
|
path: "/:postType(wp_template|wp_template_part)"
|
|
57
71
|
}, (0, _element.createElement)(_sidebarNavigationScreenTemplates.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
58
72
|
path: "/:postType(wp_template|wp_template_part)/all"
|
|
@@ -64,7 +78,7 @@ function SidebarScreens() {
|
|
|
64
78
|
function Sidebar() {
|
|
65
79
|
const {
|
|
66
80
|
params: urlParams
|
|
67
|
-
} =
|
|
81
|
+
} = useLocation();
|
|
68
82
|
const initialPath = (0, _element.useRef)((0, _useSyncPathWithUrl.getPathFromURL)(urlParams));
|
|
69
83
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalNavigatorProvider, {
|
|
70
84
|
className: "edit-site-sidebar__content",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;;;;;;;;AAGA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["useLocation","routerPrivateApis","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;;;;;;;;AAGA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AA1BA;AACA;AACA;;AAQA;AACA;AACA;AAgBA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,yBAAQC,mBAAR,CAAxB;;AAEA,SAASC,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,oCAAD,OADD,CADD,EAIC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAJD,EAOC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,4CAAD,OADD,CAPD,EAUC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,8CAAD,OADD,CAVD,EAaC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,qCAAD,OADD,CAbD,EAgBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,oCAAD,OADD,CAhBD,EAmBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,yCAAD,OADD,CAnBD,EAsBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAtBD,EAyBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,wCAAD,OADD,CAzBD,CADD;AA+BA;;AAED,SAASC,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwBL,WAAW,EAAzC;AACA,QAAMM,WAAW,GAAG,qBAAQ,wCAAgBD,SAAhB,CAAR,CAApB;AAEA,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,4BAAC,cAAD,OAJD,CADD,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,gBAAD,OADD,CAPD,CADD;AAaA;;eAEc,mBAAMJ,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\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 SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';\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=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationItem />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/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"]}
|
|
@@ -17,6 +17,8 @@ var _icons = require("@wordpress/icons");
|
|
|
17
17
|
|
|
18
18
|
var _data = require("@wordpress/data");
|
|
19
19
|
|
|
20
|
+
var _interface = require("@wordpress/interface");
|
|
21
|
+
|
|
20
22
|
var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
|
|
21
23
|
|
|
22
24
|
var _globalStyles = require("../global-styles");
|
|
@@ -25,6 +27,8 @@ var _store = require("../../store");
|
|
|
25
27
|
|
|
26
28
|
var _ui = require("../global-styles/ui");
|
|
27
29
|
|
|
30
|
+
var _privateApis = require("../../private-apis");
|
|
31
|
+
|
|
28
32
|
/**
|
|
29
33
|
* WordPress dependencies
|
|
30
34
|
*/
|
|
@@ -33,19 +37,41 @@ var _ui = require("../global-styles/ui");
|
|
|
33
37
|
* Internal dependencies
|
|
34
38
|
*/
|
|
35
39
|
function GlobalStylesSidebar() {
|
|
36
|
-
const
|
|
37
|
-
|
|
40
|
+
const {
|
|
41
|
+
shouldClearCanvasContainerView,
|
|
42
|
+
isStyleBookOpened
|
|
43
|
+
} = (0, _data.useSelect)(select => {
|
|
44
|
+
const {
|
|
45
|
+
getActiveComplementaryArea
|
|
46
|
+
} = select(_interface.store);
|
|
47
|
+
const {
|
|
48
|
+
getEditorCanvasContainerView,
|
|
49
|
+
getCanvasMode
|
|
50
|
+
} = (0, _privateApis.unlock)(select(_store.store));
|
|
51
|
+
|
|
52
|
+
const _isVisualEditorMode = 'visual' === select(_store.store).getEditorMode();
|
|
53
|
+
|
|
54
|
+
const _isEditCanvasMode = 'edit' === getCanvasMode();
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
|
58
|
+
shouldClearCanvasContainerView: 'edit-site/global-styles' !== getActiveComplementaryArea('core/edit-site') || !_isVisualEditorMode || !_isEditCanvasMode
|
|
59
|
+
};
|
|
60
|
+
}, []);
|
|
61
|
+
const {
|
|
62
|
+
setEditorCanvasContainerView
|
|
63
|
+
} = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
|
|
38
64
|
(0, _element.useEffect)(() => {
|
|
39
|
-
if (
|
|
40
|
-
|
|
65
|
+
if (shouldClearCanvasContainerView) {
|
|
66
|
+
setEditorCanvasContainerView(undefined);
|
|
41
67
|
}
|
|
42
|
-
}, [
|
|
68
|
+
}, [shouldClearCanvasContainerView]);
|
|
43
69
|
return (0, _element.createElement)(_defaultSidebar.default, {
|
|
44
70
|
className: "edit-site-global-styles-sidebar",
|
|
45
71
|
identifier: "edit-site/global-styles",
|
|
46
72
|
title: (0, _i18n.__)('Styles'),
|
|
47
73
|
icon: _icons.styles,
|
|
48
|
-
closeLabel: (0, _i18n.__)('Close Styles
|
|
74
|
+
closeLabel: (0, _i18n.__)('Close Styles'),
|
|
49
75
|
panelClassName: "edit-site-global-styles-sidebar__panel",
|
|
50
76
|
header: (0, _element.createElement)(_components.Flex, {
|
|
51
77
|
className: "edit-site-global-styles-sidebar__header"
|
|
@@ -57,14 +83,9 @@ function GlobalStylesSidebar() {
|
|
|
57
83
|
icon: _icons.seen,
|
|
58
84
|
label: (0, _i18n.__)('Style Book'),
|
|
59
85
|
isPressed: isStyleBookOpened,
|
|
60
|
-
disabled:
|
|
61
|
-
onClick: () =>
|
|
62
|
-
setIsStyleBookOpened(!isStyleBookOpened);
|
|
63
|
-
}
|
|
86
|
+
disabled: shouldClearCanvasContainerView,
|
|
87
|
+
onClick: () => setEditorCanvasContainerView(isStyleBookOpened ? undefined : 'style-book')
|
|
64
88
|
})), (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_ui.GlobalStylesMenuSlot, null)))
|
|
65
|
-
}, (0, _element.createElement)(_globalStyles.GlobalStylesUI,
|
|
66
|
-
isStyleBookOpened: isStyleBookOpened,
|
|
67
|
-
onCloseStyleBook: () => setIsStyleBookOpened(false)
|
|
68
|
-
}));
|
|
89
|
+
}, (0, _element.createElement)(_globalStyles.GlobalStylesUI, null));
|
|
69
90
|
}
|
|
70
91
|
//# sourceMappingURL=global-styles-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","isStyleBookOpened","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","select","getActiveComplementaryArea","interfaceStore","getEditorCanvasContainerView","getCanvasMode","editSiteStore","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","setEditorCanvasContainerView","undefined","styles","minWidth","seen"],"mappings":";;;;;;;;;AAOA;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAQA;AACA;AACA;AAOe,SAASA,mBAAT,GAA+B;AAC7C,QAAM;AAAEC,IAAAA,8BAAF;AAAkCC,IAAAA;AAAlC,MAAwD,qBAC3DC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAiCD,MAAM,CAAEE,gBAAF,CAA7C;AACA,UAAM;AAAEC,MAAAA,4BAAF;AAAgCC,MAAAA;AAAhC,QAAkD,yBACvDJ,MAAM,CAAEK,YAAF,CADiD,CAAxD;;AAGA,UAAMC,mBAAmB,GACxB,aAAaN,MAAM,CAAEK,YAAF,CAAN,CAAwBE,aAAxB,EADd;;AAEA,UAAMC,iBAAiB,GAAG,WAAWJ,aAAa,EAAlD;;AAEA,WAAO;AACNL,MAAAA,iBAAiB,EAChB,iBAAiBI,4BAA4B,EAFxC;AAGNL,MAAAA,8BAA8B,EAC7B,8BACCG,0BAA0B,CAAE,gBAAF,CAD3B,IAEA,CAAEK,mBAFF,IAGA,CAAEE;AAPG,KAAP;AASA,GAnB4D,EAoB7D,EApB6D,CAA9D;AAsBA,QAAM;AAAEC,IAAAA;AAAF,MAAmC,yBACxC,uBAAaJ,YAAb,CADwC,CAAzC;AAIA,0BAAW,MAAM;AAChB,QAAKP,8BAAL,EAAsC;AACrCW,MAAAA,4BAA4B,CAAEC,SAAF,CAA5B;AACA;AACD,GAJD,EAIG,CAAEZ,8BAAF,CAJH;AAMA,SACC,4BAAC,uBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAHT;AAIC,IAAA,IAAI,EAAGa,aAJR;AAKC,IAAA,UAAU,EAAG,cAAI,cAAJ,CALd;AAMC,IAAA,cAAc,EAAC,wCANhB;AAOC,IAAA,MAAM,EACL,4BAAC,gBAAD;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,4BAAC,qBAAD;AAAW,MAAA,KAAK,EAAG;AAAEC,QAAAA,QAAQ,EAAE;AAAZ;AAAnB,OACC,4CAAU,cAAI,QAAJ,CAAV,CADD,CADD,EAIC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AACC,MAAA,IAAI,EAAGC,WADR;AAEC,MAAA,KAAK,EAAG,cAAI,YAAJ,CAFT;AAGC,MAAA,SAAS,EAAGd,iBAHb;AAIC,MAAA,QAAQ,EAAGD,8BAJZ;AAKC,MAAA,OAAO,EAAG,MACTW,4BAA4B,CAC3BV,iBAAiB,GAAGW,SAAH,GAAe,YADL;AAN9B,MADD,CAJD,EAiBC,4BAAC,oBAAD,QACC,4BAAC,wBAAD,OADD,CAjBD;AARF,KA+BC,4BAAC,4BAAD,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"]}
|
|
@@ -30,8 +30,12 @@ var _constants = require("../../store/constants");
|
|
|
30
30
|
|
|
31
31
|
var _settingsHeader = _interopRequireDefault(require("./settings-header"));
|
|
32
32
|
|
|
33
|
+
var _templateRevisions = _interopRequireDefault(require("./template-revisions"));
|
|
34
|
+
|
|
33
35
|
var _templateCard = _interopRequireDefault(require("./template-card"));
|
|
34
36
|
|
|
37
|
+
var _pluginTemplateSettingPanel = _interopRequireDefault(require("../plugin-template-setting-panel"));
|
|
38
|
+
|
|
35
39
|
var _constants2 = require("./constants");
|
|
36
40
|
|
|
37
41
|
var _store = require("../../store");
|
|
@@ -91,12 +95,15 @@ function SidebarComplementaryAreaFills() {
|
|
|
91
95
|
identifier: sidebarName,
|
|
92
96
|
title: (0, _i18n.__)('Settings'),
|
|
93
97
|
icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
|
|
94
|
-
closeLabel: (0, _i18n.__)('Close
|
|
98
|
+
closeLabel: (0, _i18n.__)('Close Settings'),
|
|
95
99
|
header: (0, _element.createElement)(_settingsHeader.default, {
|
|
96
100
|
sidebarName: sidebarName
|
|
97
101
|
}),
|
|
98
102
|
headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
|
|
99
|
-
}, sidebarName === _constants2.SIDEBAR_TEMPLATE && (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_templateCard.default, null)
|
|
103
|
+
}, sidebarName === _constants2.SIDEBAR_TEMPLATE && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_templateCard.default, null), (0, _element.createElement)(_components.PanelRow, {
|
|
104
|
+
header: (0, _i18n.__)('Editing history'),
|
|
105
|
+
className: "edit-site-template-revisions"
|
|
106
|
+
}, (0, _element.createElement)(_templateRevisions.default, null))), (0, _element.createElement)(_pluginTemplateSettingPanel.default.Slot, null)), sidebarName === _constants2.SIDEBAR_BLOCK && (0, _element.createElement)(InspectorSlot, {
|
|
100
107
|
bubblesVirtually: true
|
|
101
108
|
})), supportsGlobalStyles && (0, _element.createElement)(_globalStylesSidebar.default, null));
|
|
102
109
|
}
|