@wordpress/edit-site 5.9.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 +2 -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 +6 -3
- 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/editor/index.js +43 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +18 -4
- 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/border-panel.js +3 -1
- 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/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 +61 -108
- 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 +1 -1
- 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 +13 -7
- 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 +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/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 +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} +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 +36 -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/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/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/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 +4 -1
- 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/editor/index.js +45 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +21 -6
- 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/border-panel.js +3 -1
- 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/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 +61 -105
- 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 +2 -2
- 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 +9 -3
- 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 +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/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 +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} +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 +34 -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/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/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/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 +199 -78
- package/build-style/style.css +199 -78
- package/package.json +36 -34
- 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 +3 -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/style.scss +15 -8
- package/src/components/editor/index.js +48 -7
- package/src/components/editor-canvas-container/index.js +30 -17
- package/src/components/global-styles/block-preview-panel.js +1 -1
- package/src/components/global-styles/border-panel.js +3 -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 +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 +72 -101
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/index.js +5 -2
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/index.js +7 -3
- package/src/components/layout/style.scss +2 -4
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +4 -0
- package/src/components/list/table.js +3 -1
- 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/sidebar/index.js +12 -1
- 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-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 +89 -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 +29 -21
- 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/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/test/actions.js +6 -14
- package/src/style.scss +4 -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 -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/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 -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/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/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 -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/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/routes/index.js +0 -53
- 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
- /package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +0 -0
|
@@ -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
|
*/
|
|
@@ -18,7 +19,12 @@ import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-gl
|
|
|
18
19
|
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
19
20
|
import SaveHub from '../save-hub';
|
|
20
21
|
import SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';
|
|
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();
|
|
@@ -31,6 +37,10 @@ function SidebarScreens() {
|
|
|
31
37
|
}, createElement(SidebarNavigationScreenGlobalStyles, null)), createElement(NavigatorScreen, {
|
|
32
38
|
path: "/navigation/:postType/:postId"
|
|
33
39
|
}, createElement(SidebarNavigationScreenNavigationItem, null)), createElement(NavigatorScreen, {
|
|
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","SidebarNavigationScreenNavigationItem","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;
|
|
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","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","SidebarNavigationScreenNavigationItem","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,mCAAP,MAAgD,4CAAhD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,OAAOC,qCAAP,MAAkD,8CAAlD;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,mCAAD,OADD,CAPD,EAUC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,qCAAD,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 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"]}
|
|
@@ -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"]}
|
|
@@ -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,GACnB,2BAAEJ,eAAF,aAAEA,eAAF,iDAAEA,eAAe,CAAEE,MAAnB,qFAAE,uBAA2B,iBAA3B,CAAF,qFAAE,uBAAkD,CAAlD,CAAF,2DAAE,uBAAuDG,KAAzD,2EAAkE,CAAlE,IACA,CAFD;AAIA,SAAO;AACNL,IAAAA,eADM;AAENC,IAAAA,cAFM;AAGNG,IAAAA;AAHM,GAAP;AAKA,CAfD;;AAiBA,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\t( currentTemplate?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0 ) +\n\t\t1;\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"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalNavigatorToParentButton","NavigatorToParentButton","__experimentalHeading","Heading","isRTL","__","chevronRight","chevronLeft","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalNavigatorToParentButton","NavigatorToParentButton","__experimentalHeading","Heading","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationScreen","isRoot","title","actions","content","description","dashboardLink","select","getSettings","__experimentalDashboardLink","getTheme","theme","name","rendered"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,qCAAqC,IAAIC,uBAH1C,EAICC,qBAAqB,IAAIC,OAJ1B,QAKO,uBALP;AAMA,SAASC,KAAT,EAAgBC,EAAhB,EAAoBC,OAApB,QAAmC,iBAAnC;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kBAA1C;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,SACCC,iBADD,EAECC,wBAFD,QAGO,iCAHP;AAKA,eAAe,SAASC,uBAAT,OAMX;AAAA;;AAAA,MAN6C;AAChDC,IAAAA,MADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,OAHgD;AAIhDC,IAAAA,OAJgD;AAKhDC,IAAAA;AALgD,GAM7C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoBZ,SAAS,CAAIa,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkBZ,MAAM,CAAEW,MAAM,CAAEZ,aAAF,CAAR,CAA9B;AACA,WAAO;AACNW,MAAAA,aAAa,EAAEE,WAAW,GAAGC;AADvB,KAAP;AAGA,GALkC,EAKhC,EALgC,CAAnC;AAMA,QAAM;AAAEC,IAAAA;AAAF,MAAehB,SAAS,CAAED,SAAF,CAA9B;AACA,QAAMkB,KAAK,GAAGD,QAAQ,CAAEX,wBAAwB,EAA1B,CAAtB;AAEA,SACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC,YAFX;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG,CAAEE,MAAF,GACD,cAAC,uBAAD;AACC,IAAA,EAAE,EAAGJ,aADN;AAEC,IAAA,IAAI,EAAGV,KAAK,KAAKG,YAAL,GAAoBC,WAFjC;AAGC,IAAA,KAAK,EAAGH,EAAE,CAAE,MAAF;AAHX,IADC,GAOD,cAAC,aAAD;AACC,IAAA,IAAI,EAAGD,KAAK,KAAKG,YAAL,GAAoBC,WADjC;AAEC,IAAA,KAAK,EACJ,CAAEO,iBAAiB,EAAnB,GACGV,EAAE,CAAE,0BAAF,CADL,GAEGA,EAAE,CAAE,+BAAF,CALP;AAOC,IAAA,IAAI,EACH,CAAEU,iBAAiB,EAAnB,GACGQ,aAAa,IAAI,WADpB,GAEG;AAVL,IAZF,EA0BC,cAAC,OAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAG,OAFT;AAGC,IAAA,KAAK,EAAG,CAHT;AAIC,IAAA,IAAI,EAAG;AAJR,KAMG,CAAER,iBAAiB,EAAnB,GACCI,KADD,GAECb,OAAO,CACP,uBADO,EAEPsB,KAFO,aAEPA,KAFO,sCAEPA,KAAK,CAAEC,IAFA,gDAEP,YAAaC,QAFN,EAGPX,KAHO,CARX,CA1BD,EAwCGC,OAxCH,CADD,EA4CC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CAFF,EAMGD,OANH,CA5CD,CADD;AAuDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\tconst { getTheme } = useSelect( coreStore );\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack\n\t\t\t\tspacing={ 4 }\n\t\t\t\talignment=\"flex-start\"\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t>\n\t\t\t\t{ ! isRoot ? (\n\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\tas={ SidebarButton }\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t? __( 'Go back to the Dashboard' )\n\t\t\t\t\t\t\t\t: __( 'Go back to the theme showcase' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t? dashboardLink || 'index.php'\n\t\t\t\t\t\t\t\t: 'themes.php'\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\tcolor={ 'white' }\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\tsize={ 20 }\n\t\t\t\t>\n\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t? title\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\ttheme?.name?.rendered,\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t ) }\n\t\t\t\t</Heading>\n\t\t\t\t{ actions }\n\t\t\t</HStack>\n\n\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t{ description && (\n\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ content }\n\t\t\t</nav>\n\t\t</VStack>\n\t);\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { __experimentalItemGroup as ItemGroup, __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
|
-
import { layout,
|
|
8
|
+
import { layout, symbol, navigation, styles, page } from '@wordpress/icons';
|
|
9
9
|
import { useSelect } from '@wordpress/data';
|
|
10
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
11
|
/**
|
|
@@ -15,17 +15,29 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
15
15
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
16
16
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
17
17
|
export default function SidebarNavigationScreenMain() {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const {
|
|
19
|
+
hasNavigationMenus,
|
|
20
|
+
hasGlobalStyleVariations
|
|
21
|
+
} = useSelect(select => {
|
|
22
|
+
var _experimentalGetCurr;
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
getEntityRecords,
|
|
26
|
+
__experimentalGetCurrentThemeGlobalStylesVariations
|
|
27
|
+
} = select(coreStore); // The query needs to be the same as in the "SidebarNavigationScreenNavigationMenus" component,
|
|
20
28
|
// to avoid double network calls.
|
|
21
|
-
|
|
29
|
+
|
|
30
|
+
const navigationMenus = getEntityRecords('postType', 'wp_navigation', {
|
|
22
31
|
per_page: 1,
|
|
23
32
|
status: 'publish',
|
|
24
33
|
order: 'desc',
|
|
25
34
|
orderby: 'date'
|
|
26
35
|
});
|
|
27
|
-
return
|
|
28
|
-
|
|
36
|
+
return {
|
|
37
|
+
hasNavigationMenus: !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length),
|
|
38
|
+
hasGlobalStyleVariations: !!((_experimentalGetCurr = __experimentalGetCurrentThemeGlobalStylesVariations()) !== null && _experimentalGetCurr !== void 0 && _experimentalGetCurr.length)
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
29
41
|
const showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN ? hasNavigationMenus : false;
|
|
30
42
|
return createElement(SidebarNavigationScreen, {
|
|
31
43
|
isRoot: true,
|
|
@@ -36,12 +48,17 @@ export default function SidebarNavigationScreenMain() {
|
|
|
36
48
|
path: "/navigation",
|
|
37
49
|
withChevron: true,
|
|
38
50
|
icon: navigation
|
|
39
|
-
}, __('Navigation')), createElement(NavigatorButton, {
|
|
51
|
+
}, __('Navigation')), hasGlobalStyleVariations && createElement(NavigatorButton, {
|
|
40
52
|
as: SidebarNavigationItem,
|
|
41
53
|
path: "/wp_global_styles",
|
|
42
54
|
withChevron: true,
|
|
43
55
|
icon: styles
|
|
44
56
|
}, __('Styles')), createElement(NavigatorButton, {
|
|
57
|
+
as: SidebarNavigationItem,
|
|
58
|
+
path: "/page",
|
|
59
|
+
withChevron: true,
|
|
60
|
+
icon: page
|
|
61
|
+
}, __('Pages')), createElement(NavigatorButton, {
|
|
45
62
|
as: SidebarNavigationItem,
|
|
46
63
|
path: "/wp_template",
|
|
47
64
|
withChevron: true,
|
|
@@ -50,7 +67,7 @@ export default function SidebarNavigationScreenMain() {
|
|
|
50
67
|
as: SidebarNavigationItem,
|
|
51
68
|
path: "/wp_template_part",
|
|
52
69
|
withChevron: true,
|
|
53
|
-
icon:
|
|
70
|
+
icon: symbol
|
|
54
71
|
}, __('Template Parts')))
|
|
55
72
|
});
|
|
56
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalNavigatorButton","NavigatorButton","__","layout","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalNavigatorButton","NavigatorButton","__","layout","symbol","navigation","styles","page","useSelect","store","coreStore","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationScreenMain","hasNavigationMenus","hasGlobalStyleVariations","select","getEntityRecords","__experimentalGetCurrentThemeGlobalStylesVariations","navigationMenus","per_page","status","order","orderby","length","showNavigationScreen","process","env","IS_GUTENBERG_PLUGIN"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,MAAjB,EAAyBC,UAAzB,EAAqCC,MAArC,EAA6CC,IAA7C,QAAyD,kBAAzD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AAEA,eAAe,SAASC,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MAAmDP,SAAS,CAC/DQ,MAAF,IAAc;AAAA;;AACb,UAAM;AACLC,MAAAA,gBADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEN,SAAF,CAHV,CADa,CAKb;AACA;;AACA,UAAMS,eAAe,GAAGF,gBAAgB,CACvC,UADuC,EAEvC,eAFuC,EAGvC;AACCG,MAAAA,QAAQ,EAAE,CADX;AAECC,MAAAA,MAAM,EAAE,SAFT;AAGCC,MAAAA,KAAK,EAAE,MAHR;AAICC,MAAAA,OAAO,EAAE;AAJV,KAHuC,CAAxC;AAUA,WAAO;AACNT,MAAAA,kBAAkB,EAAE,CAAC,EAAEK,eAAF,aAAEA,eAAF,eAAEA,eAAe,CAAEK,MAAnB,CADf;AAENT,MAAAA,wBAAwB,EACvB,CAAC,0BAAEG,mDAAmD,EAArD,iDAAE,qBACAM,MADF;AAHI,KAAP;AAMA,GAxBgE,EAyBjE,EAzBiE,CAAlE;AA2BA,QAAMC,oBAAoB,GAAGC,OAAO,CAACC,GAAR,CAAYC,mBAAZ,GAC1Bd,kBAD0B,GAE1B,KAFH;AAGA,SACC,cAAC,uBAAD;AACC,IAAA,MAAM,MADP;AAEC,IAAA,KAAK,EAAGZ,EAAE,CAAE,QAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CACf,kEADe,CAHjB;AAMC,IAAA,OAAO,EACN,cAAC,SAAD,QACGuB,oBAAoB,IACrB,cAAC,eAAD;AACC,MAAA,EAAE,EAAGb,qBADN;AAEC,MAAA,IAAI,EAAC,aAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGP;AAJR,OAMGH,EAAE,CAAE,YAAF,CANL,CAFF,EAWGa,wBAAwB,IACzB,cAAC,eAAD;AACC,MAAA,EAAE,EAAGH,qBADN;AAEC,MAAA,IAAI,EAAC,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGN;AAJR,OAMGJ,EAAE,CAAE,QAAF,CANL,CAZF,EAsBC,cAAC,eAAD;AACC,MAAA,EAAE,EAAGU,qBADN;AAEC,MAAA,IAAI,EAAC,OAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGL;AAJR,OAMGL,EAAE,CAAE,OAAF,CANL,CAtBD,EA8BC,cAAC,eAAD;AACC,MAAA,EAAE,EAAGU,qBADN;AAEC,MAAA,IAAI,EAAC,cAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGT;AAJR,OAMGD,EAAE,CAAE,WAAF,CANL,CA9BD,EAsCC,cAAC,eAAD;AACC,MAAA,EAAE,EAAGU,qBADN;AAEC,MAAA,IAAI,EAAC,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGR;AAJR,OAMGF,EAAE,CAAE,gBAAF,CANL,CAtCD;AAPF,IADD;AA0DA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalNavigatorButton as NavigatorButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { hasNavigationMenus, hasGlobalStyleVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEntityRecords,\n\t\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t\t} = select( coreStore );\n\t\t\t// The query needs to be the same as in the \"SidebarNavigationScreenNavigationMenus\" component,\n\t\t\t// to avoid double network calls.\n\t\t\tconst navigationMenus = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\t{\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\torder: 'desc',\n\t\t\t\t\torderby: 'date',\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn {\n\t\t\t\thasNavigationMenus: !! navigationMenus?.length,\n\t\t\t\thasGlobalStyleVariations:\n\t\t\t\t\t!! __experimentalGetCurrentThemeGlobalStylesVariations()\n\t\t\t\t\t\t?.length,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN\n\t\t? hasNavigationMenus\n\t\t: false;\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ showNavigationScreen && (\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/navigation\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t) }\n\t\t\t\t\t{ hasGlobalStyleVariations && (\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/wp_global_styles\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/page\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Pages' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/wp_template\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/wp_template_part\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template Parts' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t</ItemGroup>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -39,7 +39,7 @@ export default function SidebarNavigationScreenNavigationItem() {
|
|
|
39
39
|
label: __('Edit'),
|
|
40
40
|
icon: pencil
|
|
41
41
|
}),
|
|
42
|
-
description:
|
|
42
|
+
description: __('Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'),
|
|
43
43
|
content: createElement(Fragment, null, record !== null && record !== void 0 && record.link ? createElement(ExternalLink, {
|
|
44
44
|
className: "edit-site-sidebar-navigation-screen__page-link",
|
|
45
45
|
href: record.link
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["__","useDispatch","__experimentalUseNavigator","useNavigator","ExternalLink","useEntityRecord","decodeEntities","pencil","SidebarNavigationScreen","unlock","store","editSiteStore","SidebarButton","SidebarNavigationScreenNavigationItem","setCanvasMode","params","postType","postId","record","title","rendered","link","description"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SACCC,0BAA0B,IAAIC,YAD/B,EAECC,YAFD,QAGO,uBAHP;AAIA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,MAAT,QAAuB,kBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEA,eAAe,SAASC,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoBL,MAAM,CAAER,WAAW,CAAEU,aAAF,CAAb,CAAhC;AACA,QAAM;AACLI,IAAAA,MAAM,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AADH,MAEFd,YAAY,EAFhB;AAGA,QAAM;AAAEe,IAAAA;AAAF,MAAab,eAAe,CAAE,UAAF,EAAcW,QAAd,EAAwBC,MAAxB,CAAlC;AAEA,SACC,cAAC,uBAAD;AACC,IAAA,KAAK,EAAGC,MAAM,GAAGZ,cAAc,CAAEY,MAAF,aAAEA,MAAF,wCAAEA,MAAM,CAAEC,KAAV,kDAAE,cAAeC,QAAjB,CAAjB,GAA+C,IAD9D;AAEC,IAAA,OAAO,EACN,cAAC,aAAD;AACC,MAAA,OAAO,EAAG,MAAMN,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAGd,EAAE,CAAE,MAAF,CAFX;AAGC,MAAA,IAAI,EAAGO;AAHR,MAHF;AASC,IAAA,WAAW,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["__","useDispatch","__experimentalUseNavigator","useNavigator","ExternalLink","useEntityRecord","decodeEntities","pencil","SidebarNavigationScreen","unlock","store","editSiteStore","SidebarButton","SidebarNavigationScreenNavigationItem","setCanvasMode","params","postType","postId","record","title","rendered","link","description"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SACCC,0BAA0B,IAAIC,YAD/B,EAECC,YAFD,QAGO,uBAHP;AAIA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,MAAT,QAAuB,kBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEA,eAAe,SAASC,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoBL,MAAM,CAAER,WAAW,CAAEU,aAAF,CAAb,CAAhC;AACA,QAAM;AACLI,IAAAA,MAAM,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AADH,MAEFd,YAAY,EAFhB;AAGA,QAAM;AAAEe,IAAAA;AAAF,MAAab,eAAe,CAAE,UAAF,EAAcW,QAAd,EAAwBC,MAAxB,CAAlC;AAEA,SACC,cAAC,uBAAD;AACC,IAAA,KAAK,EAAGC,MAAM,GAAGZ,cAAc,CAAEY,MAAF,aAAEA,MAAF,wCAAEA,MAAM,CAAEC,KAAV,kDAAE,cAAeC,QAAjB,CAAjB,GAA+C,IAD9D;AAEC,IAAA,OAAO,EACN,cAAC,aAAD;AACC,MAAA,OAAO,EAAG,MAAMN,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAGd,EAAE,CAAE,MAAF,CAFX;AAGC,MAAA,IAAI,EAAGO;AAHR,MAHF;AASC,IAAA,WAAW,EAAGP,EAAE,CACf,oGADe,CATjB;AAYC,IAAA,OAAO,EACN,8BACGkB,MAAM,SAAN,IAAAA,MAAM,WAAN,IAAAA,MAAM,CAAEG,IAAR,GACD,cAAC,YAAD;AACC,MAAA,SAAS,EAAC,gDADX;AAEC,MAAA,IAAI,EAAGH,MAAM,CAACG;AAFf,OAIGH,MAAM,CAACG,IAJV,CADC,GAOE,IARL,EASGH,MAAM,GACLZ,cAAc,CAAEY,MAAF,aAAEA,MAAF,8CAAEA,MAAM,CAAEI,WAAV,wDAAE,oBAAqBF,QAAvB,CADT,GAEL,IAXJ;AAbF,IADD;AA8BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tExternalLink,\n} from '@wordpress/components';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreenNavigationItem() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postType, postId },\n\t} = useNavigator();\n\tconst { record } = useEntityRecord( 'postType', postType, postId );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ record ? decodeEntities( record?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tdescription={ __(\n\t\t\t\t'Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ record?.link ? (\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\t\t\thref={ record.link }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ record.link }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ record\n\t\t\t\t\t\t? decodeEntities( record?.description?.rendered )\n\t\t\t\t\t\t: null }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|