@wordpress/edit-site 6.12.1-next.082ed6819.0 → 6.13.1-next.cd6172eb0.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-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-sidebar/index.js +5 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +31 -13
- 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 -11
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/index.js +14 -16
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/fields.js +8 -17
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +13 -12
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +38 -3
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +25 -39
- 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/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/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/index.js +5 -0
- package/build/components/style-book/index.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-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-sidebar/index.js +5 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +33 -15
- 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 +6 -11
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/index.js +14 -16
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/fields.js +7 -14
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +13 -12
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +38 -3
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +25 -39
- 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/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/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/index.js +5 -0
- package/build-module/components/style-book/index.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/style-rtl.css +94 -12
- package/build-style/style.css +94 -12
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +9 -17
- 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/style.scss +4 -0
- package/src/components/global-styles-sidebar/index.js +4 -4
- package/src/components/layout/index.js +36 -6
- package/src/components/page-patterns/delete-category-menu-item.js +3 -4
- package/src/components/page-patterns/fields.js +12 -11
- package/src/components/page-patterns/index.js +16 -14
- package/src/components/page-templates/fields.js +4 -15
- package/src/components/page-templates/index.js +18 -13
- package/src/components/post-edit/index.js +36 -2
- package/src/components/post-list/index.js +43 -39
- 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/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/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/index.js +5 -0
- 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/utils/is-previewing-theme.js +1 -3
- package/src/utils/use-activate-theme.js +4 -3
- 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/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/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","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","isRTL","chevronRightSmall","chevronLeftSmall","Icon","privateApis","routerPrivateApis","useContext","unlock","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","useHistory","SidebarNavigationItem","className","icon","withChevron","suffix","uid","
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","isRTL","chevronRightSmall","chevronLeftSmall","Icon","privateApis","routerPrivateApis","useContext","unlock","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","useHistory","useLink","SidebarNavigationItem","className","icon","withChevron","suffix","uid","to","onClick","children","props","history","navigate","handleClick","e","preventDefault","linkProps","id","href","undefined","justify","style","fill","size"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLink } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tto,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( to ) {\n\t\t\te.preventDefault();\n\t\t\thistory.navigate( to );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\tconst linkProps = useLink( to );\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tid={ uid }\n\t\t\tonClick={ handleClick }\n\t\t\thref={ to ? linkProps.href : undefined }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! withChevron && suffix }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,SAAS,QACH,uBAAuB;AAC9B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,iBAAiB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,kBAAkB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtD,MAAM;EAAEC,UAAU;EAAEC;AAAQ,CAAC,GAAGP,MAAM,CAAEF,iBAAkB,CAAC;AAE3D,eAAe,SAASU,qBAAqBA,CAAE;EAC9CC,SAAS;EACTC,IAAI;EACJC,WAAW,GAAG,KAAK;EACnBC,MAAM;EACNC,GAAG;EACHC,EAAE;EACFC,OAAO;EACPC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,OAAO,GAAGZ,UAAU,CAAC,CAAC;EAC5B,MAAM;IAAEa;EAAS,CAAC,GAAGpB,U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
|
@@ -74,7 +74,7 @@ export default function SidebarNavigationScreen({
|
|
|
74
74
|
className: "edit-site-sidebar-navigation-screen__title-icon",
|
|
75
75
|
children: [!isRoot && /*#__PURE__*/_jsx(SidebarButton, {
|
|
76
76
|
onClick: () => {
|
|
77
|
-
history.
|
|
77
|
+
history.navigate(backPath);
|
|
78
78
|
navigate('back');
|
|
79
79
|
},
|
|
80
80
|
icon: icon,
|
|
@@ -83,7 +83,7 @@ export default function SidebarNavigationScreen({
|
|
|
83
83
|
}), isRoot && /*#__PURE__*/_jsx(SidebarButton, {
|
|
84
84
|
icon: icon,
|
|
85
85
|
label: dashboardLinkText || __('Go to the Dashboard'),
|
|
86
|
-
href: dashboardLink
|
|
86
|
+
href: dashboardLink
|
|
87
87
|
}), /*#__PURE__*/_jsx(Heading, {
|
|
88
88
|
className: "edit-site-sidebar-navigation-screen__title",
|
|
89
89
|
color: '#e0e0e0' /* $gray-200 */,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","useContext","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","select","getSettings","currentlyPreviewingThemeId","__experimentalDashboardLink","__experimentalDashboardLinkText","getTheme","name","rendered","undefined","location","history","navigate","state","icon","children","className","spacing","justify","alignment","onClick","
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","useContext","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","select","getSettings","currentlyPreviewingThemeId","__experimentalDashboardLink","__experimentalDashboardLinkText","getTheme","name","rendered","undefined","location","history","navigate","state","icon","children","className","spacing","justify","alignment","onClick","label","showTooltip","href","color","level","size"],"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\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA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AAA,CAACL,aAAa;UACbsC,IAAI,EAAGA,IAAM;UACbO,KAAK,EACJtB,iBAAiB,IAAInC,EAAE,CAAE,qBAAsB,CAC/C;UACD2D,IAAI,EAAGzB;QAAe,CACtB,CACD,eACDjB,IAAA,CAACrB,OAAO;UACPwD,SAAS,EAAC,4CAA4C;UACtDQ,KAAK,EAAG,SAAS,CAAC,eAAiB;UACnCC,KAAK,EAAG,CAAG;UACXC,IAAI,EAAG,EAAI;UAAAX,QAAA,EAET,CAAEtC,iBAAiB,CAAC,CAAC,GACpBa,KAAK,GACLzB,OAAO,CACP;UACAD,EAAE,CAAE,uBAAwB,CAAC,EAC7BoC,mBAAmB,EACnBV,KACA;QAAC,CACI,CAAC,EACRC,OAAO,iBACRV,IAAA;UAAKmC,SAAS,EAAC,8CAA8C;UAAAD,QAAA,EAC1DxB;QAAO,CACL,CACL;MAAA,CACM,CAAC,EACPC,IAAI,iBACLX,IAAA,CAAAI,SAAA;QAAA8B,QAAA,eACClC,IAAA;UAAKmC,SAAS,EAAC,2CAA2C;UAAAD,QAAA,EACvDvB;QAAI,CACF;MAAC,CACL,CACF,eAEDT,KAAA;QAAKiC,SAAS,EAAC,8CAA8C;QAAAD,QAAA,GAC1DpB,WAAW,iBACZd,IAAA;UAAGmC,SAAS,EAAC,kDAAkD;UAAAD,QAAA,EAC5DpB;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACPb,IAAA;MAAQmC,SAAS,EAAC,6CAA6C;MAAAD,QAAA,EAC5DrB;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
6
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
7
6
|
import { useCallback } from '@wordpress/element';
|
|
8
7
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
8
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
9
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
@@ -25,27 +25,17 @@ const {
|
|
|
25
25
|
} = unlock(routerPrivateApis);
|
|
26
26
|
export function SidebarNavigationItemGlobalStyles(props) {
|
|
27
27
|
const {
|
|
28
|
-
|
|
28
|
+
name
|
|
29
29
|
} = useLocation();
|
|
30
|
-
const hasGlobalStyleVariations = useSelect(select => !!select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
|
|
31
|
-
if (hasGlobalStyleVariations) {
|
|
32
|
-
return /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
33
|
-
...props,
|
|
34
|
-
params: {
|
|
35
|
-
path: '/wp_global_styles'
|
|
36
|
-
},
|
|
37
|
-
uid: "global-styles-navigation-item",
|
|
38
|
-
"aria-current": params.path && params.path.startsWith('/wp_global_styles')
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
30
|
return /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
42
|
-
...props
|
|
31
|
+
...props,
|
|
32
|
+
"aria-current": name === 'styles'
|
|
43
33
|
});
|
|
44
34
|
}
|
|
45
35
|
export default function SidebarNavigationScreenGlobalStyles() {
|
|
46
36
|
const history = useHistory();
|
|
47
37
|
const {
|
|
48
|
-
|
|
38
|
+
path
|
|
49
39
|
} = useLocation();
|
|
50
40
|
const {
|
|
51
41
|
revisions,
|
|
@@ -62,14 +52,13 @@ export default function SidebarNavigationScreenGlobalStyles() {
|
|
|
62
52
|
set: setPreference
|
|
63
53
|
} = useDispatch(preferencesStore);
|
|
64
54
|
const openGlobalStyles = useCallback(async () => {
|
|
65
|
-
history.
|
|
66
|
-
...params,
|
|
55
|
+
history.navigate(addQueryArgs(path, {
|
|
67
56
|
canvas: 'edit'
|
|
68
|
-
},
|
|
57
|
+
}), {
|
|
69
58
|
transition: 'canvas-mode-edit-transition'
|
|
70
59
|
});
|
|
71
60
|
return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
|
|
72
|
-
}, [
|
|
61
|
+
}, [path, history, openGeneralSidebar, setPreference]);
|
|
73
62
|
const openRevisions = useCallback(async () => {
|
|
74
63
|
await openGlobalStyles();
|
|
75
64
|
// Open the global styles revisions once the canvas mode is set to edit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","
|
|
1
|
+
{"version":3,"names":["__","useDispatch","useCallback","store","preferencesStore","privateApis","routerPrivateApis","addQueryArgs","SidebarNavigationScreen","unlock","editSiteStore","SidebarNavigationItem","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","MainSidebarNavigationContent","jsx","_jsx","Fragment","_Fragment","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","name","SidebarNavigationScreenGlobalStyles","history","path","revisions","isLoading","isLoadingRevisions","revisionsCount","openGeneralSidebar","setEditorCanvasContainerView","set","setPreference","openGlobalStyles","navigate","canvas","transition","Promise","all","openRevisions","shouldShowGlobalStylesFooter","children","title","isRoot","description","content","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASN,KAAK,IAAIO,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,wBAAwB,MAAM,+DAA+D;AACpG,OAAOC,oCAAoC,MAAM,6CAA6C;AAC9F,SAASC,4BAA4B,QAAQ,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAEjF,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGX,MAAM,CAAEH,iBAAkB,CAAC;AAE/D,OAAO,SAASe,iCAAiCA,CAAEC,KAAK,EAAG;EAC1D,MAAM;IAAEC;EAAK,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAC9B,oBACCH,IAAA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AAEZ,cAAc,IAAI,CAAED,kBAAkB;EAE1C,oBACCb,IAAA,CAAAE,SAAA;IAAAyB,QAAA,eACC3B,IAAA,CAACR,uBAAuB;MACvBoC,KAAK,EAAG5C,EAAE,CAAE,QAAS,CAAG;MACxB6C,MAAM;MACNC,WAAW,EAAG9C,EAAE,CACf,kEACD,CAAG;MACH+C,OAAO,eACN/B,IAAA,CAACF,4BAA4B;QAACkC,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLP,4BAA4B,iBAC3B1B,IAAA,CAACH,oCAAoC;QACpCqC,MAAM,EAAGvB,SAAS,GAAI,CAAC,CAAI;QAC3BG,cAAc,EAAGA,cAAgB;QACjCqB,OAAO,EAAGV;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -15,43 +15,35 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
|
15
15
|
import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
17
|
import { store as editSiteStore } from '../../store';
|
|
18
|
-
import { NAVIGATION_POST_TYPE, TEMPLATE_POST_TYPE, PATTERN_TYPES } from '../../utils/constants';
|
|
19
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
export function MainSidebarNavigationContent() {
|
|
21
20
|
return /*#__PURE__*/_jsxs(ItemGroup, {
|
|
22
21
|
children: [/*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
23
22
|
uid: "navigation-navigation-item",
|
|
24
|
-
|
|
25
|
-
postType: NAVIGATION_POST_TYPE
|
|
26
|
-
},
|
|
23
|
+
to: "/navigation",
|
|
27
24
|
withChevron: true,
|
|
28
25
|
icon: navigation,
|
|
29
26
|
children: __('Navigation')
|
|
30
27
|
}), /*#__PURE__*/_jsx(SidebarNavigationItemGlobalStyles, {
|
|
31
|
-
|
|
28
|
+
to: "/styles",
|
|
29
|
+
uid: "global-styles-navigation-item",
|
|
32
30
|
icon: styles,
|
|
33
31
|
children: __('Styles')
|
|
34
32
|
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
35
33
|
uid: "page-navigation-item",
|
|
36
|
-
|
|
37
|
-
postType: 'page'
|
|
38
|
-
},
|
|
34
|
+
to: "/page",
|
|
39
35
|
withChevron: true,
|
|
40
36
|
icon: page,
|
|
41
37
|
children: __('Pages')
|
|
42
38
|
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
43
39
|
uid: "template-navigation-item",
|
|
44
|
-
|
|
45
|
-
postType: TEMPLATE_POST_TYPE
|
|
46
|
-
},
|
|
40
|
+
to: "/template",
|
|
47
41
|
withChevron: true,
|
|
48
42
|
icon: layout,
|
|
49
43
|
children: __('Templates')
|
|
50
44
|
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
51
45
|
uid: "patterns-navigation-item",
|
|
52
|
-
|
|
53
|
-
postType: PATTERN_TYPES.user
|
|
54
|
-
},
|
|
46
|
+
to: "/pattern",
|
|
55
47
|
withChevron: true,
|
|
56
48
|
icon: symbol,
|
|
57
49
|
children: __('Patterns')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","jsx","_jsx","jsxs","_jsxs","MainSidebarNavigationContent","children","uid","to","withChevron","icon","SidebarNavigationScreenMain","setEditorCanvasContainerView","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":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAEC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAC3E,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErD,OAAO,SAASC,4BAA4BA,CAAA,EAAG;EAC9C,oBACCD,KAAA,CAAClB,SAAS;IAAAoB,QAAA,gBACTJ,IAAA,CAACN,qBAAqB;MACrBW,GAAG,EAAC,4BAA4B;MAChCC,EAAE,EAAC,aAAa;MAChBC,WAAW;MACXC,IAAI,EAAGpB,UAAY;MAAAgB,QAAA,EAEjBnB,EAAE,CAAE,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@@ export default function ScreenNavigationMoreMenu(props) {
|
|
|
56
56
|
children: __('Rename')
|
|
57
57
|
}), /*#__PURE__*/_jsx(MenuItem, {
|
|
58
58
|
onClick: () => {
|
|
59
|
-
history.
|
|
60
|
-
postId: menuId,
|
|
61
|
-
postType: 'wp_navigation',
|
|
62
|
-
canvas: 'edit'
|
|
63
|
-
});
|
|
59
|
+
history.navigate(`/wp_navigation/${menuId}?canvas=edit`);
|
|
64
60
|
},
|
|
65
61
|
children: __('Edit')
|
|
66
62
|
}), /*#__PURE__*/_jsx(MenuItem, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DropdownMenu","MenuItem","MenuGroup","moreVertical","__","useState","privateApis","routerPrivateApis","RenameModal","DeleteConfirmDialog","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","children","className","label","icon","popoverProps","onClose","onClick","
|
|
1
|
+
{"version":3,"names":["DropdownMenu","MenuItem","MenuGroup","moreVertical","__","useState","privateApis","routerPrivateApis","RenameModal","DeleteConfirmDialog","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","children","className","label","icon","popoverProps","onClose","onClick","navigate","isDestructive","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":"AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,uBAAuB;AACzE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,EAA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
|
|
|
36
36
|
createSuccessNotice(__('Navigation Menu successfully deleted.'), {
|
|
37
37
|
type: 'snackbar'
|
|
38
38
|
});
|
|
39
|
-
history.
|
|
40
|
-
postType: 'wp_navigation'
|
|
41
|
-
});
|
|
39
|
+
history.navivate('/navigation');
|
|
42
40
|
} catch (error) {
|
|
43
41
|
createErrorNotice(sprintf(/* translators: %s: error message describing why the navigation menu could not be deleted. */
|
|
44
42
|
__(`Unable to delete Navigation Menu (%s).`), error?.message), {
|
|
@@ -122,10 +120,7 @@ function useDuplicateNavigationMenu() {
|
|
|
122
120
|
createSuccessNotice(__('Duplicated Navigation Menu'), {
|
|
123
121
|
type: 'snackbar'
|
|
124
122
|
});
|
|
125
|
-
history.
|
|
126
|
-
postType,
|
|
127
|
-
postId: savedRecord.id
|
|
128
|
-
});
|
|
123
|
+
history.navigate(`/wp_navigation/${savedRecord.id}`);
|
|
129
124
|
}
|
|
130
125
|
} catch (error) {
|
|
131
126
|
createErrorNotice(sprintf(/* translators: %s: error message describing why the navigation menu could not be deleted. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","coreStore","__","_x","sprintf","useSelect","useDispatch","noticesStore","privateApis","routerPrivateApis","postType","NAVIGATION_POST_TYPE","unlock","useHistory","useDeleteNavigationMenu","deleteEntityRecord","createSuccessNotice","createErrorNotice","history","handleDelete","navigationMenu","postId","id","force","throwOnError","type","
|
|
1
|
+
{"version":3,"names":["store","coreStore","__","_x","sprintf","useSelect","useDispatch","noticesStore","privateApis","routerPrivateApis","postType","NAVIGATION_POST_TYPE","unlock","useHistory","useDeleteNavigationMenu","deleteEntityRecord","createSuccessNotice","createErrorNotice","history","handleDelete","navigationMenu","postId","id","force","throwOnError","type","navivate","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","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: useSa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C,EAED;QACCH,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOmB,eAAe;AACvB;AAEA,eAAe,SAASU,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNnC,YAAY,EAAEL,uBAAuB,CAAC,CAAC;IACvCsB,UAAU,EAAEP,qBAAqB,CAAC,CAAC;IACnCe,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
|
|
@@ -14,7 +14,6 @@ import { navigation } from '@wordpress/icons';
|
|
|
14
14
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
15
15
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
16
16
|
import { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';
|
|
17
|
-
import { useLink } from '../routes/link';
|
|
18
17
|
import SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';
|
|
19
18
|
import useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';
|
|
20
19
|
import { unlock } from '../../lock-unlock';
|
|
@@ -122,12 +121,8 @@ const NavMenuItem = ({
|
|
|
122
121
|
postId,
|
|
123
122
|
...props
|
|
124
123
|
}) => {
|
|
125
|
-
const linkInfo = useLink({
|
|
126
|
-
postId,
|
|
127
|
-
postType: 'wp_navigation'
|
|
128
|
-
});
|
|
129
124
|
return /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
130
|
-
|
|
125
|
+
to: `/wp_navigation/${postId}`,
|
|
131
126
|
...props
|
|
132
127
|
});
|
|
133
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","
|
|
1
|
+
{"version":3,"names":["__","_x","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","SingleNavigationMenu","useNavigationMenuHandlers","unlock","NAVIGATION_POST_TYPE","jsx","_jsx","buildMenuLabel","title","id","status","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","isLoading","getNavigationFallbackId","isCreatingNavigationFallback","select","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","SidebarNavigationScreenWrapper","children","className","description","navigationMenu","edits","map","index","NavMenuItem","postId","withChevron","icon","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAA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V,UAAU,CAAED,mBAAmB,EAAEW,KAAM;IACvC,CACD,CAAC;EAEJ;EAEA,oBACC5B,IAAA,CAACuB,8BAA8B;IAACjB,QAAQ,EAAGA,QAAU;IAAAkB,QAAA,eACpDxB,IAAA,CAACX,SAAS;MAAAmC,QAAA,EACPhB,eAAe,EAAEqB,GAAG,CAAE,CAAE;QAAE1B,EAAE;QAAED,KAAK;QAAEE;MAAO,CAAC,EAAE0B,KAAK,kBACrD9B,IAAA,CAAC+B,WAAW;QACXC,MAAM,EAAG7B,EAAI;QAEb8B,WAAW;QACXC,IAAI,EAAG3C,UAAY;QAAAiC,QAAA,EAEjBvB,cAAc,CAAEC,KAAK,EAAEiC,QAAQ,EAAEL,KAAK,GAAG,CAAC,EAAE1B,MAAO;MAAC,GAJhDD,EAKM,CACZ;IAAC,CACO;EAAC,CACmB,CAAC;AAEnC;AAEA,OAAO,SAASoB,8BAA8BA,CAAE;EAC/CC,QAAQ;EACRY,OAAO;EACPlC,KAAK;EACLwB,WAAW;EACXpB;AACD,CAAC,EAAG;EACH,oBACCN,IAAA,CAACR,uBAAuB;IACvBU,KAAK,EAAGA,KAAK,IAAItB,EAAE,CAAE,YAAa,CAAG;IACrCwD,OAAO,EAAGA,OAAS;IACnBV,WAAW,EAAGA,WAAW,IAAI9C,EAAE,CAAE,+BAAgC,CAAG;IACpE0B,QAAQ,EAAGA,QAAU;IACrB+B,OAAO,EAAGb;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMO,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGM;AAAM,CAAC,KAAM;EAC/C,oBACCtC,IAAA,CAACP,qBAAqB;IACrB8C,EAAE,EAAG,kBAAmBP,MAAM,EAAK;IAAA,GAC9BM;EAAK,CACV,CAAC;AAEJ,CAAC","ignoreList":[]}
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js
CHANGED
|
@@ -20,10 +20,14 @@ const POPOVER_PROPS = {
|
|
|
20
20
|
import { unlock } from '../../lock-unlock';
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
22
|
const {
|
|
23
|
-
useHistory
|
|
23
|
+
useHistory,
|
|
24
|
+
useLocation
|
|
24
25
|
} = unlock(routerPrivateApis);
|
|
25
26
|
export default function LeafMoreMenu(props) {
|
|
26
27
|
const history = useHistory();
|
|
28
|
+
const {
|
|
29
|
+
path
|
|
30
|
+
} = useLocation();
|
|
27
31
|
const {
|
|
28
32
|
block
|
|
29
33
|
} = props;
|
|
@@ -57,30 +61,20 @@ export default function LeafMoreMenu(props) {
|
|
|
57
61
|
name
|
|
58
62
|
} = selectedBlock;
|
|
59
63
|
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
postType: attributes.type,
|
|
65
|
-
postId: attributes.id,
|
|
66
|
-
canvas: 'edit'
|
|
67
|
-
}, {
|
|
68
|
-
backPath: params
|
|
64
|
+
history.navigate(`/${attributes.type}/${attributes.id}?canvas=edit`, {
|
|
65
|
+
state: {
|
|
66
|
+
backPath: path
|
|
67
|
+
}
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
if (name === 'core/page-list-item' && attributes.id && history) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
postType: 'page',
|
|
77
|
-
postId: attributes.id,
|
|
78
|
-
canvas: 'edit'
|
|
79
|
-
}, {
|
|
80
|
-
backPath: params
|
|
71
|
+
history.navigate(`/page/${attributes.id}?canvas=edit`, {
|
|
72
|
+
state: {
|
|
73
|
+
backPath: path
|
|
74
|
+
}
|
|
81
75
|
});
|
|
82
76
|
}
|
|
83
|
-
}, [history]);
|
|
77
|
+
}, [path, history]);
|
|
84
78
|
return /*#__PURE__*/_jsx(DropdownMenu, {
|
|
85
79
|
icon: moreVertical,
|
|
86
80
|
label: __('Options'),
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["chevronUp","chevronDown","moreVertical","DropdownMenu","MenuItem","MenuGroup","useDispatch","useSelect","useCallback","__","sprintf","BlockTitle","store","blockEditorStore","privateApis","routerPrivateApis","POPOVER_PROPS","className","placement","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","LeafMoreMenu","props","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","removeLabel","maximumLength","goToLabel","rootClientId","select","getBlockRootClientId","onGoToPage","selectedBlock","attributes","name","kind","id","type","
|
|
1
|
+
{"version":3,"names":["chevronUp","chevronDown","moreVertical","DropdownMenu","MenuItem","MenuGroup","useDispatch","useSelect","useCallback","__","sprintf","BlockTitle","store","blockEditorStore","privateApis","routerPrivateApis","POPOVER_PROPS","className","placement","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","useLocation","LeafMoreMenu","props","history","path","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","removeLabel","maximumLength","goToLabel","rootClientId","select","getBlockRootClientId","onGoToPage","selectedBlock","attributes","name","kind","id","type","navigate","state","backPath","icon","label","popoverProps","noIcons","children","onClose","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { chevronUp, chevronDown, moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockTitle, store as blockEditorStore } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\n\tconst history = useHistory();\n\tconst { path } = useLocation();\n\tconst { block } = props;\n\tconst { clientId } = block;\n\tconst { moveBlocksDown, moveBlocksUp, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst removeLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst goToLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Go to %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst rootClientId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId } = select( blockEditorStore );\n\n\t\t\treturn getBlockRootClientId( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst onGoToPage = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes, name } = 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.navigate(\n\t\t\t\t\t`/${ attributes.type }/${ attributes.id }?canvas=edit`,\n\t\t\t\t\t{\n\t\t\t\t\t\tstate: { backPath: path },\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( name === 'core/page-list-item' && attributes.id && history ) {\n\t\t\t\thistory.navigate( `/page/${ attributes.id }?canvas=edit`, {\n\t\t\t\t\tstate: { backPath: path },\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ path, history ]\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tnoIcons\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronUp }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksUp( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move up' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksDown( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move down' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t{ block.attributes?.type === 'page' &&\n\t\t\t\t\t\t\tblock.attributes?.id && (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonGoToPage( block );\n\t\t\t\t\t\t\t\t\t\tonClose();\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\t\t{ goToLabel }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tremoveBlocks( [ clientId ], false );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ removeLabel }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\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