@wordpress/edit-site 6.12.1-next.082ed6819.0 → 6.13.1-next.a9f418477.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-pattern/index.js +3 -16
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-post/index.js +1 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/index.js +1 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/app/index.js +31 -29
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +4 -4
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/dataviews-actions/index.js +1 -5
- package/build/components/dataviews-actions/index.js.map +1 -1
- package/build/components/editor/index.js +38 -22
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +5 -0
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/editor/use-resolve-edited-entity.js +19 -4
- package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +2 -2
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +2 -2
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/preview-typography.js +2 -2
- package/build/components/global-styles/preview-typography.js.map +1 -1
- package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +10 -29
- package/build/components/global-styles/preview-wrapper.js.map +1 -0
- package/build/components/global-styles/typography-example.js +8 -1
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +5 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +44 -19
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js +6 -57
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/index.js +31 -30
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/fields.js +6 -34
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +34 -46
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/header.js +83 -0
- package/build/components/post-edit/header.js.map +1 -0
- package/build/components/post-edit/index.js +42 -7
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +26 -40
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js +10 -16
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +3 -7
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
- package/build/components/posts-app-routes/post-item.js.map +1 -0
- package/build/components/posts-app-routes/posts.js +89 -0
- package/build/components/posts-app-routes/posts.js.map +1 -0
- package/build/components/resizable-frame/index.js +6 -5
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-panel/index.js +9 -6
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +7 -24
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +8 -5
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +2 -2
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
- package/build/components/site-editor-routes/home.js.map +1 -0
- package/build/components/site-editor-routes/index.js +12 -18
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/navigation-item.js +49 -0
- package/build/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
- package/build/components/site-editor-routes/navigation.js.map +1 -0
- package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
- package/build/components/site-editor-routes/page-item.js.map +1 -0
- package/build/components/site-editor-routes/pages.js +87 -0
- package/build/components/site-editor-routes/pages.js.map +1 -0
- package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
- package/build/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
- package/build/components/site-editor-routes/patterns.js.map +1 -0
- package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
- package/build/components/site-editor-routes/styles.js.map +1 -0
- package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
- package/build/components/site-editor-routes/template-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
- package/build/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
- package/build/components/site-editor-routes/templates.js.map +1 -0
- package/build/components/site-hub/index.js +3 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +8 -19
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/examples.js +42 -27
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +21 -5
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +12 -48
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +2 -2
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/store/private-actions.js +7 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +2 -0
- package/build/store/reducer.js.map +1 -1
- package/build/utils/is-previewing-theme.js +1 -1
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/use-activate-theme.js +9 -8
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +3 -16
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +1 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +1 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/app/index.js +33 -31
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +1 -5
- package/build-module/components/dataviews-actions/index.js.map +1 -1
- package/build-module/components/editor/index.js +38 -22
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +5 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
- package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -1
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +37 -27
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +2 -2
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +2 -2
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/preview-typography.js +2 -2
- package/build-module/components/global-styles/preview-typography.js.map +1 -1
- package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +12 -31
- package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
- package/build-module/components/global-styles/typography-example.js +8 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +5 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +45 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +7 -58
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/index.js +29 -28
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/fields.js +5 -31
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +33 -45
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/header.js +76 -0
- package/build-module/components/post-edit/header.js.map +1 -0
- package/build-module/components/post-edit/index.js +42 -7
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +26 -40
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +11 -17
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app-routes/index.js +3 -7
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
- package/build-module/components/posts-app-routes/post-item.js.map +1 -0
- package/build-module/components/posts-app-routes/posts.js +81 -0
- package/build-module/components/posts-app-routes/posts.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +6 -5
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +9 -6
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +7 -24
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +4 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +8 -5
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
- package/build-module/components/site-editor-routes/home.js.map +1 -0
- package/build-module/components/site-editor-routes/index.js +12 -18
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation-item.js +41 -0
- package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation.js +38 -0
- package/build-module/components/site-editor-routes/navigation.js.map +1 -0
- package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
- package/build-module/components/site-editor-routes/page-item.js.map +1 -0
- package/build-module/components/site-editor-routes/pages.js +79 -0
- package/build-module/components/site-editor-routes/pages.js.map +1 -0
- package/build-module/components/site-editor-routes/pattern-item.js +18 -0
- package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
- package/build-module/components/site-editor-routes/patterns.js.map +1 -0
- package/build-module/components/site-editor-routes/styles.js +44 -0
- package/build-module/components/site-editor-routes/styles.js.map +1 -0
- package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
- package/build-module/components/site-editor-routes/template-item.js.map +1 -0
- package/build-module/components/site-editor-routes/template-part-item.js +18 -0
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build-module/components/site-editor-routes/templates.js +33 -0
- package/build-module/components/site-editor-routes/templates.js.map +1 -0
- package/build-module/components/site-hub/index.js +3 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +8 -19
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/examples.js +42 -27
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +21 -5
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/style-book/types.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +12 -48
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +2 -2
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/store/private-actions.js +6 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +2 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +1 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +9 -8
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/posts-rtl.css +73 -107
- package/build-style/posts.css +73 -107
- package/build-style/style-rtl.css +201 -142
- package/build-style/style.css +201 -142
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +9 -17
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/add-new-template/index.js +3 -5
- package/src/components/app/index.js +34 -35
- package/src/components/block-editor/use-editor-iframe-props.js +5 -4
- package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
- package/src/components/block-editor/use-site-editor-settings.js +6 -6
- package/src/components/dataviews-actions/index.js +1 -5
- package/src/components/editor/index.js +64 -29
- package/src/components/editor/use-editor-title.js +4 -0
- package/src/components/editor/use-resolve-edited-entity.js +17 -2
- package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
- package/src/components/global-styles/font-library-modal/style.scss +12 -5
- package/src/components/global-styles/preview-colors.js +3 -3
- package/src/components/global-styles/preview-styles.js +3 -3
- package/src/components/global-styles/preview-typography.js +3 -3
- package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
- package/src/components/global-styles/style.scss +5 -1
- package/src/components/global-styles/typography-example.js +12 -1
- package/src/components/global-styles-sidebar/index.js +4 -4
- package/src/components/layout/index.js +43 -11
- package/src/components/page-patterns/delete-category-menu-item.js +3 -4
- package/src/components/page-patterns/fields.js +9 -65
- package/src/components/page-patterns/index.js +39 -25
- package/src/components/page-patterns/style.scss +0 -28
- package/src/components/page-templates/fields.js +3 -31
- package/src/components/page-templates/index.js +34 -51
- package/src/components/post-edit/header.js +88 -0
- package/src/components/post-edit/index.js +39 -7
- package/src/components/post-edit/style.scss +10 -0
- package/src/components/post-list/index.js +44 -40
- package/src/components/post-list/style.scss +0 -36
- package/src/components/posts-app/index.js +9 -18
- package/src/components/posts-app-routes/index.js +3 -14
- package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
- package/src/components/posts-app-routes/posts.js +66 -0
- package/src/components/resizable-frame/index.js +6 -7
- package/src/components/save-panel/index.js +11 -5
- package/src/components/sidebar-dataviews/add-new-view.js +9 -9
- package/src/components/sidebar-dataviews/dataview-item.js +5 -8
- package/src/components/sidebar-dataviews/default-views.js +7 -24
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-dataviews/style.scss +2 -2
- package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
- package/src/components/sidebar-navigation-item/index.js +7 -5
- package/src/components/sidebar-navigation-item/style.scss +1 -2
- package/src/components/sidebar-navigation-screen/index.js +2 -2
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
- package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
- package/src/components/sidebar-navigation-screen-main/index.js +6 -10
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
- package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
- package/src/components/site-editor-routes/index.js +22 -34
- package/src/components/site-editor-routes/navigation-item.js +39 -0
- package/src/components/site-editor-routes/navigation.js +34 -0
- package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
- package/src/components/site-editor-routes/pages.js +66 -0
- package/src/components/site-editor-routes/pattern-item.js +15 -0
- package/src/components/site-editor-routes/patterns.js +15 -0
- package/src/components/site-editor-routes/styles.js +39 -0
- package/src/components/site-editor-routes/template-item.js +15 -0
- package/src/components/site-editor-routes/template-part-item.js +15 -0
- package/src/components/site-editor-routes/templates.js +26 -0
- package/src/components/site-hub/index.js +3 -6
- package/src/components/style-book/constants.ts +8 -19
- package/src/components/style-book/examples.tsx +47 -28
- package/src/components/style-book/index.js +28 -5
- package/src/components/style-book/types.ts +1 -1
- package/src/hooks/commands/use-common-commands.js +14 -72
- package/src/hooks/commands/use-set-command-context.js +2 -2
- package/src/store/private-actions.js +7 -0
- package/src/store/reducer.js +2 -0
- package/src/style.scss +1 -0
- package/src/utils/is-previewing-theme.js +1 -3
- package/src/utils/use-activate-theme.js +4 -3
- package/build/components/error-boundary/index.js +0 -47
- package/build/components/error-boundary/index.js.map +0 -1
- package/build/components/error-boundary/warning.js +0 -42
- package/build/components/error-boundary/warning.js.map +0 -1
- package/build/components/global-styles/preview-iframe.js.map +0 -1
- package/build/components/layout/router.js +0 -92
- package/build/components/layout/router.js.map +0 -1
- package/build/components/posts-app-routes/home.js.map +0 -1
- package/build/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view.js +0 -48
- package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
- package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-view.js +0 -41
- package/build/components/posts-app-routes/posts-view.js.map +0 -1
- package/build/components/routes/link.js +0 -69
- package/build/components/routes/link.js.map +0 -1
- package/build/components/site-editor-routes/home-edit.js.map +0 -1
- package/build/components/site-editor-routes/home-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-edit.js +0 -29
- package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
- package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-view.js +0 -30
- package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-view.js +0 -28
- package/build/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view.js +0 -47
- package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
- package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-view.js +0 -42
- package/build/components/site-editor-routes/pages-view.js.map +0 -1
- package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build/components/site-editor-routes/styles-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-view.js +0 -29
- package/build/components/site-editor-routes/templates-view.js.map +0 -1
- package/build-module/components/error-boundary/index.js +0 -38
- package/build-module/components/error-boundary/index.js.map +0 -1
- package/build-module/components/error-boundary/warning.js +0 -35
- package/build-module/components/error-boundary/warning.js.map +0 -1
- package/build-module/components/global-styles/preview-iframe.js.map +0 -1
- package/build-module/components/layout/router.js +0 -84
- package/build-module/components/layout/router.js.map +0 -1
- package/build-module/components/posts-app-routes/home.js +0 -40
- package/build-module/components/posts-app-routes/home.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
- package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view.js +0 -33
- package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
- package/build-module/components/routes/link.js +0 -61
- package/build-module/components/routes/link.js.map +0 -1
- package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/home-view.js +0 -17
- package/build-module/components/site-editor-routes/home-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
- package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
- package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
- package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-view.js +0 -20
- package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
- package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view.js +0 -34
- package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
- package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build-module/components/site-editor-routes/styles-view.js +0 -25
- package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
- package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-view.js +0 -21
- package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
- package/src/components/error-boundary/index.js +0 -44
- package/src/components/error-boundary/test/error-boundary.js +0 -40
- package/src/components/error-boundary/warning.js +0 -30
- package/src/components/layout/router.js +0 -86
- package/src/components/posts-app-routes/home.js +0 -36
- package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
- package/src/components/posts-app-routes/posts-list-view.js +0 -40
- package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
- package/src/components/posts-app-routes/posts-view.js +0 -35
- package/src/components/routes/link.js +0 -68
- package/src/components/site-editor-routes/home-edit.js +0 -17
- package/src/components/site-editor-routes/navigation-edit.js +0 -22
- package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
- package/src/components/site-editor-routes/navigation-item-view.js +0 -25
- package/src/components/site-editor-routes/navigation-view.js +0 -21
- package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/src/components/site-editor-routes/pages-list-view.js +0 -44
- package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/src/components/site-editor-routes/pages-view.js +0 -39
- package/src/components/site-editor-routes/patterns-edit.js +0 -24
- package/src/components/site-editor-routes/patterns-view.js +0 -22
- package/src/components/site-editor-routes/styles-view.js +0 -26
- package/src/components/site-editor-routes/templates-edit.js +0 -22
- package/src/components/site-editor-routes/templates-list-view.js +0 -28
- package/src/components/site-editor-routes/templates-view.js +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"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{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.navigate( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: theme name. 2: title */\n\t\t\t\t\t\t\t\t\t__( 'Previewing %1$s: %2$s' ),\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\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,6CAA6C;MAAAF,QAAA,EAC5DhC;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -6,12 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenGlobalStylesContent;
|
|
8
8
|
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
9
|
var _components = require("@wordpress/components");
|
|
11
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
12
10
|
var _styleVariationsContainer = _interopRequireDefault(require("../global-styles/style-variations-container"));
|
|
13
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
14
|
-
var _store = require("../../store");
|
|
15
11
|
var _variationsColor = _interopRequireDefault(require("../global-styles/variations/variations-color"));
|
|
16
12
|
var _variationsTypography = _interopRequireDefault(require("../global-styles/variations/variations-typography"));
|
|
17
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -23,42 +19,20 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
19
|
* Internal dependencies
|
|
24
20
|
*/
|
|
25
21
|
|
|
26
|
-
const noop = () => {};
|
|
27
22
|
function SidebarNavigationScreenGlobalStylesContent() {
|
|
28
|
-
const {
|
|
29
|
-
storedSettings
|
|
30
|
-
} = (0, _data.useSelect)(select => {
|
|
31
|
-
const {
|
|
32
|
-
getSettings
|
|
33
|
-
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
34
|
-
return {
|
|
35
|
-
storedSettings: getSettings()
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
23
|
const gap = 3;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
className: "edit-site-global-styles-variation-container",
|
|
52
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styleVariationsContainer.default, {
|
|
53
|
-
gap: gap
|
|
54
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsColor.default, {
|
|
55
|
-
title: (0, _i18n.__)('Palettes'),
|
|
56
|
-
gap: gap
|
|
57
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {
|
|
58
|
-
title: (0, _i18n.__)('Typography'),
|
|
59
|
-
gap: gap
|
|
60
|
-
})]
|
|
61
|
-
})
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
25
|
+
spacing: 10,
|
|
26
|
+
className: "edit-site-global-styles-variation-container",
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styleVariationsContainer.default, {
|
|
28
|
+
gap: gap
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsColor.default, {
|
|
30
|
+
title: (0, _i18n.__)('Palettes'),
|
|
31
|
+
gap: gap
|
|
32
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {
|
|
33
|
+
title: (0, _i18n.__)('Typography'),
|
|
34
|
+
gap: gap
|
|
35
|
+
})]
|
|
62
36
|
});
|
|
63
37
|
}
|
|
64
38
|
//# sourceMappingURL=content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_styleVariationsContainer","_interopRequireDefault","_variationsColor","_variationsTypography","_jsxRuntime","SidebarNavigationScreenGlobalStylesContent","gap","jsxs","__experimentalVStack","spacing","className","children","jsx","default","title","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\n\nexport default function SidebarNavigationScreenGlobalStylesContent() {\n\tconst gap = 3;\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing={ 10 }\n\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t>\n\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />\n\t\t\t<TypographyVariations title={ __( 'Typography' ) } gap={ gap } />\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,yBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,qBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAqF,IAAAM,WAAA,GAAAN,OAAA;AAXrF;AACA;AACA;;AAIA;AACA;AACA;;AAKe,SAASO,0CAA0CA,CAAA,EAAG;EACpE,MAAMC,GAAG,GAAG,CAAC;EAEb,oBACC,IAAAF,WAAA,CAAAG,IAAA,EAACR,WAAA,CAAAS,oBAAM;IACNC,OAAO,EAAG,EAAI;IACdC,SAAS,EAAC,6CAA6C;IAAAC,QAAA,gBAEvD,IAAAP,WAAA,CAAAQ,GAAA,EAACZ,yBAAA,CAAAa,OAAwB;MAACP,GAAG,EAAGA;IAAK,CAAE,CAAC,eACxC,IAAAF,WAAA,CAAAQ,GAAA,EAACV,gBAAA,CAAAW,OAAe;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;MAACT,GAAG,EAAGA;IAAK,CAAE,CAAC,eAC1D,IAAAF,WAAA,CAAAQ,GAAA,EAACT,qBAAA,CAAAU,OAAoB;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;MAACT,GAAG,EAAGA;IAAK,CAAE,CAAC;EAAA,CAC1D,CAAC;AAEX","ignoreList":[]}
|
|
@@ -8,10 +8,10 @@ exports.SidebarNavigationItemGlobalStyles = SidebarNavigationItemGlobalStyles;
|
|
|
8
8
|
exports.default = SidebarNavigationScreenGlobalStyles;
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
|
-
var _coreData = require("@wordpress/core-data");
|
|
12
11
|
var _element = require("@wordpress/element");
|
|
13
12
|
var _preferences = require("@wordpress/preferences");
|
|
14
13
|
var _router = require("@wordpress/router");
|
|
14
|
+
var _url = require("@wordpress/url");
|
|
15
15
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
16
16
|
var _lockUnlock = require("../../lock-unlock");
|
|
17
17
|
var _store = require("../../store");
|
|
@@ -34,27 +34,17 @@ const {
|
|
|
34
34
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
35
35
|
function SidebarNavigationItemGlobalStyles(props) {
|
|
36
36
|
const {
|
|
37
|
-
|
|
37
|
+
name
|
|
38
38
|
} = useLocation();
|
|
39
|
-
const hasGlobalStyleVariations = (0, _data.useSelect)(select => !!select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
|
|
40
|
-
if (hasGlobalStyleVariations) {
|
|
41
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
42
|
-
...props,
|
|
43
|
-
params: {
|
|
44
|
-
path: '/wp_global_styles'
|
|
45
|
-
},
|
|
46
|
-
uid: "global-styles-navigation-item",
|
|
47
|
-
"aria-current": params.path && params.path.startsWith('/wp_global_styles')
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
51
|
-
...props
|
|
40
|
+
...props,
|
|
41
|
+
"aria-current": name === 'styles'
|
|
52
42
|
});
|
|
53
43
|
}
|
|
54
44
|
function SidebarNavigationScreenGlobalStyles() {
|
|
55
45
|
const history = useHistory();
|
|
56
46
|
const {
|
|
57
|
-
|
|
47
|
+
path
|
|
58
48
|
} = useLocation();
|
|
59
49
|
const {
|
|
60
50
|
revisions,
|
|
@@ -71,14 +61,13 @@ function SidebarNavigationScreenGlobalStyles() {
|
|
|
71
61
|
set: setPreference
|
|
72
62
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
73
63
|
const openGlobalStyles = (0, _element.useCallback)(async () => {
|
|
74
|
-
history.
|
|
75
|
-
...params,
|
|
64
|
+
history.navigate((0, _url.addQueryArgs)(path, {
|
|
76
65
|
canvas: 'edit'
|
|
77
|
-
},
|
|
66
|
+
}), {
|
|
78
67
|
transition: 'canvas-mode-edit-transition'
|
|
79
68
|
});
|
|
80
69
|
return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
|
|
81
|
-
}, [
|
|
70
|
+
}, [path, history, openGeneralSidebar, setPreference]);
|
|
82
71
|
const openRevisions = (0, _element.useCallback)(async () => {
|
|
83
72
|
await openGlobalStyles();
|
|
84
73
|
// Open the global styles revisions once the canvas mode is set to edit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_element","_preferences","_router","_url","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarNavigationItem","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenMain","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","name","jsx","default","SidebarNavigationScreenGlobalStyles","history","path","revisions","isLoading","isLoadingRevisions","revisionsCount","useGlobalStylesRevisions","openGeneralSidebar","useDispatch","editSiteStore","setEditorCanvasContainerView","set","setPreference","preferencesStore","openGlobalStyles","useCallback","navigate","addQueryArgs","canvas","transition","Promise","all","openRevisions","shouldShowGlobalStylesFooter","Fragment","children","title","__","isRoot","description","content","MainSidebarNavigationContent","activeItem","footer","record","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { name } = useLocation();\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\taria-current={ name === 'styles' }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { path } = useLocation();\n\tconst {\n\t\trevisions,\n\t\tisLoading: isLoadingRevisions,\n\t\trevisionsCount,\n\t} = useGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.navigate( addQueryArgs( path, { canvas: 'edit' } ), {\n\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t} );\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ path, history, openGeneralSidebar, setPreference ] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst shouldShowGlobalStylesFooter =\n\t\t!! revisionsCount && ! isLoadingRevisions;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Design' ) }\n\t\t\t\tisRoot\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t\t) }\n\t\t\t\tcontent={\n\t\t\t\t\t<MainSidebarNavigationContent activeItem=\"styles-navigation-item\" />\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\trevisionsCount={ revisionsCount }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA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interopRequireDefault(require("../sidebar-navigati
|
|
|
16
16
|
var _sidebarNavigationScreenGlobalStyles = require("../sidebar-navigation-screen-global-styles");
|
|
17
17
|
var _lockUnlock = require("../../lock-unlock");
|
|
18
18
|
var _store = require("../../store");
|
|
19
|
-
var _constants = require("../../utils/constants");
|
|
20
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
20
|
/**
|
|
22
21
|
* WordPress dependencies
|
|
@@ -30,37 +29,30 @@ function MainSidebarNavigationContent() {
|
|
|
30
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
|
|
31
30
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
32
31
|
uid: "navigation-navigation-item",
|
|
33
|
-
|
|
34
|
-
postType: _constants.NAVIGATION_POST_TYPE
|
|
35
|
-
},
|
|
32
|
+
to: "/navigation",
|
|
36
33
|
withChevron: true,
|
|
37
34
|
icon: _icons.navigation,
|
|
38
35
|
children: (0, _i18n.__)('Navigation')
|
|
39
36
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
|
|
40
|
-
|
|
37
|
+
to: "/styles",
|
|
38
|
+
uid: "global-styles-navigation-item",
|
|
41
39
|
icon: _icons.styles,
|
|
42
40
|
children: (0, _i18n.__)('Styles')
|
|
43
41
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
44
42
|
uid: "page-navigation-item",
|
|
45
|
-
|
|
46
|
-
postType: 'page'
|
|
47
|
-
},
|
|
43
|
+
to: "/page",
|
|
48
44
|
withChevron: true,
|
|
49
45
|
icon: _icons.page,
|
|
50
46
|
children: (0, _i18n.__)('Pages')
|
|
51
47
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
52
48
|
uid: "template-navigation-item",
|
|
53
|
-
|
|
54
|
-
postType: _constants.TEMPLATE_POST_TYPE
|
|
55
|
-
},
|
|
49
|
+
to: "/template",
|
|
56
50
|
withChevron: true,
|
|
57
51
|
icon: _icons.layout,
|
|
58
52
|
children: (0, _i18n.__)('Templates')
|
|
59
53
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
60
54
|
uid: "patterns-navigation-item",
|
|
61
|
-
|
|
62
|
-
postType: _constants.PATTERN_TYPES.user
|
|
63
|
-
},
|
|
55
|
+
to: "/pattern",
|
|
64
56
|
withChevron: true,
|
|
65
57
|
icon: _icons.symbol,
|
|
66
58
|
children: (0, _i18n.__)('Patterns')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_jsxRuntime","MainSidebarNavigationContent","jsxs","__experimentalItemGroup","children","jsx","default","uid","to","withChevron","icon","navigation","__","SidebarNavigationItemGlobalStyles","styles","page","layout","symbol","SidebarNavigationScreenMain","setEditorCanvasContainerView","unlock","useDispatch","editSiteStore","useEffect","undefined","isRoot","title","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nexport function MainSidebarNavigationContent() {\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tto=\"/navigation\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\tto=\"/styles\"\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\ticon={ styles }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tto=\"/page\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\n\t\t\t>\n\t\t\t\t{ __( 'Pages' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\tto=\"/template\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tto=\"/pattern\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={ <MainSidebarNavigationContent /> }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,wBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,oCAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAqD,IAAAW,WAAA,GAAAX,OAAA;AAhBrD;AACA;AACA;;AAOA;AACA;AACA;;AAOO,SAASY,4BAA4BA,CAAA,EAAG;EAC9C,oBACC,IAAAD,WAAA,CAAAE,IAAA,EAACd,WAAA,CAAAe,uBAAS;IAAAC,QAAA,gBACT,IAAAJ,WAAA,CAAAK,GAAA,EAACT,sBAAA,CAAAU,OAAqB;MACrBC,GAAG,EAAC,4BAA4B;MAChCC,EAAE,EAAC,aAAa;MAChBC,WAAW;MACXC,IAAI,EAAGC,iBAAY;MAAAP,QAAA,EAEjB,IAAAQ,QAAE,EAAE,YAAa;IAAC,CACE,CAAC,eACxB,IAAAZ,WAAA,CAAAK,GAAA,EAACR,oCAAA,CAAAgB,iCAAiC;MACjCL,EAAE,EAAC,SAAS;MACZD,GAAG,EAAC,+BAA+B;MACnCG,IAAI,EAAGI,aAAQ;MAAAV,QAAA,EAEb,IAAAQ,QAAE,EAAE,QAAS;IAAC,CACkB,CAAC,eACpC,IAAAZ,WAAA,CAAAK,GAAA,EAACT,sBAAA,CAAAU,OAAqB;MACrBC,GAAG,EA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
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
66
66
|
onClick: () => {
|
|
67
|
-
history.
|
|
68
|
-
postId: menuId,
|
|
69
|
-
postType: 'wp_navigation',
|
|
70
|
-
canvas: 'edit'
|
|
71
|
-
});
|
|
67
|
+
history.navigate(`/wp_navigation/${menuId}?canvas=edit`);
|
|
72
68
|
},
|
|
73
69
|
children: (0, _i18n.__)('Edit')
|
|
74
70
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_icons","_i18n","_element","_router","_renameModal","_interopRequireDefault","_deleteConfirmDialog","_lockUnlock","_jsxRuntime","useHistory","unlock","routerPrivateApis","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","useState","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","jsxs","Fragment","children","jsx","DropdownMenu","className","label","__","icon","moreVertical","popoverProps","onClose","MenuGroup","MenuItem","onClick","
|
|
1
|
+
{"version":3,"names":["_components","require","_icons","_i18n","_element","_router","_renameModal","_interopRequireDefault","_deleteConfirmDialog","_lockUnlock","_jsxRuntime","useHistory","unlock","routerPrivateApis","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","useState","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","jsxs","Fragment","children","jsx","DropdownMenu","className","label","__","icon","moreVertical","popoverProps","onClose","MenuGroup","MenuItem","onClick","navigate","isDestructive","default","onConfirm"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteConfirmDialog from './delete-confirm-dialog';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle, menuId } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =\n\t\tuseState( false );\n\n\tconst history = useHistory();\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteConfirmDialogOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t`/wp_navigation/${ menuId }?canvas=edit`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteConfirmDialog();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t{ deleteConfirmDialogOpen && (\n\t\t\t\t<DeleteConfirmDialog\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAA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AAC3B,oBAAA,CAAAyC,OAAmB;MACnBN,OAAO,EAAGd,WAAa;MACvBqB,SAAS,EAAGhC;IAAU,CACtB,CACD,EACCK,eAAe,iBAChB,IAAAb,WAAA,CAAAyB,GAAA,EAAC7B,YAAA,CAAA2C,OAAW;MACXN,OAAO,EAAGd,WAAa;MACvBR,SAAS,EAAGA,SAAW;MACvBF,MAAM,EAAGA;IAAQ,CACjB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js
CHANGED
|
@@ -43,9 +43,7 @@ function useDeleteNavigationMenu() {
|
|
|
43
43
|
createSuccessNotice((0, _i18n.__)('Navigation Menu successfully deleted.'), {
|
|
44
44
|
type: 'snackbar'
|
|
45
45
|
});
|
|
46
|
-
history.
|
|
47
|
-
postType: 'wp_navigation'
|
|
48
|
-
});
|
|
46
|
+
history.navivate('/navigation');
|
|
49
47
|
} catch (error) {
|
|
50
48
|
createErrorNotice((0, _i18n.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */
|
|
51
49
|
(0, _i18n.__)(`Unable to delete Navigation Menu (%s).`), error?.message), {
|
|
@@ -129,10 +127,7 @@ function useDuplicateNavigationMenu() {
|
|
|
129
127
|
createSuccessNotice((0, _i18n.__)('Duplicated Navigation Menu'), {
|
|
130
128
|
type: 'snackbar'
|
|
131
129
|
});
|
|
132
|
-
history.
|
|
133
|
-
postType: _.postType,
|
|
134
|
-
postId: savedRecord.id
|
|
135
|
-
});
|
|
130
|
+
history.navigate(`/wp_navigation/${savedRecord.id}`);
|
|
136
131
|
}
|
|
137
132
|
} catch (error) {
|
|
138
133
|
createErrorNotice((0, _i18n.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_i18n","_data","_notices","_router","_","_constants","_lockUnlock","useHistory","unlock","routerPrivateApis","useDeleteNavigationMenu","deleteEntityRecord","useDispatch","coreStore","createSuccessNotice","createErrorNotice","noticesStore","history","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","__","type","
|
|
1
|
+
{"version":3,"names":["_coreData","require","_i18n","_data","_notices","_router","_","_constants","_lockUnlock","useHistory","unlock","routerPrivateApis","useDeleteNavigationMenu","deleteEntityRecord","useDispatch","coreStore","createSuccessNotice","createErrorNotice","noticesStore","history","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","__","type","navivate","error","sprintf","message","useSaveNavigationMenu","getEditedEntityRecord","useSelect","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","NAVIGATION_POST_TYPE","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","_x","content","raw","status","navigate","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useDeleteNavigationMenu() {\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst history = useHistory();\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation Menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\thistory.navivate( '/navigation' );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation Menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t_x( '%s (Copy)', 'navigation menu' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation Menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\thistory.navigate( `/wp_navigation/${ savedRecord.id }` );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,CAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAM;EAAEQ;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElD,SAASC,uBAAuBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EACvD,MAAM;IAAEC,mBAAmB;IAAEC;EAAkB,CAAC,GAC/C,IAAAH,iBAAW,EAAEI,cAAa,CAAC;EAC5B,MAAMC,OAAO,GAAGV,UAAU,CAAC,CAAC;EAE5B,MAAMW,YAAY,GAAG,MAAQC,cAAc,IAAM;IAChD,MAAMC,MAAM,GAAG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EAAE,iBAAkB,CAAC,EACpCL,SACD,CAAC;QACDM,OAAO,EAAEpC,cAAc,EAAEoC,OAAO,EAAEC,GAAG;QACrCC,MAAM,EAAE;MACT,CAAC,EACD;QACCjC,YAAY,EAAE;MACf,CACD,CAAC;MAED,IAAK6B,WAAW,EAAG;QAClBvC,mBAAmB,CAAE,IAAAW,QAAE,EAAE,4BAA6B,CAAC,EAAE;UACxDC,IAAI,EAAE;QACP,CAAE,CAAC;QACHT,OAAO,CAACyC,QAAQ,CAAE,kBAAmBL,WAAW,CAAChC,EAAE,EAAI,CAAC;MACzD;IACD,CAAC,CAAC,OAAQO,KAAK,EAAG;MACjBb,iBAAiB,CAChB,IAAAc,aAAO,EACN;MACA,IAAAJ,QAAE,EAAE,2CAA4C,CAAC,EACjDG,KAAK,EAAEE,OACR,CAAC,EAED;QACCJ,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOsB,eAAe;AACvB;AAEe,SAASW,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNzC,YAAY,EAAER,uBAAuB,CAAC,CAAC;IACvC6B,UAAU,EAAER,qBAAqB,CAAC,CAAC;IACnCiB,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
|
|
@@ -15,7 +15,6 @@ var _icons = require("@wordpress/icons");
|
|
|
15
15
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
16
16
|
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
|
|
17
17
|
var _constants = require("./constants");
|
|
18
|
-
var _link = require("../routes/link");
|
|
19
18
|
var _singleNavigationMenu = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu/single-navigation-menu"));
|
|
20
19
|
var _useNavigationMenuHandlers = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers"));
|
|
21
20
|
var _lockUnlock = require("../../lock-unlock");
|
|
@@ -130,12 +129,8 @@ const NavMenuItem = ({
|
|
|
130
129
|
postId,
|
|
131
130
|
...props
|
|
132
131
|
}) => {
|
|
133
|
-
const linkInfo = (0, _link.useLink)({
|
|
134
|
-
postId,
|
|
135
|
-
postType: 'wp_navigation'
|
|
136
|
-
});
|
|
137
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
138
|
-
|
|
133
|
+
to: `/wp_navigation/${postId}`,
|
|
139
134
|
...props
|
|
140
135
|
});
|
|
141
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","_singleNavigationMenu","_useNavigationMenuHandlers","_lockUnlock","_constants2","_jsxRuntime","buildMenuLabel","title","id","status","sprintf","__","decodeEntities","_x","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","useEntityRecords","NAVIGATION_POST_TYPE","PRELOADED_NAVIGATION_MENUS_QUERY","isLoading","getNavigationFallbackId","unlock","useSelect","coreStore","isCreatingNavigationFallback","select","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","useNavigationMenuHandlers","hasNavigationMenus","length","jsx","SidebarNavigationScreenWrapper","children","Spinner","className","description","default","navigationMenu","edits","__experimentalItemGroup","map","index","NavMenuItem","postId","withChevron","icon","navigation","rendered","actions","content","props","to"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\tconst isCreatingNavigationFallback = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).isResolving( 'getNavigationFallbackId' ),\n\t\t[]\n\t);\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t// Ensure a fallback navigation is created only once\n\t\t! isCreatingNavigationFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation Menus.' ) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tto={ `/wp_navigation/${ postId }` }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,sBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,0BAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAA6D,IAAAc,WAAA,GAAAd,OAAA;AAvB7D;AACA;AACA;;AAYA;AACA;AACA;;AASA;AACA,SAASe,cAAcA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EAC5C,IAAK,CAAEF,KAAK,EAAG;IACd;IACA,OAAO,IAAAG,aAAO,EAAE,IA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K,GAAG,CAAC,EAAEzC,MAAO;MAAC,GAJhDD,EAKM,CACZ;IAAC,CACO;EAAC,CACmB,CAAC;AAEnC;AAEO,SAASgC,8BAA8BA,CAAE;EAC/CC,QAAQ;EACRgB,OAAO;EACPlD,KAAK;EACLqC,WAAW;EACX7B;AACD,CAAC,EAAG;EACH,oBACC,IAAAV,WAAA,CAAAkC,GAAA,EAAC1C,wBAAA,CAAAgD,OAAuB;IACvBtC,KAAK,EAAGA,KAAK,IAAI,IAAAI,QAAE,EAAE,YAAa,CAAG;IACrC8C,OAAO,EAAGA,OAAS;IACnBb,WAAW,EAAGA,WAAW,IAAI,IAAAjC,QAAE,EAAE,+BAAgC,CAAG;IACpEI,QAAQ,EAAGA,QAAU;IACrB2C,OAAO,EAAGjB;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMU,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGO;AAAM,CAAC,KAAM;EAC/C,oBACC,IAAAtD,WAAA,CAAAkC,GAAA,EAACxC,sBAAA,CAAA8C,OAAqB;IACrBe,EAAE,EAAG,kBAAmBR,MAAM,EAAK;IAAA,GAC9BO;EAAK,CACV,CAAC;AAEJ,CAAC","ignoreList":[]}
|
|
@@ -27,10 +27,14 @@ const POPOVER_PROPS = {
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
const {
|
|
30
|
-
useHistory
|
|
30
|
+
useHistory,
|
|
31
|
+
useLocation
|
|
31
32
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
32
33
|
function LeafMoreMenu(props) {
|
|
33
34
|
const history = useHistory();
|
|
35
|
+
const {
|
|
36
|
+
path
|
|
37
|
+
} = useLocation();
|
|
34
38
|
const {
|
|
35
39
|
block
|
|
36
40
|
} = props;
|
|
@@ -64,30 +68,20 @@ function LeafMoreMenu(props) {
|
|
|
64
68
|
name
|
|
65
69
|
} = selectedBlock;
|
|
66
70
|
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
postType: attributes.type,
|
|
72
|
-
postId: attributes.id,
|
|
73
|
-
canvas: 'edit'
|
|
74
|
-
}, {
|
|
75
|
-
backPath: params
|
|
71
|
+
history.navigate(`/${attributes.type}/${attributes.id}?canvas=edit`, {
|
|
72
|
+
state: {
|
|
73
|
+
backPath: path
|
|
74
|
+
}
|
|
76
75
|
});
|
|
77
76
|
}
|
|
78
77
|
if (name === 'core/page-list-item' && attributes.id && history) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
postType: 'page',
|
|
84
|
-
postId: attributes.id,
|
|
85
|
-
canvas: 'edit'
|
|
86
|
-
}, {
|
|
87
|
-
backPath: params
|
|
78
|
+
history.navigate(`/page/${attributes.id}?canvas=edit`, {
|
|
79
|
+
state: {
|
|
80
|
+
backPath: path
|
|
81
|
+
}
|
|
88
82
|
});
|
|
89
83
|
}
|
|
90
|
-
}, [history]);
|
|
84
|
+
}, [path, history]);
|
|
91
85
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownMenu, {
|
|
92
86
|
icon: _icons.moreVertical,
|
|
93
87
|
label: (0, _i18n.__)('Options'),
|