@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened","onClose"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIe,SAASA,SAAT,GAAqB;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAiC,qBAAaC,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAsC,yBAC3CF,MAAM,CAAEG,YAAF,CADqC,CAA5C,CAD+D,CAK/D;AACA;;AACA,WAAO;AACNL,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,UAAU,EAAEG,aAAa;AAFnB,KAAP;AAIA,GAXsC,EAWpC,EAXoC,CAAvC;AAYA,QAAM;AAAEE,IAAAA;AAAF,MAA0B,uBAAaD,YAAb,CAAhC;;AACA,QAAME,OAAO,GAAG,MAAMD,mBAAmB,CAAE,KAAF,CAAzC;;AAEA,MAAKL,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGO,OAFlB;AAGC,MAAA,wBAAwB;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened","onClose"],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gB;AAJjB,KAMG,cAAI,iBAAJ,CANH,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"]}
|
|
@@ -9,22 +9,24 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _data = require("@wordpress/data");
|
|
13
|
-
|
|
14
12
|
var _components = require("@wordpress/components");
|
|
15
13
|
|
|
16
|
-
var _coreData = require("@wordpress/core-data");
|
|
17
|
-
|
|
18
14
|
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
19
15
|
|
|
20
16
|
var _sidebarNavigationScreenTemplates = _interopRequireDefault(require("../sidebar-navigation-screen-templates"));
|
|
21
17
|
|
|
22
|
-
var
|
|
18
|
+
var _sidebarNavigationScreenTemplate = _interopRequireDefault(require("../sidebar-navigation-screen-template"));
|
|
19
|
+
|
|
20
|
+
var _useSyncPathWithUrl = _interopRequireDefault(require("../sync-state-with-url/use-sync-path-with-url"));
|
|
23
21
|
|
|
24
22
|
var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
|
|
25
23
|
|
|
24
|
+
var _sidebarNavigationScreenTemplatesBrowse = _interopRequireDefault(require("../sidebar-navigation-screen-templates-browse"));
|
|
25
|
+
|
|
26
26
|
var _saveButton = _interopRequireDefault(require("../save-button"));
|
|
27
27
|
|
|
28
|
+
var _sidebarNavigationScreenNavigationItem = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-item"));
|
|
29
|
+
|
|
28
30
|
/**
|
|
29
31
|
* WordPress dependencies
|
|
30
32
|
*/
|
|
@@ -33,34 +35,27 @@ var _saveButton = _interopRequireDefault(require("../save-button"));
|
|
|
33
35
|
* Internal dependencies
|
|
34
36
|
*/
|
|
35
37
|
function SidebarScreens() {
|
|
36
|
-
(0,
|
|
37
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_sidebarNavigationScreenMain.default, null), (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.default, null), (0, _element.createElement)(_sidebarNavigationScreenTemplates.default, {
|
|
38
|
+
(0, _useSyncPathWithUrl.default)();
|
|
39
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_sidebarNavigationScreenMain.default, null), (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.default, null), (0, _element.createElement)(_sidebarNavigationScreenNavigationItem.default, null), (0, _element.createElement)(_sidebarNavigationScreenTemplates.default, {
|
|
38
40
|
postType: "wp_template"
|
|
39
41
|
}), (0, _element.createElement)(_sidebarNavigationScreenTemplates.default, {
|
|
40
42
|
postType: "wp_template_part"
|
|
43
|
+
}), (0, _element.createElement)(_sidebarNavigationScreenTemplate.default, {
|
|
44
|
+
postType: "wp_template"
|
|
45
|
+
}), (0, _element.createElement)(_sidebarNavigationScreenTemplate.default, {
|
|
46
|
+
postType: "wp_template_part"
|
|
47
|
+
}), (0, _element.createElement)(_sidebarNavigationScreenTemplatesBrowse.default, {
|
|
48
|
+
postType: "wp_template"
|
|
49
|
+
}), (0, _element.createElement)(_sidebarNavigationScreenTemplatesBrowse.default, {
|
|
50
|
+
postType: "wp_template_part"
|
|
41
51
|
}));
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
function Sidebar() {
|
|
45
|
-
const {
|
|
46
|
-
isDirty
|
|
47
|
-
} = (0, _data.useSelect)(select => {
|
|
48
|
-
const {
|
|
49
|
-
__experimentalGetDirtyEntityRecords
|
|
50
|
-
} = select(_coreData.store);
|
|
51
|
-
|
|
52
|
-
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); // The currently selected entity to display.
|
|
53
|
-
// Typically template or template part in the site editor.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
isDirty: dirtyEntityRecords.length > 0
|
|
58
|
-
};
|
|
59
|
-
}, []);
|
|
60
55
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalNavigatorProvider, {
|
|
61
56
|
className: "edit-site-sidebar__content",
|
|
62
57
|
initialPath: "/"
|
|
63
|
-
}, (0, _element.createElement)(SidebarScreens, null)),
|
|
58
|
+
}, (0, _element.createElement)(SidebarScreens, null)), (0, _element.createElement)("div", {
|
|
64
59
|
className: "edit-site-sidebar__footer"
|
|
65
60
|
}, (0, _element.createElement)(_saveButton.default, null)));
|
|
66
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAIA;AACA;AACA;AAUA,SAASA,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,oCAAD,OADD,EAEC,4BAAC,+CAAD,OAFD,EAGC,4BAAC,8CAAD,OAHD,EAIC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAJD,EAKC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IALD,EAMC,4BAAC,wCAAD;AAAiC,IAAA,QAAQ,EAAC;AAA1C,IAND,EAOC,4BAAC,wCAAD;AAAiC,IAAA,QAAQ,EAAC;AAA1C,IAPD,EAQC,4BAAC,+CAAD;AAAwC,IAAA,QAAQ,EAAC;AAAjD,IARD,EASC,4BAAC,+CAAD;AAAwC,IAAA,QAAQ,EAAC;AAAjD,IATD,CADD;AAaA;;AAED,SAASC,OAAT,GAAmB;AAClB,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAC;AAFb,KAIC,4BAAC,cAAD,OAJD,CADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,mBAAD,OADD,CARD,CADD;AAcA;;eAEc,mBAAMA,OAAN,C","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"]}
|
|
@@ -91,7 +91,7 @@ function SidebarComplementaryAreaFills() {
|
|
|
91
91
|
identifier: sidebarName,
|
|
92
92
|
title: (0, _i18n.__)('Settings'),
|
|
93
93
|
icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
|
|
94
|
-
closeLabel: (0, _i18n.__)('Close settings
|
|
94
|
+
closeLabel: (0, _i18n.__)('Close settings'),
|
|
95
95
|
header: (0, _element.createElement)(_settingsHeader.default, {
|
|
96
96
|
sidebarName: sidebarName
|
|
97
97
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","settings","editSiteStore","getSettings","blockEditorStore","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName","drawerLeft","drawerRight"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AASA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IAA+C,gCACpD,0BADoD,CAArD;AAGO,MAAMC,oBAAoB,GAAGD,aAA7B;;;AAEA,SAASE,6BAAT,GAAyC;AAC/C,QAAM;AACLC,IAAAA,OADK;AAELC,I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FT;AAGC,IAAA,IAAI,EAAG,qBAAUC,iBAAV,GAAuBC,kBAH/B;AAIC,IAAA,UAAU,EAAG,cAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","settings","editSiteStore","getSettings","blockEditorStore","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName","drawerLeft","drawerRight"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AASA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IAA+C,gCACpD,0BADoD,CAArD;AAGO,MAAMC,oBAAoB,GAAGD,aAA7B;;;AAEA,SAASE,6BAAT,GAAyC;AAC/C,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,qBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA;AAJK,MAKF,qBAAaC,MAAF,IAAc;AAC5B,UAAMC,QAAQ,GACbD,MAAM,CAAEE,gBAAF,CAAN,CAAyBC,0BAAzB,CAAqDC,qBAArD,CADD;;AAEA,UAAMC,sBAAsB,GAAG,CAC9BC,yBAD8B,EAE9BC,4BAF8B,EAG7BC,QAH6B,CAGnBP,QAHmB,CAA/B;;AAIA,UAAMQ,QAAQ,GAAGT,MAAM,CAAEU,YAAF,CAAN,CAAwBC,WAAxB,EAAjB;AACA,WAAO;AACNf,MAAAA,OAAO,EAAEK,QADH;AAENJ,MAAAA,qBAAqB,EAAEQ,sBAF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A","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"]}
|
|
@@ -9,6 +9,8 @@ exports.default = TemplateCard;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
12
14
|
var _data = require("@wordpress/data");
|
|
13
15
|
|
|
14
16
|
var _components = require("@wordpress/components");
|
|
@@ -25,6 +27,8 @@ var _templateActions = _interopRequireDefault(require("./template-actions"));
|
|
|
25
27
|
|
|
26
28
|
var _templateAreas = _interopRequireDefault(require("./template-areas"));
|
|
27
29
|
|
|
30
|
+
var _lastRevision = _interopRequireDefault(require("./last-revision"));
|
|
31
|
+
|
|
28
32
|
/**
|
|
29
33
|
* WordPress dependencies
|
|
30
34
|
*/
|
|
@@ -65,7 +69,7 @@ function TemplateCard() {
|
|
|
65
69
|
return null;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
return (0, _element.createElement)("div", {
|
|
72
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
|
|
69
73
|
className: "edit-site-template-card"
|
|
70
74
|
}, (0, _element.createElement)(_components.Icon, {
|
|
71
75
|
className: "edit-site-template-card__icon",
|
|
@@ -80,6 +84,9 @@ function TemplateCard() {
|
|
|
80
84
|
template: template
|
|
81
85
|
})), (0, _element.createElement)("div", {
|
|
82
86
|
className: "edit-site-template-card__description"
|
|
83
|
-
}, (0, _htmlEntities.decodeEntities)(description)), (0, _element.createElement)(_templateAreas.default, null)))
|
|
87
|
+
}, (0, _htmlEntities.decodeEntities)(description)), (0, _element.createElement)(_templateAreas.default, null))), (0, _element.createElement)(_components.PanelRow, {
|
|
88
|
+
header: (0, _i18n.__)('Editing history'),
|
|
89
|
+
className: "edit-site-template-revisions"
|
|
90
|
+
}, (0, _element.createElement)(_lastRevision.default, null)));
|
|
84
91
|
}
|
|
85
92
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-card/index.js"],"names":["TemplateCard","info","title","description","icon","template","select","getEditedPostType","getEditedPostId","editSiteStore","getEditedEntityRecord","coreStore","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","postType","postId","record"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-card/index.js"],"names":["TemplateCard","info","title","description","icon","template","select","getEditedPostType","getEditedPostId","editSiteStore","getEditedEntityRecord","coreStore","__experimentalGetTemplateInfo","getTemplateInfo","edit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KAAhB,CADH,CADD,EAIC,4BAAC,wBAAD;AAAiB,IAAA,QAAQ,EAAGG;AAA5B,IAJD,CADD,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,kCAAgBF,WAAhB,CADH,CAPD,EAUC,4BAAC,sBAAD,OAVD,CAFD,CADD,EAgBC,4BAAC,oBAAD;AACC,IAAA,MAAM,EAAG,cAAI,iBAAJ,CADV;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,4BAAC,qBAAD,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,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = LastRevision;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
var _icons = require("@wordpress/icons");
|
|
17
|
+
|
|
18
|
+
var _url = require("@wordpress/url");
|
|
19
|
+
|
|
20
|
+
var _editor = require("@wordpress/editor");
|
|
21
|
+
|
|
22
|
+
var _useEditedEntityRecord = _interopRequireDefault(require("../../use-edited-entity-record"));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* WordPress dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
const useRevisionData = () => {
|
|
32
|
+
var _currentTemplate$_lin, _currentTemplate$_lin2, _currentTemplate$_lin3, _currentTemplate$_lin4, _currentTemplate$_lin5, _currentTemplate$_lin6, _currentTemplate$_lin7, _currentTemplate$_lin8;
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
record: currentTemplate
|
|
36
|
+
} = (0, _useEditedEntityRecord.default)();
|
|
37
|
+
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;
|
|
38
|
+
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;
|
|
39
|
+
return {
|
|
40
|
+
currentTemplate,
|
|
41
|
+
lastRevisionId,
|
|
42
|
+
revisionsCount
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function PostLastRevisionCheck(_ref) {
|
|
47
|
+
let {
|
|
48
|
+
children
|
|
49
|
+
} = _ref;
|
|
50
|
+
const {
|
|
51
|
+
lastRevisionId,
|
|
52
|
+
revisionsCount
|
|
53
|
+
} = useRevisionData();
|
|
54
|
+
|
|
55
|
+
if (!lastRevisionId || revisionsCount < 2) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (0, _element.createElement)(_editor.PostTypeSupportCheck, {
|
|
60
|
+
supportKeys: "revisions"
|
|
61
|
+
}, children);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const PostLastRevision = () => {
|
|
65
|
+
const {
|
|
66
|
+
lastRevisionId,
|
|
67
|
+
revisionsCount
|
|
68
|
+
} = useRevisionData();
|
|
69
|
+
return (0, _element.createElement)(PostLastRevisionCheck, null, (0, _element.createElement)(_components.Button, {
|
|
70
|
+
href: (0, _url.addQueryArgs)('revision.php', {
|
|
71
|
+
revision: lastRevisionId,
|
|
72
|
+
gutenberg: true
|
|
73
|
+
}),
|
|
74
|
+
className: "edit-site-template-last-revision__title",
|
|
75
|
+
icon: _icons.backup
|
|
76
|
+
}, (0, _i18n.sprintf)(
|
|
77
|
+
/* translators: %d: number of revisions */
|
|
78
|
+
(0, _i18n._n)('%d Revision', '%d Revisions', revisionsCount), revisionsCount)));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
function LastRevision() {
|
|
82
|
+
return (0, _element.createElement)(PostLastRevisionCheck, null, (0, _element.createElement)(PostLastRevision, null));
|
|
83
|
+
}
|
|
84
|
+
//# 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":["useRevisionData","record","currentTemplate","lastRevisionId","_links","id","revisionsCount","count","PostLastRevisionCheck","children","PostLastRevision","revision","gutenberg","backup","LastRevision"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,eAAe,GAAG,MAAM;AAAA;;AAC7B,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAA8B,qCAApC;AAEA,QAAMC,cAAc,4BACnBD,eADmB,aACnBA,eADmB,iDACnBA,eAAe,CAAEE,MADE,qFACnB,uBAA2B,qBAA3B,CADmB,qFACnB,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press/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"]}
|
|
@@ -13,17 +13,36 @@ var _i18n = require("@wordpress/i18n");
|
|
|
13
13
|
|
|
14
14
|
var _icons = require("@wordpress/icons");
|
|
15
15
|
|
|
16
|
+
var _data = require("@wordpress/data");
|
|
17
|
+
|
|
18
|
+
var _store = require("../../store");
|
|
19
|
+
|
|
20
|
+
var _privateApis = require("../../private-apis");
|
|
21
|
+
|
|
16
22
|
/**
|
|
17
23
|
* WordPress dependencies
|
|
18
24
|
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
19
29
|
function SidebarNavigationScreen(_ref) {
|
|
20
30
|
let {
|
|
21
31
|
path,
|
|
22
|
-
parentTitle,
|
|
23
32
|
title,
|
|
24
33
|
actions,
|
|
25
34
|
content
|
|
26
35
|
} = _ref;
|
|
36
|
+
const {
|
|
37
|
+
dashboardLink
|
|
38
|
+
} = (0, _data.useSelect)(select => {
|
|
39
|
+
const {
|
|
40
|
+
getSettings
|
|
41
|
+
} = (0, _privateApis.unlock)(select(_store.store));
|
|
42
|
+
return {
|
|
43
|
+
dashboardLink: getSettings().__experimentalDashboardLink
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
27
46
|
return (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
|
|
28
47
|
className: "edit-site-sidebar-navigation-screen",
|
|
29
48
|
path: path
|
|
@@ -33,14 +52,16 @@ function SidebarNavigationScreen(_ref) {
|
|
|
33
52
|
spacing: 4,
|
|
34
53
|
justify: "flex-start",
|
|
35
54
|
className: "edit-site-sidebar-navigation-screen__title-icon"
|
|
36
|
-
},
|
|
55
|
+
}, path !== '/' ? (0, _element.createElement)(_components.__experimentalNavigatorToParentButton, {
|
|
56
|
+
className: "edit-site-sidebar-navigation-screen__back",
|
|
57
|
+
icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
|
|
58
|
+
"aria-label": (0, _i18n.__)('Back')
|
|
59
|
+
}) : (0, _element.createElement)(_components.Button, {
|
|
37
60
|
className: "edit-site-sidebar-navigation-screen__back",
|
|
38
61
|
icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
|
|
39
|
-
"aria-label": (0, _i18n.
|
|
40
|
-
|
|
41
|
-
(0, _i18n.__)('
|
|
42
|
-
}) : (0, _element.createElement)("div", {
|
|
43
|
-
className: "edit-site-sidebar-navigation-screen__icon-placeholder"
|
|
62
|
+
"aria-label": (0, _i18n.__)('Navigate to the Dashboard'),
|
|
63
|
+
href: dashboardLink || 'index.php',
|
|
64
|
+
label: (0, _i18n.__)('Dashboard')
|
|
44
65
|
}), (0, _element.createElement)("h2", {
|
|
45
66
|
className: "edit-site-sidebar-navigation-screen__title"
|
|
46
67
|
}, title), actions), (0, _element.createElement)("nav", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","path","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","path","title","actions","content","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","chevronRight","chevronLeft"],"mappings":";;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAYA;AACA;AACA;AAIe,SAASA,uBAAT,OAKX;AAAA,MAL6C;AAChDC,IAAAA,IADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,OAHgD;AAIhDC,IAAAA;AAJgD,GAK7C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkB,yBAAQD,MAAM,CAAEE,YAAF,CAAd,CAAxB;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,WAAW,GAAGE;AADvB,KAAP;AAGA,GALyB,EAKvB,EALuB,CAA1B;AAOA,SACC,4BAAC,yCAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,IAAI,EAAGR;AAFR,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,OAAO,EAAC,YAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGA,IAAI,KAAK,GAAT,GACD,4BAAC,iDAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAG,qBAAUS,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa,cAAI,MAAJ;AAHd,IADC,GAOD,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAG,qBAAUD,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa,cAAI,2BAAJ,CAHd;AAIC,IAAA,IAAI,EAAGN,aAAa,IAAI,WAJzB;AAKC,IAAA,KAAK,EAAG,cAAI,WAAJ;AALT,IAZF,EAoBC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGH,KADH,CApBD,EAuBGC,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,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = SidebarNavigationScreenNavigationItem;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _data = require("@wordpress/data");
|
|
15
|
+
|
|
16
|
+
var _components = require("@wordpress/components");
|
|
17
|
+
|
|
18
|
+
var _coreData = require("@wordpress/core-data");
|
|
19
|
+
|
|
20
|
+
var _htmlEntities = require("@wordpress/html-entities");
|
|
21
|
+
|
|
22
|
+
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
23
|
+
|
|
24
|
+
var _privateApis = require("../../private-apis");
|
|
25
|
+
|
|
26
|
+
var _store = require("../../store");
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* WordPress dependencies
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Internal dependencies
|
|
34
|
+
*/
|
|
35
|
+
function SidebarNavigationScreenNavigationItem() {
|
|
36
|
+
var _post$title, _post$description;
|
|
37
|
+
|
|
38
|
+
const {
|
|
39
|
+
setCanvasMode
|
|
40
|
+
} = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
|
|
41
|
+
const {
|
|
42
|
+
post
|
|
43
|
+
} = (0, _data.useSelect)(select => {
|
|
44
|
+
var _getEditedPostContext;
|
|
45
|
+
|
|
46
|
+
const {
|
|
47
|
+
getEditedPostContext
|
|
48
|
+
} = select(_store.store);
|
|
49
|
+
const {
|
|
50
|
+
getEntityRecord
|
|
51
|
+
} = select(_coreData.store);
|
|
52
|
+
const {
|
|
53
|
+
postType,
|
|
54
|
+
postId
|
|
55
|
+
} = (_getEditedPostContext = getEditedPostContext()) !== null && _getEditedPostContext !== void 0 ? _getEditedPostContext : {}; // The currently selected entity to display.
|
|
56
|
+
// Typically template or template part in the site editor.
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
post: postId && postType ? getEntityRecord('postType', postType, postId) : null
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
62
|
+
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
63
|
+
path: "/navigation/single",
|
|
64
|
+
title: post ? (0, _htmlEntities.decodeEntities)(post === null || post === void 0 ? void 0 : (_post$title = post.title) === null || _post$title === void 0 ? void 0 : _post$title.rendered) : null,
|
|
65
|
+
actions: (0, _element.createElement)(_components.Button, {
|
|
66
|
+
variant: "primary",
|
|
67
|
+
onClick: () => setCanvasMode('edit')
|
|
68
|
+
}, (0, _i18n.__)('Edit')),
|
|
69
|
+
content: post ? (0, _htmlEntities.decodeEntities)(post === null || post === void 0 ? void 0 : (_post$description = post.description) === null || _post$description === void 0 ? void 0 : _post$description.rendered) : null
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["SidebarNavigationScreenNavigationItem","setCanvasMode","editSiteStore","post","select","getEditedPostContext","getEntityRecord","coreStore","postType","postId","title","rendered","description"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAdA;AACA;AACA;;AAOA;AACA;AACA;AAKe,SAASA,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAW,qBAAaC,MAAF,IAAc;AAAA;;AACzC,UAAM;AAAEC,MAAAA;AAAF,QAA2BD,MAAM,CAAEF,YAAF,CAAvC;AACA,UAAM;AAAEI,MAAAA;AAAF,QAAsBF,MAAM,CAAEG,eAAF,CAAlC;AACA,UAAM;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,iCAAuBJ,oBAAoB,EAA3C,yEAAiD,EAAvD,CAHyC,CAKzC;AACA;;AACA,WAAO;AACNF,MAAAA,IAAI,EACHM,MAAM,IAAID,QAAV,GACGF,eAAe,CAAE,UAAF,EAAcE,QAAd,EAAwBC,MAAxB,CADlB,GAEG;AAJE,KAAP;AAMA,GAbgB,EAad,EAbc,CAAjB;AAeA,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAC,oBADN;AAEC,IAAA,KAAK,EAAGN,IAAI,GAAG,kCAAgBA,IAAhB,aAAgBA,IAAhB,sCAAgBA,IAAI,CAAEO,KAAtB,gDAAgB,YAAaC,QAA7B,CAAH,GAA6C,IAF1D;AAGC,IAAA,OAAO,EACN,4BAAC,kBAAD;AACC,MAAA,OAAO,EAAC,SADT;AAEC,MAAA,OAAO,EAAG,MAAMV,aAAa,CAAE,MAAF;AAF9B,OAIG,cAAI,MAAJ,CAJH,CAJF;AAWC,IAAA,OAAO,EACNE,IAAI,GAAG,kCAAgBA,IAAhB,aAAgBA,IAAhB,4CAAgBA,IAAI,CAAES,WAAtB,sDAAgB,kBAAmBD,QAAnC,CAAH,GAAmD;AAZzD,IADD;AAiBA","sourcesContent":["/**\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"]}
|
|
@@ -34,13 +34,13 @@ function SidebarNavigationScreenNavigationMenus() {
|
|
|
34
34
|
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
|
35
35
|
history.push({
|
|
36
36
|
postType: attributes.type,
|
|
37
|
-
postId: attributes.id
|
|
37
|
+
postId: attributes.id,
|
|
38
|
+
path: '/navigation/single'
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
}, [history]);
|
|
41
42
|
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
42
43
|
path: "/navigation",
|
|
43
|
-
parentTitle: (0, _i18n.__)('Design'),
|
|
44
44
|
title: (0, _i18n.__)('Navigation'),
|
|
45
45
|
content: (0, _element.createElement)("div", {
|
|
46
46
|
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":["SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId"],"mappings":";;;;;;;;;AAIA;;AADA;;AAMA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKe,SAASA,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAG,yBAAhB;AACA,QAAMC,QAAQ,GAAG,0BACdC,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":["SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId","path"],"mappings":";;;;;;;;;AAIA;;AADA;;AAMA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKe,SAASA,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAG,yBAAhB;AACA,QAAMC,QAAQ,GAAG,0BACdC,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,GAfe,EAgBhB,CAAEV,OAAF,CAhBgB,CAAjB;AAkBA,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAC,aADN;AAEC,IAAA,KAAK,EAAG,cAAI,YAAJ,CAFT;AAGC,IAAA,OAAO,EACN;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAqB,MAAA,QAAQ,EAAGC;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"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = SidebarNavigationScreenTemplate;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _data = require("@wordpress/data");
|
|
15
|
+
|
|
16
|
+
var _components = require("@wordpress/components");
|
|
17
|
+
|
|
18
|
+
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
19
|
+
|
|
20
|
+
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
21
|
+
|
|
22
|
+
var _privateApis = require("../../private-apis");
|
|
23
|
+
|
|
24
|
+
var _store = require("../../store");
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* WordPress dependencies
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Internal dependencies
|
|
32
|
+
*/
|
|
33
|
+
const config = {
|
|
34
|
+
wp_template: {
|
|
35
|
+
path: '/templates/single'
|
|
36
|
+
},
|
|
37
|
+
wp_template_part: {
|
|
38
|
+
path: '/template-parts/single'
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function SidebarNavigationScreenTemplate(_ref) {
|
|
43
|
+
let {
|
|
44
|
+
postType = 'wp_template'
|
|
45
|
+
} = _ref;
|
|
46
|
+
const {
|
|
47
|
+
setCanvasMode
|
|
48
|
+
} = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
|
|
49
|
+
const {
|
|
50
|
+
getDescription,
|
|
51
|
+
getTitle,
|
|
52
|
+
record
|
|
53
|
+
} = (0, _useEditedEntityRecord.default)();
|
|
54
|
+
let description = getDescription();
|
|
55
|
+
|
|
56
|
+
if (!description && record.is_custom) {
|
|
57
|
+
description = (0, _i18n.__)('This is a custom template that can be applied manually to any Post or Page.');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
61
|
+
path: config[postType].path,
|
|
62
|
+
title: getTitle(),
|
|
63
|
+
actions: (0, _element.createElement)(_components.Button, {
|
|
64
|
+
variant: "primary",
|
|
65
|
+
onClick: () => setCanvasMode('edit')
|
|
66
|
+
}, (0, _i18n.__)('Edit')),
|
|
67
|
+
content: description ? (0, _element.createElement)("p", null, description) : undefined
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/index.js"],"names":["config","wp_template","path","wp_template_part","SidebarNavigationScreenTemplate","postType","setCanvasMode","editSiteStore","getDescription","getTitle","record","description","is_custom","undefined"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAKA;AACA;AACA;AAMA,MAAMA,MAAM,GAAG;AACdC,EAAAA,WAAW,EAAE;AACZC,IAAAA,IAAI,EAAE;AADM,GADC;AAIdC,EAAAA,gBAAgB,EAAE;AACjBD,IAAAA,IAAI,EAAE;AADW;AAJJ,CAAf;;AASe,SAASE,+BAAT,OAEX;AAAA,MAFqD;AACxDC,IAAAA,QAAQ,GAAG;AAD6C,GAErD;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,QAAlB;AAA4BC,IAAAA;AAA5B,MAAuC,qCAA7C;AACA,MAAIC,WAAW,GAAGH,cAAc,EAAhC;;AACA,MAAK,CAAEG,WAAF,IAAiBD,MAAM,CAACE,SAA7B,EAAyC;AACxCD,IAAAA,WAAW,GAAG,cACb,6EADa,CAAd;AAGA;;AAED,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAGX,MAAM,CAAEK,QAAF,CAAN,CAAmBH,IAD3B;AAEC,IAAA,KAAK,EAAGO,QAAQ,EAFjB;AAGC,IAAA,OAAO,EACN,4BAAC,kBAAD;AACC,MAAA,OAAO,EAAC,SADT;AAEC,MAAA,OAAO,EAAG,MAAMH,aAAa,CAAE,MAAF;AAF9B,OAIG,cAAI,MAAJ,CAJH,CAJF;AAWC,IAAA,OAAO,EAAGK,WAAW,GAAG,uCAAKA,WAAL,CAAH,GAA4BE;AAXlD,IADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nconst config = {\n\twp_template: {\n\t\tpath: '/templates/single',\n\t},\n\twp_template_part: {\n\t\tpath: '/template-parts/single',\n\t},\n};\n\nexport default function SidebarNavigationScreenTemplate( {\n\tpostType = 'wp_template',\n} ) {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord();\n\tlet description = getDescription();\n\tif ( ! description && record.is_custom ) {\n\t\tdescription = __(\n\t\t\t'This is a custom template that can be applied manually to any Post or Page.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath={ config[ postType ].path }\n\t\t\ttitle={ getTitle() }\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={ description ? <p>{ description }</p> : undefined }\n\t\t/>\n\t);\n}\n"]}
|