@wordpress/edit-site 5.3.2 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/build/components/add-new-template/new-template-part.js +8 -5
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +9 -25
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +4 -3
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +3 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/editor/index.js +28 -24
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +6 -6
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +7 -4
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/color-utils.js +1 -1
- package/build/components/global-styles/color-utils.js.map +1 -1
- package/build/components/global-styles/context-menu.js +16 -3
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +3 -3
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +10 -9
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +2 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +10 -5
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +4 -2
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +16 -53
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +5 -3
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +2 -2
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +5 -4
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +14 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +9 -7
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +10 -8
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +5 -5
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +10 -8
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +5 -4
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +2 -2
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +5 -4
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +4 -5
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/subtitle.js +3 -2
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +24 -301
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +3 -10
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +2 -2
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +6 -3
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/layout/index.js +10 -23
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +1 -1
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/table.js +1 -0
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-inspector/index.js +0 -29
- package/build/components/navigation-inspector/index.js.map +1 -1
- package/build/components/navigation-inspector/navigation-menu.js +6 -4
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build/components/save-panel/index.js +4 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +18 -23
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -1
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-card/index.js +9 -2
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js +84 -0
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +28 -7
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +72 -0
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +70 -0
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +32 -82
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +43 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build/components/site-hub/index.js +14 -49
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +175 -0
- package/build/components/start-template-options/index.js.map +1 -0
- package/build/components/style-book/index.js +10 -3
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -20
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -3
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +12 -12
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build/components/use-edited-entity-record/index.js +6 -2
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +7 -6
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/{experiments.js → private-apis.js} +3 -3
- package/build/private-apis.js.map +1 -0
- package/build/store/index.js +3 -3
- package/build/store/index.js.map +1 -1
- package/build/utils/get-is-list-page.js +5 -6
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +7 -4
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +8 -22
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +2 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +3 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +27 -25
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +8 -8
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +8 -5
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/color-utils.js +2 -2
- package/build-module/components/global-styles/color-utils.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +13 -2
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +4 -4
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +12 -11
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +3 -3
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +11 -6
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +5 -3
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +15 -52
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +2 -2
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +6 -4
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +3 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +7 -6
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +12 -3
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +11 -9
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +12 -10
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +5 -5
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +12 -10
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -6
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +3 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +3 -3
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +7 -6
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -4
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +6 -7
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +3 -2
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +29 -302
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +3 -3
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -11
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +3 -3
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +6 -3
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/layout/index.js +10 -23
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +1 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/table.js +1 -0
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-inspector/index.js +0 -27
- package/build-module/components/navigation-inspector/index.js.map +1 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +7 -5
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build-module/components/save-panel/index.js +3 -2
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +15 -21
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-card/index.js +9 -4
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js +70 -0
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +27 -9
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +55 -0
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +53 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +34 -81
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +14 -46
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +156 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- package/build-module/components/style-book/index.js +11 -4
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -21
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +11 -11
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build-module/components/use-edited-entity-record/index.js +6 -2
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +9 -8
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/{experiments.js → private-apis.js} +2 -2
- package/build-module/private-apis.js.map +1 -0
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +5 -6
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +91 -41
- package/build-style/style.css +91 -41
- package/package.json +31 -31
- package/src/components/add-new-template/new-template-part.js +7 -4
- package/src/components/add-new-template/new-template.js +9 -22
- package/src/components/app/index.js +0 -1
- package/src/components/block-editor/editor-canvas.js +2 -1
- package/src/components/block-editor/index.js +3 -3
- package/src/components/editor/index.js +31 -28
- package/src/components/global-styles/border-panel.js +8 -8
- package/src/components/global-styles/color-palette-panel.js +6 -3
- package/src/components/global-styles/color-utils.js +2 -3
- package/src/components/global-styles/context-menu.js +17 -2
- package/src/components/global-styles/custom-css.js +4 -4
- package/src/components/global-styles/dimensions-panel.js +15 -11
- package/src/components/global-styles/global-styles-provider.js +3 -3
- package/src/components/global-styles/gradients-palette-panel.js +7 -4
- package/src/components/global-styles/header.js +9 -3
- package/src/components/global-styles/hooks.js +20 -93
- package/src/components/global-styles/navigation-button.js +4 -2
- package/src/components/global-styles/palette.js +4 -4
- package/src/components/global-styles/preview.js +3 -3
- package/src/components/global-styles/screen-background-color.js +6 -5
- package/src/components/global-styles/screen-block-list.js +19 -3
- package/src/components/global-styles/screen-button-color.js +11 -9
- package/src/components/global-styles/screen-colors.js +10 -10
- package/src/components/global-styles/screen-css.js +14 -7
- package/src/components/global-styles/screen-heading-color.js +12 -10
- package/src/components/global-styles/screen-link-color.js +6 -5
- package/src/components/global-styles/screen-root.js +3 -3
- package/src/components/global-styles/screen-style-variations.js +3 -3
- package/src/components/global-styles/screen-text-color.js +6 -5
- package/src/components/global-styles/screen-typography.js +4 -4
- package/src/components/global-styles/shadow-panel.js +9 -6
- package/src/components/global-styles/style.scss +7 -1
- package/src/components/global-styles/subtitle.js +5 -2
- package/src/components/global-styles/typography-panel.js +31 -395
- package/src/components/global-styles/typography-preview.js +3 -3
- package/src/components/global-styles/ui.js +3 -8
- package/src/components/global-styles-renderer/index.js +3 -3
- package/src/components/header-edit-mode/index.js +6 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/src/components/layout/index.js +35 -48
- package/src/components/layout/style.scss +11 -23
- package/src/components/list/actions/rename-menu-item.js +1 -1
- package/src/components/list/table.js +4 -0
- package/src/components/navigation-inspector/index.js +0 -32
- package/src/components/navigation-inspector/navigation-menu.js +10 -4
- package/src/components/save-panel/index.js +4 -1
- package/src/components/sidebar/index.js +14 -19
- package/src/components/sidebar-edit-mode/index.js +1 -1
- package/src/components/sidebar-edit-mode/template-card/index.js +24 -14
- package/src/components/sidebar-edit-mode/template-card/last-revision.js +75 -0
- package/src/components/sidebar-edit-mode/template-card/style.scss +4 -0
- package/src/components/sidebar-navigation-screen/index.js +27 -11
- package/src/components/sidebar-navigation-screen/style.scss +4 -6
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +52 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-template/index.js +52 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +49 -83
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/src/components/site-hub/index.js +67 -122
- package/src/components/site-hub/style.scss +1 -11
- package/src/components/start-template-options/index.js +171 -0
- package/src/components/start-template-options/style.scss +76 -0
- package/src/components/style-book/index.js +11 -7
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +48 -14
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/src/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +10 -10
- package/src/components/use-edited-entity-record/index.js +6 -2
- package/src/hooks/push-changes-to-global-styles/index.js +29 -24
- package/src/{experiments.js → private-apis.js} +1 -1
- package/src/store/index.js +1 -1
- package/src/style.scss +1 -0
- package/src/utils/get-is-list-page.js +5 -5
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build/experiments.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build-module/experiments.js.map +0 -1
|
@@ -3,14 +3,14 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { privateApis as blockEditorPrivateApis, store as blockEditorStore } from '@wordpress/block-editor';
|
|
7
7
|
import { useEffect } from '@wordpress/element';
|
|
8
8
|
import { useDispatch } from '@wordpress/data';
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { unlock } from '../../
|
|
13
|
+
import { unlock } from '../../private-apis';
|
|
14
14
|
const ALLOWED_BLOCKS = {
|
|
15
15
|
'core/navigation': ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'],
|
|
16
16
|
'core/social-links': ['core/social-link'],
|
|
@@ -26,8 +26,9 @@ export default function NavigationMenu(_ref) {
|
|
|
26
26
|
updateBlockListSettings
|
|
27
27
|
} = useDispatch(blockEditorStore);
|
|
28
28
|
const {
|
|
29
|
-
OffCanvasEditor
|
|
30
|
-
|
|
29
|
+
OffCanvasEditor,
|
|
30
|
+
LeafMoreMenu
|
|
31
|
+
} = unlock(blockEditorPrivateApis); //TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
|
|
31
32
|
//Think through a better way of doing this, possible with adding allowed blocks to block library metadata
|
|
32
33
|
|
|
33
34
|
useEffect(() => {
|
|
@@ -44,7 +45,8 @@ export default function NavigationMenu(_ref) {
|
|
|
44
45
|
}, [updateBlockListSettings, innerBlocks]);
|
|
45
46
|
return createElement(OffCanvasEditor, {
|
|
46
47
|
blocks: innerBlocks,
|
|
47
|
-
onSelect: onSelect
|
|
48
|
+
onSelect: onSelect,
|
|
49
|
+
LeafMoreMenu: LeafMoreMenu
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
//# sourceMappingURL=navigation-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-inspector/navigation-menu.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-inspector/navigation-menu.js"],"names":["privateApis","blockEditorPrivateApis","store","blockEditorStore","useEffect","useDispatch","unlock","ALLOWED_BLOCKS","NavigationMenu","innerBlocks","onSelect","updateBlockListSettings","OffCanvasEditor","LeafMoreMenu","allowedBlocks","forEach","block","name","clientId"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,sBADhB,EAECC,KAAK,IAAIC,gBAFV,QAGO,yBAHP;AAIA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAMC,cAAc,GAAG;AACtB,qBAAmB,CAClB,sBADkB,EAElB,aAFkB,EAGlB,mBAHkB,EAIlB,gBAJkB,EAKlB,aALkB,EAMlB,gBANkB,EAOlB,iBAPkB,EAQlB,gBARkB,EASlB,yBATkB,CADG;AAYtB,uBAAqB,CAAE,kBAAF,CAZC;AAatB,6BAA2B,CAC1B,sBAD0B,EAE1B,yBAF0B,CAbL;AAiBtB,0BAAwB,CACvB,sBADuB,EAEvB,yBAFuB;AAjBF,CAAvB;AAuBA,eAAe,SAASC,cAAT,OAAqD;AAAA,MAA5B;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,GAA4B;AACnE,QAAM;AAAEC,IAAAA;AAAF,MAA8BN,WAAW,CAAEF,gBAAF,CAA/C;AAEA,QAAM;AAAES,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB,MAAoCP,MAAM,CAAEL,sBAAF,CAAhD,CAHmE,CAKnE;AACA;;AACAG,EAAAA,SAAS,CAAE,MAAM;AAChBO,IAAAA,uBAAuB,CAAE,EAAF,EAAM;AAC5BG,MAAAA,aAAa,EAAEP,cAAc,CAAE,iBAAF;AADD,KAAN,CAAvB;AAGAE,IAAAA,WAAW,CAACM,OAAZ,CAAuBC,KAAF,IAAa;AACjC,UAAKT,cAAc,CAAES,KAAK,CAACC,IAAR,CAAnB,EAAoC;AACnCN,QAAAA,uBAAuB,CAAEK,KAAK,CAACE,QAAR,EAAkB;AACxCJ,UAAAA,aAAa,EAAEP,cAAc,CAAES,KAAK,CAACC,IAAR;AADW,SAAlB,CAAvB;AAGA;AACD,KAND;AAOA,GAXQ,EAWN,CAAEN,uBAAF,EAA2BF,WAA3B,CAXM,CAAT;AAaA,SACC,cAAC,eAAD;AACC,IAAA,MAAM,EAAGA,WADV;AAEC,IAAA,QAAQ,EAAGC,QAFZ;AAGC,IAAA,YAAY,EAAGG;AAHhB,IADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst ALLOWED_BLOCKS = {\n\t'core/navigation': [\n\t\t'core/navigation-link',\n\t\t'core/search',\n\t\t'core/social-links',\n\t\t'core/page-list',\n\t\t'core/spacer',\n\t\t'core/home-link',\n\t\t'core/site-title',\n\t\t'core/site-logo',\n\t\t'core/navigation-submenu',\n\t],\n\t'core/social-links': [ 'core/social-link' ],\n\t'core/navigation-submenu': [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t],\n\t'core/navigation-link': [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t],\n};\n\nexport default function NavigationMenu( { innerBlocks, onSelect } ) {\n\tconst { updateBlockListSettings } = useDispatch( blockEditorStore );\n\n\tconst { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );\n\n\t//TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList\n\t//Think through a better way of doing this, possible with adding allowed blocks to block library metadata\n\tuseEffect( () => {\n\t\tupdateBlockListSettings( '', {\n\t\t\tallowedBlocks: ALLOWED_BLOCKS[ 'core/navigation' ],\n\t\t} );\n\t\tinnerBlocks.forEach( ( block ) => {\n\t\t\tif ( ALLOWED_BLOCKS[ block.name ] ) {\n\t\t\t\tupdateBlockListSettings( block.clientId, {\n\t\t\t\t\tallowedBlocks: ALLOWED_BLOCKS[ block.name ],\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}, [ updateBlockListSettings, innerBlocks ] );\n\n\treturn (\n\t\t<OffCanvasEditor\n\t\t\tblocks={ innerBlocks }\n\t\t\tonSelect={ onSelect }\n\t\t\tLeafMoreMenu={ LeafMoreMenu }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -13,7 +13,7 @@ import { NavigableRegion } from '@wordpress/interface';
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { store as editSiteStore } from '../../store';
|
|
16
|
-
import { unlock } from '../../
|
|
16
|
+
import { unlock } from '../../private-apis';
|
|
17
17
|
export default function SavePanel() {
|
|
18
18
|
const {
|
|
19
19
|
isSaveViewOpen,
|
|
@@ -40,7 +40,8 @@ export default function SavePanel() {
|
|
|
40
40
|
return isSaveViewOpen ? createElement(Modal, {
|
|
41
41
|
className: "edit-site-save-panel__modal",
|
|
42
42
|
onRequestClose: onClose,
|
|
43
|
-
__experimentalHideHeader: true
|
|
43
|
+
__experimentalHideHeader: true,
|
|
44
|
+
contentLabel: __('Save site, content, and template changes')
|
|
44
45
|
}, createElement(EntitiesSavedStates, {
|
|
45
46
|
close: onClose
|
|
46
47
|
})) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["Button","Modal","EntitiesSavedStates","useDispatch","useSelect","__","NavigableRegion","store","editSiteStore","unlock","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,sBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["Button","Modal","EntitiesSavedStates","useDispatch","useSelect","__","NavigableRegion","store","editSiteStore","unlock","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,KAAjB,QAA8B,uBAA9B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,sBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,eAAe,SAASC,SAAT,GAAqB;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAiCR,SAAS,CAAIS,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAsCN,MAAM,CACjDI,MAAM,CAAEL,aAAF,CAD2C,CAAlD,CAD+D,CAK/D;AACA;;AACA,WAAO;AACNG,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,UAAU,EAAEG,aAAa;AAFnB,KAAP;AAIA,GAX+C,EAW7C,EAX6C,CAAhD;AAYA,QAAM;AAAEC,IAAAA;AAAF,MAA0Bb,WAAW,CAAEK,aAAF,CAA3C;;AACA,QAAMS,OAAO,GAAG,MAAMD,mBAAmB,CAAE,KAAF,CAAzC;;AAEA,MAAKJ,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,cAAC,KAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGM,OAFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAGZ,EAAE,CAChB,0CADgB;AAJlB,OAQC,cAAC,mBAAD;AAAqB,MAAA,KAAK,EAAGY;AAA7B,MARD,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,cAAC,eAAD;AACC,IAAA,SAAS,EAAC,2BADX;AAEC,IAAA,SAAS,EAAGZ,EAAE,CAAE,cAAF;AAFf,KAIGM,cAAc,GACf,cAAC,mBAAD;AAAqB,IAAA,KAAK,EAAGM;AAA7B,IADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMD,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMGX,EAAE,CAAE,iBAAF,CANL,CADD,CAPF,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport { EntitiesSavedStates } from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<EntitiesSavedStates close={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName=\"edit-site-layout__actions\"\n\t\t\tariaLabel={ __( 'Save sidebar' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<EntitiesSavedStates close={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
|
|
@@ -4,48 +4,42 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { memo } from '@wordpress/element';
|
|
7
|
-
import { useSelect } from '@wordpress/data';
|
|
8
7
|
import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';
|
|
9
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
10
8
|
/**
|
|
11
9
|
* Internal dependencies
|
|
12
10
|
*/
|
|
13
11
|
|
|
14
12
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
15
13
|
import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
|
|
16
|
-
import
|
|
14
|
+
import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
|
|
15
|
+
import useSyncPathWithURL from '../sync-state-with-url/use-sync-path-with-url';
|
|
17
16
|
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
17
|
+
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
18
18
|
import SaveButton from '../save-button';
|
|
19
|
+
import SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';
|
|
19
20
|
|
|
20
21
|
function SidebarScreens() {
|
|
21
|
-
|
|
22
|
-
return createElement(Fragment, null, createElement(SidebarNavigationScreenMain, null), createElement(SidebarNavigationScreenNavigationMenus, null), createElement(SidebarNavigationScreenTemplates, {
|
|
22
|
+
useSyncPathWithURL();
|
|
23
|
+
return createElement(Fragment, null, createElement(SidebarNavigationScreenMain, null), createElement(SidebarNavigationScreenNavigationMenus, null), createElement(SidebarNavigationScreenNavigationItem, null), createElement(SidebarNavigationScreenTemplates, {
|
|
23
24
|
postType: "wp_template"
|
|
24
25
|
}), createElement(SidebarNavigationScreenTemplates, {
|
|
25
26
|
postType: "wp_template_part"
|
|
27
|
+
}), createElement(SidebarNavigationScreenTemplate, {
|
|
28
|
+
postType: "wp_template"
|
|
29
|
+
}), createElement(SidebarNavigationScreenTemplate, {
|
|
30
|
+
postType: "wp_template_part"
|
|
31
|
+
}), createElement(SidebarNavigationScreenTemplatesBrowse, {
|
|
32
|
+
postType: "wp_template"
|
|
33
|
+
}), createElement(SidebarNavigationScreenTemplatesBrowse, {
|
|
34
|
+
postType: "wp_template_part"
|
|
26
35
|
}));
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
function Sidebar() {
|
|
30
|
-
const {
|
|
31
|
-
isDirty
|
|
32
|
-
} = useSelect(select => {
|
|
33
|
-
const {
|
|
34
|
-
__experimentalGetDirtyEntityRecords
|
|
35
|
-
} = select(coreStore);
|
|
36
|
-
|
|
37
|
-
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); // The currently selected entity to display.
|
|
38
|
-
// Typically template or template part in the site editor.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
isDirty: dirtyEntityRecords.length > 0
|
|
43
|
-
};
|
|
44
|
-
}, []);
|
|
45
39
|
return createElement(Fragment, null, createElement(NavigatorProvider, {
|
|
46
40
|
className: "edit-site-sidebar__content",
|
|
47
41
|
initialPath: "/"
|
|
48
|
-
}, createElement(SidebarScreens, null)),
|
|
42
|
+
}, createElement(SidebarScreens, null)), createElement("div", {
|
|
49
43
|
className: "edit-site-sidebar__footer"
|
|
50
44
|
}, createElement(SaveButton, null)));
|
|
51
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","__experimentalNavigatorProvider","NavigatorProvider","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","useSyncPathWithURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenTemplatesBrowse","SaveButton","SidebarNavigationScreenNavigationItem","SidebarScreens","Sidebar"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,oBAArB;AACA,SAASC,+BAA+B,IAAIC,iBAA5C,QAAqE,uBAArE;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,wCAA7C;AACA,OAAOC,+BAAP,MAA4C,uCAA5C;AACA,OAAOC,kBAAP,MAA+B,+CAA/B;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,qCAAP,MAAkD,8CAAlD;;AAEA,SAASC,cAAT,GAA0B;AACzBL,EAAAA,kBAAkB;AAElB,SACC,8BACC,cAAC,2BAAD,OADD,EAEC,cAAC,sCAAD,OAFD,EAGC,cAAC,qCAAD,OAHD,EAIC,cAAC,gCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAJD,EAKC,cAAC,gCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IALD,EAMC,cAAC,+BAAD;AAAiC,IAAA,QAAQ,EAAC;AAA1C,IAND,EAOC,cAAC,+BAAD;AAAiC,IAAA,QAAQ,EAAC;AAA1C,IAPD,EAQC,cAAC,sCAAD;AAAwC,IAAA,QAAQ,EAAC;AAAjD,IARD,EASC,cAAC,sCAAD;AAAwC,IAAA,QAAQ,EAAC;AAAjD,IATD,CADD;AAaA;;AAED,SAASM,OAAT,GAAmB;AAClB,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAC;AAFb,KAIC,cAAC,cAAD,OAJD,CADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,UAAD,OADD,CARD,CADD;AAcA;;AAED,eAAeZ,IAAI,CAAEY,OAAF,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';\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 from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveButton from '../save-button';\nimport SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenMain />\n\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t<SidebarNavigationScreenNavigationItem />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template_part\" />\n\t\t\t<SidebarNavigationScreenTemplate postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplate postType=\"wp_template_part\" />\n\t\t\t<SidebarNavigationScreenTemplatesBrowse postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplatesBrowse postType=\"wp_template_part\" />\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath=\"/\"\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\n\t\t\t<div className=\"edit-site-sidebar__footer\">\n\t\t\t\t<SaveButton />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
|
|
@@ -67,7 +67,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
67
67
|
identifier: sidebarName,
|
|
68
68
|
title: __('Settings'),
|
|
69
69
|
icon: isRTL() ? drawerLeft : drawerRight,
|
|
70
|
-
closeLabel: __('Close settings
|
|
70
|
+
closeLabel: __('Close settings'),
|
|
71
71
|
header: createElement(SettingsHeader, {
|
|
72
72
|
sidebarName: sidebarName
|
|
73
73
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["createSlotFill","PanelBody","isRTL","__","drawerLeft","drawerRight","useEffect","Fragment","useSelect","useDispatch","store","interfaceStore","blockEditorStore","DefaultSidebar","GlobalStylesSidebar","STORE_NAME","SettingsHeader","TemplateCard","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,QAA0C,uBAA1C;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,kBAAxC;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;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,iBAAzB;AACA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,aAAhD;AACA,SAAST,KAAK,IAAIU,aAAlB,QAAuC,aAAvC;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EA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AlB;;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,EAAGtC,EAAE,CAAE,UAAF,CAFX;AAGC,IAAA,IAAI,EAAGD,KAAK,KAAKE,UAAL,GAAkBC,WAH/B;AAIC,IAAA,UAAU,EAAGF,EAAE,CAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["createSlotFill","PanelBody","isRTL","__","drawerLeft","drawerRight","useEffect","Fragment","useSelect","useDispatch","store","interfaceStore","blockEditorStore","DefaultSidebar","GlobalStylesSidebar","STORE_NAME","SettingsHeader","TemplateCard","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,QAA0C,uBAA1C;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,kBAAxC;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;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,UAA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AL,EAAyB;AACxBW,MAAAA,uBAAuB,CAAEzB,UAAF,EAAcG,aAAd,CAAvB;AACA,KAFD,MAEO;AACNsB,MAAAA,uBAAuB,CAAEzB,UAAF,EAAcI,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,EAAGtC,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,EAAGsC;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKtB,gBAAhB,IACD,cAAC,SAAD,QACC,cAAC,YAAD,OADD,CATF,EAaGsB,WAAW,KAAKvB,aAAhB,IACD,cAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAdF,CADD,EAkBGY,oBAAoB,IAAI,cAAC,mBAAD,OAlB3B,CADD;AAsBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useEffect, Fragment } 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 TemplateCard from './template-card';\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<PanelBody>\n\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t</PanelBody>\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"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
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 { __ } from '@wordpress/i18n';
|
|
6
7
|
import { useSelect } from '@wordpress/data';
|
|
7
|
-
import { Icon } from '@wordpress/components';
|
|
8
|
+
import { PanelRow, Icon } from '@wordpress/components';
|
|
8
9
|
import { store as editorStore } from '@wordpress/editor';
|
|
9
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
11
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -15,6 +16,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
15
16
|
import { store as editSiteStore } from '../../../store';
|
|
16
17
|
import TemplateActions from './template-actions';
|
|
17
18
|
import TemplateAreas from './template-areas';
|
|
19
|
+
import LastRevision from './last-revision';
|
|
18
20
|
export default function TemplateCard() {
|
|
19
21
|
const {
|
|
20
22
|
info: {
|
|
@@ -48,7 +50,7 @@ export default function TemplateCard() {
|
|
|
48
50
|
return null;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
return createElement("div", {
|
|
53
|
+
return createElement(Fragment, null, createElement("div", {
|
|
52
54
|
className: "edit-site-template-card"
|
|
53
55
|
}, createElement(Icon, {
|
|
54
56
|
className: "edit-site-template-card__icon",
|
|
@@ -63,6 +65,9 @@ export default function TemplateCard() {
|
|
|
63
65
|
template: template
|
|
64
66
|
})), createElement("div", {
|
|
65
67
|
className: "edit-site-template-card__description"
|
|
66
|
-
}, decodeEntities(description)), createElement(TemplateAreas, null)))
|
|
68
|
+
}, decodeEntities(description)), createElement(TemplateAreas, null))), createElement(PanelRow, {
|
|
69
|
+
header: __('Editing history'),
|
|
70
|
+
className: "edit-site-template-revisions"
|
|
71
|
+
}, createElement(LastRevision, null)));
|
|
67
72
|
}
|
|
68
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-card/index.js"],"names":["__","useSelect","PanelRow","Icon","store","editorStore","coreStore","decodeEntities","editSiteStore","TemplateActions","TemplateAreas","LastRevision","TemplateCard","info","title","description","icon","template","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","__experimentalGetTemplateInfo","getTemplateInfo","postType","postId","record"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,QAAT,EAAmBC,IAAnB,QAA+B,uBAA/B;AACA,SAASC,KAAK,IAAIC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AAI,EAAGC;AAAvD,IADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGT,cAAc,CAAEO,KAAF,CADjB,CADD,EAIC,cAAC,eAAD;AAAiB,IAAA,QAAQ,EAAGG;AAA5B,IAJD,CADD,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGV,cAAc,CAAEQ,WAAF,CADjB,CAPD,EAUC,cAAC,aAAD,OAVD,CAFD,CADD,EAgBC,cAAC,QAAD;AACC,IAAA,MAAM,EAAGf,EAAE,CAAE,iBAAF,CADZ;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,cAAC,YAAD,OAJD,CAhBD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelRow, 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';\nimport LastRevision from './last-revision';\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\t<PanelRow\n\t\t\t\theader={ __( 'Editing history' ) }\n\t\t\t\tclassName=\"edit-site-template-revisions\"\n\t\t\t>\n\t\t\t\t<LastRevision />\n\t\t\t</PanelRow>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { Button } from '@wordpress/components';
|
|
7
|
+
import { sprintf, _n } from '@wordpress/i18n';
|
|
8
|
+
import { backup } from '@wordpress/icons';
|
|
9
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
10
|
+
import { PostTypeSupportCheck } from '@wordpress/editor';
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import useEditedEntityRecord from '../../use-edited-entity-record';
|
|
16
|
+
|
|
17
|
+
const useRevisionData = () => {
|
|
18
|
+
var _currentTemplate$_lin, _currentTemplate$_lin2, _currentTemplate$_lin3, _currentTemplate$_lin4, _currentTemplate$_lin5, _currentTemplate$_lin6, _currentTemplate$_lin7, _currentTemplate$_lin8;
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
record: currentTemplate
|
|
22
|
+
} = useEditedEntityRecord();
|
|
23
|
+
const lastRevisionId = (_currentTemplate$_lin = currentTemplate === null || currentTemplate === void 0 ? void 0 : (_currentTemplate$_lin2 = currentTemplate._links) === null || _currentTemplate$_lin2 === void 0 ? void 0 : (_currentTemplate$_lin3 = _currentTemplate$_lin2['predecessor-version']) === null || _currentTemplate$_lin3 === void 0 ? void 0 : (_currentTemplate$_lin4 = _currentTemplate$_lin3[0]) === null || _currentTemplate$_lin4 === void 0 ? void 0 : _currentTemplate$_lin4.id) !== null && _currentTemplate$_lin !== void 0 ? _currentTemplate$_lin : null;
|
|
24
|
+
const revisionsCount = ((_currentTemplate$_lin5 = currentTemplate === null || currentTemplate === void 0 ? void 0 : (_currentTemplate$_lin6 = currentTemplate._links) === null || _currentTemplate$_lin6 === void 0 ? void 0 : (_currentTemplate$_lin7 = _currentTemplate$_lin6['version-history']) === null || _currentTemplate$_lin7 === void 0 ? void 0 : (_currentTemplate$_lin8 = _currentTemplate$_lin7[0]) === null || _currentTemplate$_lin8 === void 0 ? void 0 : _currentTemplate$_lin8.count) !== null && _currentTemplate$_lin5 !== void 0 ? _currentTemplate$_lin5 : 0) + 1;
|
|
25
|
+
return {
|
|
26
|
+
currentTemplate,
|
|
27
|
+
lastRevisionId,
|
|
28
|
+
revisionsCount
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function PostLastRevisionCheck(_ref) {
|
|
33
|
+
let {
|
|
34
|
+
children
|
|
35
|
+
} = _ref;
|
|
36
|
+
const {
|
|
37
|
+
lastRevisionId,
|
|
38
|
+
revisionsCount
|
|
39
|
+
} = useRevisionData();
|
|
40
|
+
|
|
41
|
+
if (!lastRevisionId || revisionsCount < 2) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return createElement(PostTypeSupportCheck, {
|
|
46
|
+
supportKeys: "revisions"
|
|
47
|
+
}, children);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const PostLastRevision = () => {
|
|
51
|
+
const {
|
|
52
|
+
lastRevisionId,
|
|
53
|
+
revisionsCount
|
|
54
|
+
} = useRevisionData();
|
|
55
|
+
return createElement(PostLastRevisionCheck, null, createElement(Button, {
|
|
56
|
+
href: addQueryArgs('revision.php', {
|
|
57
|
+
revision: lastRevisionId,
|
|
58
|
+
gutenberg: true
|
|
59
|
+
}),
|
|
60
|
+
className: "edit-site-template-last-revision__title",
|
|
61
|
+
icon: backup
|
|
62
|
+
}, sprintf(
|
|
63
|
+
/* translators: %d: number of revisions */
|
|
64
|
+
_n('%d Revision', '%d Revisions', revisionsCount), revisionsCount)));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default function LastRevision() {
|
|
68
|
+
return createElement(PostLastRevisionCheck, null, createElement(PostLastRevision, null));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=last-revision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-card/last-revision.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,qF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,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"]}
|
|
@@ -3,17 +3,33 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { __experimentalHStack as HStack, __experimentalVStack as VStack,
|
|
7
|
-
import { isRTL, __
|
|
6
|
+
import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalNavigatorToParentButton as NavigatorToParentButton, Button, __experimentalNavigatorScreen as NavigatorScreen } from '@wordpress/components';
|
|
7
|
+
import { isRTL, __ } from '@wordpress/i18n';
|
|
8
8
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
9
|
+
import { useSelect } from '@wordpress/data';
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { store as editSiteStore } from '../../store';
|
|
15
|
+
import { unlock } from '../../private-apis';
|
|
9
16
|
export default function SidebarNavigationScreen(_ref) {
|
|
10
17
|
let {
|
|
11
18
|
path,
|
|
12
|
-
parentTitle,
|
|
13
19
|
title,
|
|
14
20
|
actions,
|
|
15
21
|
content
|
|
16
22
|
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
dashboardLink
|
|
25
|
+
} = useSelect(select => {
|
|
26
|
+
const {
|
|
27
|
+
getSettings
|
|
28
|
+
} = unlock(select(editSiteStore));
|
|
29
|
+
return {
|
|
30
|
+
dashboardLink: getSettings().__experimentalDashboardLink
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
17
33
|
return createElement(NavigatorScreen, {
|
|
18
34
|
className: "edit-site-sidebar-navigation-screen",
|
|
19
35
|
path: path
|
|
@@ -23,14 +39,16 @@ export default function SidebarNavigationScreen(_ref) {
|
|
|
23
39
|
spacing: 4,
|
|
24
40
|
justify: "flex-start",
|
|
25
41
|
className: "edit-site-sidebar-navigation-screen__title-icon"
|
|
26
|
-
},
|
|
42
|
+
}, path !== '/' ? createElement(NavigatorToParentButton, {
|
|
43
|
+
className: "edit-site-sidebar-navigation-screen__back",
|
|
44
|
+
icon: isRTL() ? chevronRight : chevronLeft,
|
|
45
|
+
"aria-label": __('Back')
|
|
46
|
+
}) : createElement(Button, {
|
|
27
47
|
className: "edit-site-sidebar-navigation-screen__back",
|
|
28
48
|
icon: isRTL() ? chevronRight : chevronLeft,
|
|
29
|
-
"aria-label":
|
|
30
|
-
|
|
31
|
-
__('
|
|
32
|
-
}) : createElement("div", {
|
|
33
|
-
className: "edit-site-sidebar-navigation-screen__icon-placeholder"
|
|
49
|
+
"aria-label": __('Navigate to the Dashboard'),
|
|
50
|
+
href: dashboardLink || 'index.php',
|
|
51
|
+
label: __('Dashboard')
|
|
34
52
|
}), createElement("h2", {
|
|
35
53
|
className: "edit-site-sidebar-navigation-screen__title"
|
|
36
54
|
}, title), actions), createElement("nav", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalNavigatorToParentButton","NavigatorToParentButton","Button","__experimentalNavigatorScreen","NavigatorScreen","isRTL","__","chevronRight","chevronLeft","useSelect","store","editSiteStore","unlock","SidebarNavigationScreen","path","title","actions","content","dashboardLink","select","getSettings","__experimentalDashboardLink"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,qCAAqC,IAAIC,uBAH1C,EAICC,MAJD,EAKCC,6BAA6B,IAAIC,eALlC,QAMO,uBANP;AAOA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kBAA1C;AAC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BGC,OAvBH,CADD,EA2BC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGC,OADH,CA3BD,CAJD,CADD;AAsCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\tButton,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nexport default function SidebarNavigationScreen( {\n\tpath,\n\ttitle,\n\tactions,\n\tcontent,\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\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen\"\n\t\t\tpath={ path }\n\t\t>\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ path !== '/' ? (\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__back\"\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\taria-label={ __( 'Back' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__back\"\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\taria-label={ __( 'Navigate to the Dashboard' ) }\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t\tlabel={ __( 'Dashboard' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<h2 className=\"edit-site-sidebar-navigation-screen__title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</h2>\n\t\t\t\t\t{ actions }\n\t\t\t\t</HStack>\n\n\t\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ content }\n\t\t\t\t</nav>\n\t\t\t</VStack>\n\t\t</NavigatorScreen>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
|
+
import { Button } from '@wordpress/components';
|
|
9
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
16
|
+
import { unlock } from '../../private-apis';
|
|
17
|
+
import { store as editSiteStore } from '../../store';
|
|
18
|
+
export default function SidebarNavigationScreenNavigationItem() {
|
|
19
|
+
var _post$title, _post$description;
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
setCanvasMode
|
|
23
|
+
} = unlock(useDispatch(editSiteStore));
|
|
24
|
+
const {
|
|
25
|
+
post
|
|
26
|
+
} = useSelect(select => {
|
|
27
|
+
var _getEditedPostContext;
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
getEditedPostContext
|
|
31
|
+
} = select(editSiteStore);
|
|
32
|
+
const {
|
|
33
|
+
getEntityRecord
|
|
34
|
+
} = select(coreStore);
|
|
35
|
+
const {
|
|
36
|
+
postType,
|
|
37
|
+
postId
|
|
38
|
+
} = (_getEditedPostContext = getEditedPostContext()) !== null && _getEditedPostContext !== void 0 ? _getEditedPostContext : {}; // The currently selected entity to display.
|
|
39
|
+
// Typically template or template part in the site editor.
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
post: postId && postType ? getEntityRecord('postType', postType, postId) : null
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
return createElement(SidebarNavigationScreen, {
|
|
46
|
+
path: "/navigation/single",
|
|
47
|
+
title: post ? decodeEntities(post === null || post === void 0 ? void 0 : (_post$title = post.title) === null || _post$title === void 0 ? void 0 : _post$title.rendered) : null,
|
|
48
|
+
actions: createElement(Button, {
|
|
49
|
+
variant: "primary",
|
|
50
|
+
onClick: () => setCanvasMode('edit')
|
|
51
|
+
}, __('Edit')),
|
|
52
|
+
content: post ? decodeEntities(post === null || post === void 0 ? void 0 : (_post$description = post.description) === null || _post$description === void 0 ? void 0 : _post$description.rendered) : null
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["__","useDispatch","useSelect","Button","store","coreStore","decodeEntities","SidebarNavigationScreen","unlock","editSiteStore","SidebarNavigationScreenNavigationItem","setCanvasMode","post","select","getEditedPostContext","getEntityRecord","postType","postId","title","rendered","description"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,OAAOC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**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nexport default function SidebarNavigationScreenNavigationItem() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst { post } = useSelect( ( select ) => {\n\t\tconst { getEditedPostContext } = select( editSiteStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst { postType, postId } = getEditedPostContext() ?? {};\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tpost:\n\t\t\t\tpostId && postType\n\t\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath=\"/navigation/single\"\n\t\t\ttitle={ post ? decodeEntities( post?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\tpost ? decodeEntities( post?.description?.rendered ) : null\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -22,13 +22,13 @@ export default function SidebarNavigationScreenNavigationMenus() {
|
|
|
22
22
|
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
|
23
23
|
history.push({
|
|
24
24
|
postType: attributes.type,
|
|
25
|
-
postId: attributes.id
|
|
25
|
+
postId: attributes.id,
|
|
26
|
+
path: '/navigation/single'
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
}, [history]);
|
|
29
30
|
return createElement(SidebarNavigationScreen, {
|
|
30
31
|
path: "/navigation",
|
|
31
|
-
parentTitle: __('Design'),
|
|
32
32
|
title: __('Navigation'),
|
|
33
33
|
content: createElement("div", {
|
|
34
34
|
className: "edit-site-sidebar-navigation-screen-navigation-menus"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["__","useCallback","SidebarNavigationScreen","NavigationInspector","useHistory","SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,oBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,UAAT,QAA2B,WAA3B;AAEA,eAAe,SAASC,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,QAAMG,QAAQ,GAAGN,WAAW,CACzBO,aAAF,IAAqB;AACpB,UAAM;AAAEC,MAAAA;AAAF,QAAiBD,aAAvB;;AACA,QACCC,UAAU,CAACC,IAAX,KAAoB,WAApB,IACAD,UAAU,CAACE,EADX,IAEAF,UAAU,CAACG,IAFX,IAGAN,OAJD,EAKE;AACDA,MAAAA,OAAO,CAACO,IAAR,CAAc;AACbC,QAAAA,QAAQ,EAAEL,UAAU,CAACG,IADR;AAEbG,QAAAA,MAAM,EAAEN,UAAU,CAACE;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["__","useCallback","SidebarNavigationScreen","NavigationInspector","useHistory","SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId","path"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,oBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,UAAT,QAA2B,WAA3B;AAEA,eAAe,SAASC,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,QAAMG,QAAQ,GAAGN,WAAW,CACzBO,aAAF,IAAqB;AACpB,UAAM;AAAEC,MAAAA;AAAF,QAAiBD,aAAvB;;AACA,QACCC,UAAU,CAACC,IAAX,KAAoB,WAApB,IACAD,UAAU,CAACE,EADX,IAEAF,UAAU,CAACG,IAFX,IAGAN,OAJD,EAKE;AACDA,MAAAA,OAAO,CAACO,IAAR,CAAc;AACbC,QAAAA,QAAQ,EAAEL,UAAU,CAACG,IADR;AAEbG,QAAAA,MAAM,EAAEN,UAAU,CAACE,EAFN;AAGbK,QAAAA,IAAI,EAAE;AAHO,OAAd;AAKA;AACD,GAf0B,EAgB3B,CAAEV,OAAF,CAhB2B,CAA5B;AAkBA,SACC,cAAC,uBAAD;AACC,IAAA,IAAI,EAAC,aADN;AAEC,IAAA,KAAK,EAAGN,EAAE,CAAE,YAAF,CAFX;AAGC,IAAA,OAAO,EACN;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,cAAC,mBAAD;AAAqB,MAAA,QAAQ,EAAGO;AAAhC,MADD;AAJF,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport NavigationInspector from '../navigation-inspector';\nimport { useHistory } from '../routes';\n\nexport default function SidebarNavigationScreenNavigationMenus() {\n\tconst history = useHistory();\n\tconst onSelect = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes } = selectedBlock;\n\t\t\tif (\n\t\t\t\tattributes.kind === 'post-type' &&\n\t\t\t\tattributes.id &&\n\t\t\t\tattributes.type &&\n\t\t\t\thistory\n\t\t\t) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType: attributes.type,\n\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\tpath: '/navigation/single',\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath=\"/navigation\"\n\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\tcontent={\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus\">\n\t\t\t\t\t<NavigationInspector onSelect={ onSelect } />\n\t\t\t\t</div>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|