@wordpress/edit-site 6.9.0 → 6.11.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 +4 -0
- 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/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +1 -1
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +8 -8
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +3 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +29 -20
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +10 -8
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +23 -11
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-adapt-editor-to-canvas.js +49 -0
- package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
- package/build/components/editor/use-editor-title.js +2 -2
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +41 -25
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js +1 -1
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +1 -0
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- 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 +4 -3
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +1 -0
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +14 -15
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js +1 -2
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +4 -4
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/palette.js +16 -13
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/root-menu.js +0 -4
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -6
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-css.js +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +3 -8
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +3 -3
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-root.js +0 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +14 -3
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/shadow-utils.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +26 -15
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +1 -4
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +1 -5
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +1 -4
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +27 -14
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +2 -2
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js +0 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +43 -36
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/animation.js +1 -3
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/layout/index.js +23 -47
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +17 -140
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +3 -3
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/header.js +1 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +4 -2
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +1 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-templates/index.js +2 -2
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +1 -1
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/post-edit/index.js +8 -4
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +8 -54
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +1 -1
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app/router.js +4 -4
- package/build/components/posts-app/router.js.map +1 -1
- package/build/components/resizable-frame/index.js +21 -9
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/use-title.js +1 -1
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +3 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-keyboard-shortcut/index.js +78 -0
- package/build/components/save-keyboard-shortcut/index.js.map +1 -0
- package/build/components/save-panel/index.js +17 -6
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +1 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +2 -1
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +30 -10
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +3 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +7 -12
- 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 +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/site-editor-routes/home-edit.js +26 -0
- package/build/components/site-editor-routes/home-edit.js.map +1 -0
- package/build/components/site-editor-routes/home-view.js +25 -0
- package/build/components/site-editor-routes/home-view.js.map +1 -0
- package/build/components/site-editor-routes/index.js +49 -0
- package/build/components/site-editor-routes/index.js.map +1 -0
- package/build/components/site-editor-routes/navigation-edit.js +29 -0
- package/build/components/site-editor-routes/navigation-edit.js.map +1 -0
- package/build/components/site-editor-routes/navigation-item-edit.js +31 -0
- package/build/components/site-editor-routes/navigation-item-edit.js.map +1 -0
- package/build/components/site-editor-routes/navigation-item-view.js +30 -0
- package/build/components/site-editor-routes/navigation-item-view.js.map +1 -0
- package/build/components/site-editor-routes/navigation-view.js +28 -0
- package/build/components/site-editor-routes/navigation-view.js.map +1 -0
- package/build/components/site-editor-routes/pages-edit.js +43 -0
- package/build/components/site-editor-routes/pages-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js +64 -0
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-list-view.js +47 -0
- package/build/components/site-editor-routes/pages-list-view.js.map +1 -0
- package/build/components/site-editor-routes/pages-view-quick-edit.js +61 -0
- package/build/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-view.js +42 -0
- package/build/components/site-editor-routes/pages-view.js.map +1 -0
- package/build/components/site-editor-routes/patterns-edit.js +31 -0
- package/build/components/site-editor-routes/patterns-edit.js.map +1 -0
- package/build/components/site-editor-routes/patterns-view.js +29 -0
- package/build/components/site-editor-routes/patterns-view.js.map +1 -0
- package/build/components/site-editor-routes/styles-edit.js +28 -0
- package/build/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build/components/site-editor-routes/styles-view.js +27 -0
- package/build/components/site-editor-routes/styles-view.js.map +1 -0
- package/build/components/site-editor-routes/templates-edit.js +31 -0
- package/build/components/site-editor-routes/templates-edit.js.map +1 -0
- package/build/components/site-editor-routes/templates-list-view.js +34 -0
- package/build/components/site-editor-routes/templates-list-view.js.map +1 -0
- package/build/components/site-editor-routes/templates-view.js +29 -0
- package/build/components/site-editor-routes/templates-view.js.map +1 -0
- package/build/components/site-hub/index.js +3 -2
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/color-examples.js +46 -0
- package/build/components/style-book/color-examples.js.map +1 -0
- package/build/components/style-book/constants.js +75 -10
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/duotone-examples.js +55 -0
- package/build/components/style-book/duotone-examples.js.map +1 -0
- package/build/components/style-book/examples.js +46 -3
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +92 -36
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/deprecated.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +46 -30
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +15 -11
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +12 -15
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +2 -4
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -1
- package/build/posts.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +8 -61
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +4 -12
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +9 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +1 -3
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +2 -3
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -2
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -3
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +2 -4
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +9 -9
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +6 -5
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +30 -21
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +10 -8
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +24 -14
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.js +42 -0
- package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
- package/build-module/components/editor/use-editor-title.js +3 -3
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +1 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +45 -31
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js +2 -3
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +1 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +1 -0
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +2 -3
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -3
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -2
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +1 -2
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +5 -6
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -3
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +1 -2
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +15 -18
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +2 -4
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +5 -7
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +1 -2
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +1 -2
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +1 -2
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +17 -15
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js +1 -3
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +1 -2
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +1 -7
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +1 -3
- package/build-module/components/global-styles/screen-background.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +3 -9
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -3
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +1 -3
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +2 -4
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +1 -3
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +5 -12
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +4 -5
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -6
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +15 -6
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +1 -3
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +1 -3
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-utils.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +28 -19
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +2 -7
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/size-control/index.js +1 -2
- package/build-module/components/global-styles/size-control/index.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +2 -6
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typeset.js +3 -5
- package/build-module/components/global-styles/typeset.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +3 -7
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js +1 -2
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +28 -17
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +3 -3
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +1 -2
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js +0 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +1 -2
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +1 -4
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +45 -39
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/animation.js +1 -3
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/index.js +24 -50
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +17 -139
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/page/header.js +1 -2
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +1 -2
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +5 -7
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +1 -2
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -3
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +5 -4
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +1 -3
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -2
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +2 -2
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +2 -3
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +9 -6
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +10 -55
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +2 -4
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +3 -4
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app/router.js +3 -3
- package/build-module/components/posts-app/router.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +21 -12
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +2 -3
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/use-title.js +1 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +3 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-keyboard-shortcut/index.js +71 -0
- package/build-module/components/save-keyboard-shortcut/index.js.map +1 -0
- package/build-module/components/save-panel/index.js +18 -8
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +1 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +1 -3
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -3
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +1 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +2 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +1 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +1 -2
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +3 -4
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +2 -3
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +1 -2
- 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 +31 -13
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -3
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -6
- 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/build-navigation-label.js +4 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +8 -13
- 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 +3 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -3
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +1 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/site-editor-routes/home-edit.js +18 -0
- package/build-module/components/site-editor-routes/home-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/home-view.js +17 -0
- package/build-module/components/site-editor-routes/home-view.js.map +1 -0
- package/build-module/components/site-editor-routes/index.js +42 -0
- package/build-module/components/site-editor-routes/index.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-edit.js +21 -0
- package/build-module/components/site-editor-routes/navigation-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-item-edit.js +23 -0
- package/build-module/components/site-editor-routes/navigation-item-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-item-view.js +22 -0
- package/build-module/components/site-editor-routes/navigation-item-view.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-view.js +20 -0
- package/build-module/components/site-editor-routes/navigation-view.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-edit.js +35 -0
- package/build-module/components/site-editor-routes/pages-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-list-view.js +39 -0
- package/build-module/components/site-editor-routes/pages-list-view.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js +53 -0
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-view.js +34 -0
- package/build-module/components/site-editor-routes/pages-view.js.map +1 -0
- package/build-module/components/site-editor-routes/patterns-edit.js +23 -0
- package/build-module/components/site-editor-routes/patterns-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/patterns-view.js +21 -0
- package/build-module/components/site-editor-routes/patterns-view.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-edit.js +20 -0
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-view.js +19 -0
- package/build-module/components/site-editor-routes/styles-view.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-edit.js +23 -0
- package/build-module/components/site-editor-routes/templates-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-list-view.js +26 -0
- package/build-module/components/site-editor-routes/templates-list-view.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-view.js +21 -0
- package/build-module/components/site-editor-routes/templates-view.js.map +1 -0
- package/build-module/components/site-hub/index.js +4 -4
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/color-examples.js +38 -0
- package/build-module/components/style-book/color-examples.js.map +1 -0
- package/build-module/components/style-book/constants.js +74 -9
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/duotone-examples.js +48 -0
- package/build-module/components/style-book/duotone-examples.js.map +1 -0
- package/build-module/components/style-book/examples.js +47 -3
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +95 -40
- 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/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -3
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +1 -2
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +1 -3
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -3
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +1 -3
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -3
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +46 -30
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +15 -11
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +12 -15
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +2 -4
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -1
- package/build-module/posts.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +6 -59
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -11
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +9 -18
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-filtered-template-parts.js.map +1 -1
- package/build-style/posts-rtl.css +39 -45
- package/build-style/posts.css +39 -45
- package/build-style/style-rtl.css +160 -60
- package/build-style/style.css +160 -60
- package/package.json +44 -42
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/add-new-template/index.js +1 -1
- package/src/components/add-new-template/utils.js +12 -9
- package/src/components/app/index.js +4 -2
- package/src/components/block-editor/use-editor-iframe-props.js +22 -18
- package/src/components/block-editor/use-site-editor-settings.js +12 -10
- package/src/components/editor/index.js +34 -14
- package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
- package/src/components/editor/use-editor-title.js +3 -3
- package/src/components/global-styles/font-families.js +51 -35
- package/src/components/global-styles/font-sizes/font-size.js +20 -21
- package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -4
- package/src/components/global-styles/font-sizes/font-sizes.js +7 -9
- package/src/components/global-styles/palette.js +21 -18
- package/src/components/global-styles/root-menu.js +3 -16
- package/src/components/global-styles/screen-block-list.js +1 -8
- package/src/components/global-styles/screen-css.js +1 -0
- package/src/components/global-styles/screen-revisions/index.js +2 -11
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/src/components/global-styles/screen-root.js +3 -12
- package/src/components/global-styles/screen-style-variations.js +11 -3
- package/src/components/global-styles/shadows-edit-panel.js +33 -18
- package/src/components/global-styles/shadows-panel.js +0 -4
- package/src/components/global-styles/style-variations-container.js +2 -7
- package/src/components/global-styles/typography-elements.js +3 -11
- package/src/components/global-styles/ui.js +29 -12
- package/src/components/global-styles/variations/variation.js +3 -3
- package/src/components/global-styles/variations/variations-panel.js +0 -1
- package/src/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/src/components/global-styles-sidebar/index.js +86 -75
- package/src/components/global-styles-sidebar/style.scss +6 -0
- package/src/components/layout/animation.js +0 -1
- package/src/components/layout/index.js +17 -51
- package/src/components/layout/router.js +18 -133
- package/src/components/layout/style.scss +2 -2
- package/src/components/page-patterns/delete-category-menu-item.js +4 -4
- package/src/components/page-patterns/index.js +3 -2
- package/src/components/page-patterns/use-pattern-settings.js +1 -1
- package/src/components/page-templates/index.js +0 -1
- package/src/components/pagination/index.js +1 -1
- package/src/components/post-edit/index.js +35 -4
- package/src/components/post-fields/index.js +7 -54
- package/src/components/post-fields/style.scss +3 -0
- package/src/components/post-list/index.js +1 -1
- package/src/components/post-list/style.scss +1 -1
- package/src/components/posts-app/index.js +2 -2
- package/src/components/posts-app/router.js +3 -3
- package/src/components/resizable-frame/index.js +19 -10
- package/src/components/revisions/index.js +4 -1
- package/src/components/save-keyboard-shortcut/index.js +69 -0
- package/src/components/save-panel/index.js +30 -32
- package/src/components/sidebar-button/index.js +1 -1
- package/src/components/sidebar-button/style.scss +2 -2
- package/src/components/sidebar-dataviews/default-views.js +2 -5
- package/src/components/sidebar-navigation-screen/index.js +2 -1
- package/src/components/sidebar-navigation-screen/style.scss +5 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +47 -29
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +11 -13
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
- package/src/components/site-editor-routes/README.md +20 -0
- package/src/components/site-editor-routes/home-edit.js +17 -0
- package/src/components/site-editor-routes/home-view.js +16 -0
- package/src/components/site-editor-routes/index.js +60 -0
- package/src/components/site-editor-routes/navigation-edit.js +22 -0
- package/src/components/site-editor-routes/navigation-item-edit.js +26 -0
- package/src/components/site-editor-routes/navigation-item-view.js +25 -0
- package/src/components/site-editor-routes/navigation-view.js +21 -0
- package/src/components/site-editor-routes/pages-edit.js +35 -0
- package/src/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
- package/src/components/site-editor-routes/pages-list-view.js +44 -0
- package/src/components/site-editor-routes/pages-view-quick-edit.js +53 -0
- package/src/components/site-editor-routes/pages-view.js +39 -0
- package/src/components/site-editor-routes/patterns-edit.js +24 -0
- package/src/components/site-editor-routes/patterns-view.js +22 -0
- package/src/components/site-editor-routes/styles-edit.js +17 -0
- package/src/components/site-editor-routes/styles-view.js +16 -0
- package/src/components/site-editor-routes/templates-edit.js +22 -0
- package/src/components/site-editor-routes/templates-list-view.js +28 -0
- package/src/components/site-editor-routes/templates-view.js +22 -0
- package/src/components/site-hub/index.js +2 -2
- package/src/components/site-hub/style.scss +4 -0
- package/src/components/style-book/color-examples.tsx +44 -0
- package/src/components/style-book/constants.ts +83 -10
- package/src/components/style-book/duotone-examples.tsx +53 -0
- package/src/components/style-book/examples.tsx +113 -0
- package/src/components/style-book/index.js +149 -52
- package/src/components/style-book/style.scss +12 -14
- package/src/components/style-book/test/categories.js +0 -5
- package/src/components/style-book/types.ts +34 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +11 -1
- package/src/hooks/commands/use-common-commands.js +60 -40
- package/src/hooks/commands/use-edit-mode-commands.js +14 -18
- package/src/hooks/commands/use-set-command-context.js +7 -9
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/src/index.js +1 -5
- package/src/store/private-actions.js +7 -82
- package/src/store/private-selectors.js +4 -11
- package/src/store/reducer.js +10 -18
- package/src/style.scss +3 -0
- package/build/components/keyboard-shortcuts/global.js +0 -53
- package/build/components/keyboard-shortcuts/global.js.map +0 -1
- package/build/components/keyboard-shortcuts/register.js +0 -34
- package/build/components/keyboard-shortcuts/register.js.map +0 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -69
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/global.js +0 -46
- package/build-module/components/keyboard-shortcuts/global.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -27
- package/build-module/components/keyboard-shortcuts/register.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -62
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
- package/src/components/keyboard-shortcuts/global.js +0 -47
- package/src/components/keyboard-shortcuts/register.js +0 -27
- package/src/components/style-book/examples.ts +0 -63
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -73
|
@@ -14,6 +14,7 @@ var _compose = require("@wordpress/compose");
|
|
|
14
14
|
var _element = require("@wordpress/element");
|
|
15
15
|
var _editor = require("@wordpress/editor");
|
|
16
16
|
var _preferences = require("@wordpress/preferences");
|
|
17
|
+
var _router = require("@wordpress/router");
|
|
17
18
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
18
19
|
var _lockUnlock = require("../../lock-unlock");
|
|
19
20
|
var _store = require("../../store");
|
|
@@ -32,13 +33,18 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
32
33
|
* Internal dependencies
|
|
33
34
|
*/
|
|
34
35
|
|
|
36
|
+
const {
|
|
37
|
+
useLocation,
|
|
38
|
+
useHistory
|
|
39
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
35
40
|
function SidebarNavigationItemGlobalStyles(props) {
|
|
36
41
|
const {
|
|
37
42
|
openGeneralSidebar
|
|
38
43
|
} = (0, _data.useDispatch)(_store.store);
|
|
44
|
+
const history = useHistory();
|
|
39
45
|
const {
|
|
40
|
-
|
|
41
|
-
} = (
|
|
46
|
+
params
|
|
47
|
+
} = useLocation();
|
|
42
48
|
const hasGlobalStyleVariations = (0, _data.useSelect)(select => !!select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
|
|
43
49
|
if (hasGlobalStyleVariations) {
|
|
44
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
@@ -53,7 +59,12 @@ function SidebarNavigationItemGlobalStyles(props) {
|
|
|
53
59
|
...props,
|
|
54
60
|
onClick: () => {
|
|
55
61
|
// Switch to edit mode.
|
|
56
|
-
|
|
62
|
+
history.push({
|
|
63
|
+
...params,
|
|
64
|
+
canvas: 'edit'
|
|
65
|
+
}, undefined, {
|
|
66
|
+
transition: 'canvas-mode-edit-transition'
|
|
67
|
+
});
|
|
57
68
|
// Open global styles sidebar.
|
|
58
69
|
openGeneralSidebar('edit-site/global-styles');
|
|
59
70
|
}
|
|
@@ -62,6 +73,13 @@ function SidebarNavigationItemGlobalStyles(props) {
|
|
|
62
73
|
function SidebarNavigationScreenGlobalStyles({
|
|
63
74
|
backPath
|
|
64
75
|
}) {
|
|
76
|
+
const history = useHistory();
|
|
77
|
+
const {
|
|
78
|
+
params
|
|
79
|
+
} = useLocation();
|
|
80
|
+
const {
|
|
81
|
+
canvas = 'view'
|
|
82
|
+
} = params;
|
|
65
83
|
const {
|
|
66
84
|
revisions,
|
|
67
85
|
isLoading: isLoadingRevisions
|
|
@@ -74,17 +92,14 @@ function SidebarNavigationScreenGlobalStyles({
|
|
|
74
92
|
} = (0, _data.useDispatch)(_editor.store);
|
|
75
93
|
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
76
94
|
const {
|
|
77
|
-
setCanvasMode,
|
|
78
95
|
setEditorCanvasContainerView
|
|
79
96
|
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
80
97
|
const {
|
|
81
|
-
isViewMode,
|
|
82
98
|
isStyleBookOpened,
|
|
83
99
|
revisionsCount
|
|
84
100
|
} = (0, _data.useSelect)(select => {
|
|
85
101
|
var _globalStyles$_links$;
|
|
86
102
|
const {
|
|
87
|
-
getCanvasMode,
|
|
88
103
|
getEditorCanvasContainerView
|
|
89
104
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
90
105
|
const {
|
|
@@ -94,7 +109,6 @@ function SidebarNavigationScreenGlobalStyles({
|
|
|
94
109
|
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
95
110
|
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
96
111
|
return {
|
|
97
|
-
isViewMode: 'view' === getCanvasMode(),
|
|
98
112
|
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
|
99
113
|
revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
|
|
100
114
|
};
|
|
@@ -103,8 +117,14 @@ function SidebarNavigationScreenGlobalStyles({
|
|
|
103
117
|
set: setPreference
|
|
104
118
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
105
119
|
const openGlobalStyles = (0, _element.useCallback)(async () => {
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
history.push({
|
|
121
|
+
...params,
|
|
122
|
+
canvas: 'edit'
|
|
123
|
+
}, undefined, {
|
|
124
|
+
transition: 'canvas-mode-edit-transition'
|
|
125
|
+
});
|
|
126
|
+
return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
|
|
127
|
+
}, [history, params, openGeneralSidebar, setPreference]);
|
|
108
128
|
const openStyleBook = (0, _element.useCallback)(async () => {
|
|
109
129
|
await openGlobalStyles();
|
|
110
130
|
// Open the Style Book once the canvas mode is set to edit,
|
|
@@ -148,7 +168,7 @@ function SidebarNavigationScreenGlobalStyles({
|
|
|
148
168
|
onClick: async () => await openGlobalStyles()
|
|
149
169
|
})]
|
|
150
170
|
})
|
|
151
|
-
}), isStyleBookOpened && !isMobileViewport &&
|
|
171
|
+
}), isStyleBookOpened && !isMobileViewport && canvas === 'view' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styleBook.default, {
|
|
152
172
|
enableResizing: false,
|
|
153
173
|
isSelected: () => false,
|
|
154
174
|
onClick: openStyleBook,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_data","_coreData","_compose","_element","_editor","_preferences","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_sidebarNavigationItem","_styleBook","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_content","_jsxRuntime","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","useDispatch","editSiteStore","setCanvasMode","unlock","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","params","path","uid","onClick","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","useGlobalStylesRevisions","setIsListViewOpened","editorStore","isMobileViewport","useViewportMatch","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","preferencesStore","openGlobalStyles","useCallback","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","jsxs","Fragment","children","title","__","description","content","footer","record","actions","icon","seen","label","isPressed","edit","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport SidebarNavigationScreenGlobalStylesContent from './content';\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\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 hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\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\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\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\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAA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Ac,GAAA,EAAClB,UAAA,CAAAmB,OAAS;MACTyD,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1BtD,OAAO,EAAGgC,aAAe;MACzBuB,QAAQ,EAAGvB,aAAe;MAC1BwB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_data","_coreData","_compose","_element","_editor","_preferences","_router","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_sidebarNavigationItem","_styleBook","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_content","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","useDispatch","editSiteStore","history","params","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","path","uid","onClick","push","canvas","undefined","transition","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","useGlobalStylesRevisions","setIsListViewOpened","editorStore","isMobileViewport","useViewportMatch","setEditorCanvasContainerView","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","count","set","setPreference","preferencesStore","openGlobalStyles","useCallback","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","jsxs","Fragment","children","title","__","description","content","footer","record","actions","icon","seen","label","isPressed","edit","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport SidebarNavigationScreenGlobalStylesContent from './content';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\t...params,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t\t{\n\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isStyleBookOpened, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEditorCanvasContainerView } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.push(\n\t\t\t{\n\t\t\t\t...params,\n\t\t\t\tcanvas: 'edit',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t}\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}, [ history, params, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\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 hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\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\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\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\t{ isStyleBookOpened && ! isMobileViewport && canvas === 'view' && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,wBAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAC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G,MAAAA,CAAA,KAAY,MAAM6B,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAb,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIX,MAAM,KAAK,MAAM,iBAC7D,IAAAxB,WAAA,CAAAkB,GAAA,EAACtB,UAAA,CAAAuB,OAAS;MACTyD,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1BvD,OAAO,EAAGiC,aAAe;MACzBuB,QAAQ,EAAGvB,aAAe;MAC1BwB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_components","_i18n","_data","_htmlEntities","_router","_sidebarNavigationScreenNavigationMenus","_moreMenu","_interopRequireDefault","_singleNavigationMenu","_useNavigationMenuHandlers","_buildNavigationLabel","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","postType","exports","SidebarNavigationScreenNavigationMenu","backPath","params","postId","record","navigationMenu","isResolving","useEntityRecord","isSaving","isDeleting","useSelect","select","isSavingEntityRecord","isDeletingEntityRecord","coreStore","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","useNavigationMenuHandlers","_handleDelete","_handleSave","edits","_handleDuplicate","jsx","SidebarNavigationScreenWrapper","description","__","children","Spinner","className","content","raw","actions","default","menuId","id","decodeEntities","onDelete","onSave","onDuplicate","buildNavigationLabel","status"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecord, store as coreStore } from '@wordpress/core-data';\nimport { Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport SingleNavigationMenu from './single-navigation-menu';\nimport useNavigationMenuHandlers from './use-navigation-menu-handlers';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport const postType = `wp_navigation`;\n\nexport default function SidebarNavigationScreenNavigationMenu( { backPath } ) {\n\tconst {\n\t\tparams: { postId },\n\t} = useLocation();\n\n\tconst { record: navigationMenu, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst { isSaving, isDeleting } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isDeletingEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tisSaving: isSavingEntityRecord( 'postType', postType, postId ),\n\t\t\t\tisDeleting: isDeletingEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst isLoading = isResolving || isSaving || isDeleting;\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst _handleDelete = () => handleDelete( navigationMenu );\n\tconst _handleSave = ( edits ) => handleSave( navigationMenu, edits );\n\tconst _handleDuplicate = () => handleDuplicate( navigationMenu );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t>\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 && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tactions={\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuId={ navigationMenu?.id }\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ _handleDelete }\n\t\t\t\t\t\tonSave={ _handleSave }\n\t\t\t\t\t\tonDuplicate={ _handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tbackPath={ backPath }\n\t\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\t\tnavigationMenu?.title,\n\t\t\t\t\tnavigationMenu?.id,\n\t\t\t\t\tnavigationMenu?.status\n\t\t\t\t) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SingleNavigationMenu\n\t\t\tnavigationMenu={ navigationMenu }\n\t\t\tbackPath={ backPath }\n\t\t\thandleDelete={ _handleDelete }\n\t\t\thandleSave={ _handleSave }\n\t\t\thandleDuplicate={ _handleDuplicate }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,uCAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,0BAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,qBAAA,GAAAH,sBAAA,CAAAR,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAA2C,IAAAa,WAAA,GAAAb,OAAA;AAlB3C;AACA;AACA;;AAQA;AACA;AACA;;AAQA,MAAM;EAAEc;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE5C,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,
|
|
1
|
+
{"version":3,"names":["_coreData","require","_components","_i18n","_data","_htmlEntities","_router","_sidebarNavigationScreenNavigationMenus","_moreMenu","_interopRequireDefault","_singleNavigationMenu","_useNavigationMenuHandlers","_buildNavigationLabel","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","postType","exports","SidebarNavigationScreenNavigationMenu","backPath","params","postId","record","navigationMenu","isResolving","useEntityRecord","isSaving","isDeleting","useSelect","select","isSavingEntityRecord","isDeletingEntityRecord","coreStore","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","useNavigationMenuHandlers","_handleDelete","_handleSave","edits","_handleDuplicate","jsx","SidebarNavigationScreenWrapper","description","__","children","Spinner","className","content","raw","actions","default","menuId","id","decodeEntities","onDelete","onSave","onDuplicate","buildNavigationLabel","status"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecord, store as coreStore } from '@wordpress/core-data';\nimport { Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport SingleNavigationMenu from './single-navigation-menu';\nimport useNavigationMenuHandlers from './use-navigation-menu-handlers';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport const postType = `wp_navigation`;\n\nexport default function SidebarNavigationScreenNavigationMenu( { backPath } ) {\n\tconst {\n\t\tparams: { postId },\n\t} = useLocation();\n\n\tconst { record: navigationMenu, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst { isSaving, isDeleting } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isDeletingEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tisSaving: isSavingEntityRecord( 'postType', postType, postId ),\n\t\t\t\tisDeleting: isDeletingEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst isLoading = isResolving || isSaving || isDeleting;\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst _handleDelete = () => handleDelete( navigationMenu );\n\tconst _handleSave = ( edits ) => handleSave( navigationMenu, edits );\n\tconst _handleDuplicate = () => handleDuplicate( navigationMenu );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t>\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 && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tactions={\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuId={ navigationMenu?.id }\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ _handleDelete }\n\t\t\t\t\t\tonSave={ _handleSave }\n\t\t\t\t\t\tonDuplicate={ _handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tbackPath={ backPath }\n\t\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\t\tnavigationMenu?.title,\n\t\t\t\t\tnavigationMenu?.id,\n\t\t\t\t\tnavigationMenu?.status\n\t\t\t\t) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SingleNavigationMenu\n\t\t\tnavigationMenu={ navigationMenu }\n\t\t\tbackPath={ backPath }\n\t\t\thandleDelete={ _handleDelete }\n\t\t\thandleSave={ _handleSave }\n\t\t\thandleDuplicate={ _handleDuplicate }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,uCAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAD,sBAAA,C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rBZ,cAAc,EAAEmC,EAAE,EAClBnC,cAAc,EAAEyC,MACjB,CAAG;MACHhB,WAAW,EAAG,IAAAC,QAAE,EAAE,gCAAiC;IAAG,CACtD,CAAC;EAEJ;EAEA,oBACC,IAAArC,WAAA,CAAAkC,GAAA,EAACtC,qBAAA,CAAAgD,OAAoB;IACpBjC,cAAc,EAAGA,cAAgB;IACjCJ,QAAQ,EAAGA,QAAU;IACrBoB,YAAY,EAAGG,aAAe;IAC9BJ,UAAU,EAAGK,WAAa;IAC1BH,eAAe,EAAGK;EAAkB,CACpC,CAAC;AAEJ","ignoreList":[]}
|
package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js
CHANGED
|
@@ -47,7 +47,7 @@ function useDeleteNavigationMenu() {
|
|
|
47
47
|
postType: 'wp_navigation'
|
|
48
48
|
});
|
|
49
49
|
} catch (error) {
|
|
50
|
-
createErrorNotice((0, _i18n.sprintf)(
|
|
50
|
+
createErrorNotice((0, _i18n.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */
|
|
51
51
|
(0, _i18n.__)(`Unable to delete Navigation Menu (%s).`), error?.message), {
|
|
52
52
|
type: 'snackbar'
|
|
53
53
|
});
|
|
@@ -97,7 +97,7 @@ function useSaveNavigationMenu() {
|
|
|
97
97
|
} catch (error) {
|
|
98
98
|
// Revert to original in case of error.
|
|
99
99
|
editEntityRecord('postType', _.postType, postId, originalRecord);
|
|
100
|
-
createErrorNotice((0, _i18n.sprintf)(
|
|
100
|
+
createErrorNotice((0, _i18n.sprintf)(/* translators: %s: error message describing why the navigation menu could not be renamed. */
|
|
101
101
|
(0, _i18n.__)(`Unable to rename Navigation Menu (%s).`), error?.message), {
|
|
102
102
|
type: 'snackbar'
|
|
103
103
|
});
|
|
@@ -118,8 +118,8 @@ function useDuplicateNavigationMenu() {
|
|
|
118
118
|
const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;
|
|
119
119
|
try {
|
|
120
120
|
const savedRecord = await saveEntityRecord('postType', _.postType, {
|
|
121
|
-
title: (0, _i18n.sprintf)(
|
|
122
|
-
(0, _i18n.
|
|
121
|
+
title: (0, _i18n.sprintf)(/* translators: %s: Navigation menu title */
|
|
122
|
+
(0, _i18n._x)('%s (Copy)', 'navigation menu'), menuTitle),
|
|
123
123
|
content: navigationMenu?.content?.raw,
|
|
124
124
|
status: 'publish'
|
|
125
125
|
}, {
|
|
@@ -135,7 +135,7 @@ function useDuplicateNavigationMenu() {
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
} catch (error) {
|
|
138
|
-
createErrorNotice((0, _i18n.sprintf)(
|
|
138
|
+
createErrorNotice((0, _i18n.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */
|
|
139
139
|
(0, _i18n.__)(`Unable to duplicate Navigation Menu (%s).`), error?.message), {
|
|
140
140
|
type: 'snackbar'
|
|
141
141
|
});
|
|
@@ -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","push","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","content","raw","status","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 { __, 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.push( { postType: 'wp_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\
|
|
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","push","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","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.push( { postType: 'wp_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.push( { postType, postId: 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,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AI;IAExD,IAAI;MACH,MAAMC,WAAW,GAAG,MAAMN,gBAAgB,CACzC,UAAU,EACVzB,UAAQ,EACR;QACC4B,KAAK,EAAE,IAAArB,aAAO,EACb;QACA,IAAAyB,QAAE,EAAE,WAAW,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,CAACU,IAAI,CAAE;UAAEL,QAAQ,EAARA,UAAQ;UAAEF,MAAM,EAAEiC,WAAW,CAAChC;QAAG,CAAE,CAAC;MACrD;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,SAASU,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNxC,YAAY,EAAER,uBAAuB,CAAC,CAAC;IACvC6B,UAAU,EAAER,qBAAqB,CAAC,CAAC;IACnCiB,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
|
package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js
CHANGED
|
@@ -13,14 +13,14 @@ var _htmlEntities = require("@wordpress/html-entities");
|
|
|
13
13
|
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
14
14
|
function buildNavigationLabel(title, id, status) {
|
|
15
15
|
if (!title?.rendered) {
|
|
16
|
-
/* translators: %s
|
|
16
|
+
/* translators: %s: the index of the menu in the list of menus. */
|
|
17
17
|
return (0, _i18n.sprintf)((0, _i18n.__)('(no title %s)'), id);
|
|
18
18
|
}
|
|
19
19
|
if (status === 'publish') {
|
|
20
20
|
return (0, _htmlEntities.decodeEntities)(title?.rendered);
|
|
21
21
|
}
|
|
22
22
|
return (0, _i18n.sprintf)(
|
|
23
|
-
// translators:
|
|
24
|
-
(0, _i18n.
|
|
23
|
+
// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
|
|
24
|
+
(0, _i18n._x)('%1$s (%2$s)', 'menu label'), (0, _htmlEntities.decodeEntities)(title?.rendered), status);
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=build-navigation-label.js.map
|
package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_htmlEntities","buildNavigationLabel","title","id","status","rendered","sprintf","__","decodeEntities"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\n\t\t/* translators: %s
|
|
1
|
+
{"version":3,"names":["_i18n","require","_htmlEntities","buildNavigationLabel","title","id","status","rendered","sprintf","__","decodeEntities","_x"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\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?.rendered );\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?.rendered ),\n\t\tstatus\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACe,SAASE,oBAAoBA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EACjE,IAAK,CAAEF,KAAK,EAAEG,QAAQ,EAAG;IACxB;IACA,OAAO,IAAAC,aAAO,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC,EAAEJ,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAO,IAAAI,4BAAc,EAAEN,KAAK,EAAEG,QAAS,CAAC;EACzC;EAEA,OAAO,IAAAC,aAAO;EACb;EACA,IAAAG,QAAE,EAAE,aAAa,EAAE,YAAa,CAAC,EACjC,IAAAD,4BAAc,EAAEN,KAAK,EAAEG,QAAS,CAAC,EACjCD,MACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -32,19 +32,16 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
32
32
|
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
33
33
|
function buildMenuLabel(title, id, status) {
|
|
34
34
|
if (!title) {
|
|
35
|
-
/* translators: %s
|
|
35
|
+
/* translators: %s: the index of the menu in the list of menus. */
|
|
36
36
|
return (0, _i18n.sprintf)((0, _i18n.__)('(no title %s)'), id);
|
|
37
37
|
}
|
|
38
38
|
if (status === 'publish') {
|
|
39
39
|
return (0, _htmlEntities.decodeEntities)(title);
|
|
40
40
|
}
|
|
41
41
|
return (0, _i18n.sprintf)(
|
|
42
|
-
// translators:
|
|
43
|
-
(0, _i18n.
|
|
42
|
+
// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
|
|
43
|
+
(0, _i18n._x)('%1$s (%2$s)', 'menu label'), (0, _htmlEntities.decodeEntities)(title), status);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
// Save a boolean to prevent us creating a fallback more than once per session.
|
|
47
|
-
let hasCreatedFallback = false;
|
|
48
45
|
function SidebarNavigationScreenNavigationMenus({
|
|
49
46
|
backPath
|
|
50
47
|
}) {
|
|
@@ -57,16 +54,14 @@ function SidebarNavigationScreenNavigationMenus({
|
|
|
57
54
|
const {
|
|
58
55
|
getNavigationFallbackId
|
|
59
56
|
} = (0, _lockUnlock.unlock)((0, _data.useSelect)(_coreData.store));
|
|
57
|
+
const isCreatingNavigationFallback = (0, _data.useSelect)(select => select(_coreData.store).isResolving('getNavigationFallbackId'), []);
|
|
60
58
|
const firstNavigationMenu = navigationMenus?.[0];
|
|
61
59
|
|
|
62
|
-
// Save a boolean to prevent us creating a fallback more than once per session.
|
|
63
|
-
if (firstNavigationMenu) {
|
|
64
|
-
hasCreatedFallback = true;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
60
|
// If there is no navigation menu found
|
|
68
61
|
// then trigger fallback algorithm to create one.
|
|
69
|
-
if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus &&
|
|
62
|
+
if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus &&
|
|
63
|
+
// Ensure a fallback navigation is created only once
|
|
64
|
+
!isCreatingNavigationFallback) {
|
|
70
65
|
getNavigationFallbackId();
|
|
71
66
|
}
|
|
72
67
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","_link","_singleNavigationMenu","_useNavigationMenuHandlers","_lockUnlock","_constants2","_jsxRuntime","buildMenuLabel","title","id","status","sprintf","__","decodeEntities","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","_link","_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","linkInfo","useLink","postType"],"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 { useLink } from '../routes/link';\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\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\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,KAAA,GAAAV,OAAA;AACA,IAAAW,qBAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,0BAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA6D,IAAAe,WAAA,GAAAf,OAAA;AAxB7D;AACA;AACA;;AAYA;AACA;AACA;;AAUA;AACA,SAASgB,cAAcA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EAC5C,IAAK,CAAEF,KAAK,EAAG;IACd;IACA,OAAO,IAAAG,aAAO,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC,EAAEH,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAO,IAAAG,4BAAc,EAAEL,KAAM,CAAC;EAC/B;EAEA,OAAO,IAAAG,aAAO;EACb;EACA,IAAAG,QAAE,EAAE,aAAa,EAAE,YAAa,CAAC,EACjC,IAAAD,4BAAc,EAAEL,KAAM,CAAC,EACvBE,MACD,CAAC;AACF;AAEe,SAASK,sCAAsCA,CAAE;EAAEC;AAAS,CAAC,EAA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8C,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,MAAMC,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBT,MAAM;IACNU,QAAQ,EAAE;EACX,CAAE,CAAC;EACH,oBAAO,IAAAzD,WAAA,CAAAkC,GAAA,EAACzC,sBAAA,CAAA+C,OAAqB;IAAA,GAAMe,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
|
|
@@ -42,12 +42,12 @@ function LeafMoreMenu(props) {
|
|
|
42
42
|
moveBlocksUp,
|
|
43
43
|
removeBlocks
|
|
44
44
|
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
45
|
-
const removeLabel = (0, _i18n.sprintf)(
|
|
45
|
+
const removeLabel = (0, _i18n.sprintf)(/* translators: %s: block name */
|
|
46
46
|
(0, _i18n.__)('Remove %s'), (0, _blockEditor.BlockTitle)({
|
|
47
47
|
clientId,
|
|
48
48
|
maximumLength: 25
|
|
49
49
|
}));
|
|
50
|
-
const goToLabel = (0, _i18n.sprintf)(
|
|
50
|
+
const goToLabel = (0, _i18n.sprintf)(/* translators: %s: block name */
|
|
51
51
|
(0, _i18n.__)('Go to %s'), (0, _blockEditor.BlockTitle)({
|
|
52
52
|
clientId,
|
|
53
53
|
maximumLength: 25
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_components","_data","_element","_i18n","_blockEditor","_router","_lockUnlock","_jsxRuntime","POPOVER_PROPS","className","placement","useHistory","unlock","routerPrivateApis","LeafMoreMenu","props","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","useDispatch","blockEditorStore","removeLabel","sprintf","__","BlockTitle","maximumLength","goToLabel","rootClientId","useSelect","select","getBlockRootClientId","onGoToPage","useCallback","selectedBlock","attributes","name","kind","id","type","params","getLocationWithParams","push","postType","postId","canvas","backPath","jsx","DropdownMenu","icon","moreVertical","label","popoverProps","noIcons","children","onClose","jsxs","Fragment","MenuGroup","MenuItem","chevronUp","onClick","chevronDown"],"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 } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\n\tconst history = useHistory();\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\tconst { params } = history.getLocationWithParams();\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: attributes.type,\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\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\tconst { params } = history.getLocationWithParams();\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: 'page',\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ 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\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAUA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AApB3C;AACA;AACA;;AAUA,MAAMS,aAAa,GAAG;EACrBC,SAAS,EAAE,2CAA2C;EACtDC,SAAS,EAAE;AACZ,CAAC;;AAED;AACA;AACA;;AAGA,MAAM;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnC,SAASC,YAAYA,CAAEC,KAAK,EAAG;EAC7C,MAAMC,OAAO,GAAGL,UAAU,CAAC,CAAC;EAC5B,MAAM;IAAEM;EAAM,CAAC,GAAGF,KAAK;EACvB,MAAM;IAAEG;EAAS,CAAC,GAAGD,KAAK;EAC1B,MAAM;IAAEE,cAAc;IAAEC,YAAY;IAAEC;EAAa,CAAC,GACnD,IAAAC,iBAAW,EAAEC,kBAAiB,CAAC;EAEhC,MAAMC,WAAW,GAAG,IAAAC,aAAO,
|
|
1
|
+
{"version":3,"names":["_icons","require","_components","_data","_element","_i18n","_blockEditor","_router","_lockUnlock","_jsxRuntime","POPOVER_PROPS","className","placement","useHistory","unlock","routerPrivateApis","LeafMoreMenu","props","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","useDispatch","blockEditorStore","removeLabel","sprintf","__","BlockTitle","maximumLength","goToLabel","rootClientId","useSelect","select","getBlockRootClientId","onGoToPage","useCallback","selectedBlock","attributes","name","kind","id","type","params","getLocationWithParams","push","postType","postId","canvas","backPath","jsx","DropdownMenu","icon","moreVertical","label","popoverProps","noIcons","children","onClose","jsxs","Fragment","MenuGroup","MenuItem","chevronUp","onClick","chevronDown"],"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 } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\n\tconst history = useHistory();\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\tconst { params } = history.getLocationWithParams();\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: attributes.type,\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\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\tconst { params } = history.getLocationWithParams();\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: 'page',\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ 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\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AjC,WAAA,CAAA0C,GAAA,EAACjD,WAAA,CAAA6D,QAAQ;UACRE,OAAO,EAAGA,CAAA,KAAM;YACf7B,UAAU,CAAEjB,KAAM,CAAC;YACnBwC,OAAO,CAAC,CAAC;UACV,CAAG;UAAAD,QAAA,EAED3B;QAAS,CACF,CACV;MAAA,CACQ,CAAC,eACZ,IAAAtB,WAAA,CAAA0C,GAAA,EAACjD,WAAA,CAAA4D,SAAS;QAAAJ,QAAA,eACT,IAAAjD,WAAA,CAAA0C,GAAA,EAACjD,WAAA,CAAA6D,QAAQ;UACRE,OAAO,EAAGA,CAAA,KAAM;YACf1C,YAAY,CAAE,CAAEH,QAAQ,CAAE,EAAE,KAAM,CAAC;YACnCuC,OAAO,CAAC,CAAC;UACV,CAAG;UAAAD,QAAA,EAEDhC;QAAW,CACJ;MAAC,CACD,CAAC;IAAA,CACX;EACF,CACY,CAAC;AAEjB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_editor","_i18n","_coreData","_data","_icons","_router","_sidebarNavigationScreen","_interopRequireDefault","_categoryItem","_constants","_usePatternCategories","_useTemplatePartAreas","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","CategoriesGroup","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","jsxs","__experimentalItemGroup","className","children","jsx","default","count","Object","values","map","templateParts","length","reduce","acc","val","icon","getTemplatePartIcon","label","__","id","TEMPLATE_PART_ALL_AREAS_CATEGORY","type","TEMPLATE_PART_POST_TYPE","isActive","entries","area","file","name","PATTERN_TYPES","user","category","SidebarNavigationScreenPatterns","backPath","params","postType","categoryId","PATTERN_DEFAULT_CATEGORY","hasTemplateParts","isLoading","useTemplatePartAreas","hasPatterns","usePatternCategories","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","isRoot","title","description","content","Fragment","__experimentalItem"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartAreas,\n\tpatternCategories,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\tconst [ allPatterns, ...otherPatterns ] = patternCategories;\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t<CategoryItem\n\t\t\t\tkey=\"all\"\n\t\t\t\tcount={ Object.values( templatePartAreas )\n\t\t\t\t\t.map( ( { templateParts } ) => templateParts?.length || 0 )\n\t\t\t\t\t.reduce( ( acc, val ) => acc + val, 0 ) }\n\t\t\t\ticon={ getTemplatePartIcon() } /* no name, so it provides the fallback icon */\n\t\t\t\tlabel={ __( 'All template parts' ) }\n\t\t\t\tid={ TEMPLATE_PART_ALL_AREAS_CATEGORY }\n\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\tisActive={\n\t\t\t\t\tcurrentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY &&\n\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ Object.entries( templatePartAreas ).map(\n\t\t\t\t( [ area, { label, templateParts } ] ) => (\n\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\tkey={ area }\n\t\t\t\t\t\tcount={ templateParts?.length }\n\t\t\t\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tid={ area }\n\t\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\tcurrentCategory === area &&\n\t\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\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\t<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ allPatterns && (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ allPatterns.name }\n\t\t\t\t\tcount={ allPatterns.count }\n\t\t\t\t\tlabel={ allPatterns.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ allPatterns.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ allPatterns.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ otherPatterns.map( ( category ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\tcount={ category.count }\n\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ category.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ category.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tparams: { postType, categoryId },\n\t} = useLocation();\n\tconst currentType = postType || PATTERN_TYPES.user;\n\tconst currentCategory =\n\t\tcategoryId ||\n\t\t( currentType === PATTERN_TYPES.user\n\t\t\t? PATTERN_DEFAULT_CATEGORY\n\t\t\t: TEMPLATE_PART_ALL_AREAS_CATEGORY );\n\n\tconst { templatePartAreas, hasTemplateParts, isLoading } =\n\t\tuseTemplatePartAreas();\n\tconst { patternCategories, hasPatterns } = usePatternCategories();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ ! isBlockBasedTheme }\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\ttemplatePartAreas={ templatePartAreas }\n\t\t\t\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\t\t\t\tcurrentCategory={ currentCategory }\n\t\t\t\t\t\t\t\tcurrentType={ currentType }\n\t\t\t\t\t\t\t/>\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":";;;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QAAE,EACf,2DACD,CAAG;IACHc,QAAQ,EAAGA,QAAU;IACrBmB,OAAO,eACN,IAAA9D,WAAA,CAAAW,IAAA,EAAAX,WAAA,CAAA+D,QAAA;MAAAjD,QAAA,GACGmC,SAAS,IAAI,IAAApB,QAAE,EAAE,gBAAiB,CAAC,EACnC,CAAEoB,SAAS,iBACZ,IAAAjD,WAAA,CAAAW,IAAA,EAAAX,WAAA,CAAA+D,QAAA;QAAAjD,QAAA,GACG,CAAEkC,gBAAgB,IAAI,CAAEG,WAAW,iBACpC,IAAAnD,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA2B,uBAAS;UAACC,SAAS,EAAC,qDAAqD;UAAAC,QAAA,eACzE,IAAAd,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA+E,kBAAI;YAAAlD,QAAA,EAAG,IAAAe,QAAE,EAAE,gBAAiB;UAAC,CAAQ;QAAC,CAC7B,CACX,eACD,IAAA7B,WAAA,CAAAe,GAAA,EAACX,eAAe;UACfC,iBAAiB,EAAGA,iBAAmB;UACvCC,iBAAiB,EAAGA,iBAAmB;UACvCC,eAAe,EAAGA,eAAiB;UACnCC,WAAW,EAAGA;QAAa,CAC3B,CAAC;MAAA,CACD,CACF;IAAA,CACA;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_editor","_i18n","_coreData","_data","_icons","_router","_sidebarNavigationScreen","_interopRequireDefault","_categoryItem","_constants","_usePatternCategories","_useTemplatePartAreas","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","CategoriesGroup","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","jsxs","__experimentalItemGroup","className","children","jsx","default","count","Object","values","map","templateParts","length","reduce","acc","val","icon","getTemplatePartIcon","label","__","id","TEMPLATE_PART_ALL_AREAS_CATEGORY","type","TEMPLATE_PART_POST_TYPE","isActive","entries","area","file","name","PATTERN_TYPES","user","category","SidebarNavigationScreenPatterns","backPath","params","postType","categoryId","PATTERN_DEFAULT_CATEGORY","hasTemplateParts","isLoading","useTemplatePartAreas","hasPatterns","usePatternCategories","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","isRoot","title","description","content","Fragment","__experimentalItem"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartAreas,\n\tpatternCategories,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\tconst [ allPatterns, ...otherPatterns ] = patternCategories;\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t<CategoryItem\n\t\t\t\tkey=\"all\"\n\t\t\t\tcount={ Object.values( templatePartAreas )\n\t\t\t\t\t.map( ( { templateParts } ) => templateParts?.length || 0 )\n\t\t\t\t\t.reduce( ( acc, val ) => acc + val, 0 ) }\n\t\t\t\ticon={ getTemplatePartIcon() } /* no name, so it provides the fallback icon */\n\t\t\t\tlabel={ __( 'All template parts' ) }\n\t\t\t\tid={ TEMPLATE_PART_ALL_AREAS_CATEGORY }\n\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\tisActive={\n\t\t\t\t\tcurrentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY &&\n\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ Object.entries( templatePartAreas ).map(\n\t\t\t\t( [ area, { label, templateParts } ] ) => (\n\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\tkey={ area }\n\t\t\t\t\t\tcount={ templateParts?.length }\n\t\t\t\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tid={ area }\n\t\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\tcurrentCategory === area &&\n\t\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\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\t<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ allPatterns && (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ allPatterns.name }\n\t\t\t\t\tcount={ allPatterns.count }\n\t\t\t\t\tlabel={ allPatterns.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ allPatterns.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ allPatterns.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ otherPatterns.map( ( category ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\tcount={ category.count }\n\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ category.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ category.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tparams: { postType, categoryId },\n\t} = useLocation();\n\tconst currentType = postType || PATTERN_TYPES.user;\n\tconst currentCategory =\n\t\tcategoryId ||\n\t\t( currentType === PATTERN_TYPES.user\n\t\t\t? PATTERN_DEFAULT_CATEGORY\n\t\t\t: TEMPLATE_PART_ALL_AREAS_CATEGORY );\n\n\tconst { templatePartAreas, hasTemplateParts, isLoading } =\n\t\tuseTemplatePartAreas();\n\tconst { patternCategories, hasPatterns } = usePatternCategories();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ ! isBlockBasedTheme }\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\ttemplatePartAreas={ templatePartAreas }\n\t\t\t\t\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AAEC,cAAc,EACnE,EACD,CAAC;EAED,oBACC,IAAA1D,WAAA,CAAAe,GAAA,EAACtB,wBAAA,CAAAuB,OAAuB;IACvB2C,MAAM,EAAG,CAAEN,iBAAmB;IAC9BO,KAAK,EAAG,IAAA/B,QAAE,EAAE,UAAW,CAAG;IAC1BgC,WAAW,EAAG,IAAAhC,QAAE,EACf,2DACD,CAAG;IACHc,QAAQ,EAAGA,QAAU;IACrBmB,OAAO,eACN,IAAA9D,WAAA,CAAAW,IAAA,EAAAX,WAAA,CAAA+D,QAAA;MAAAjD,QAAA,GACGmC,SAAS,IAAI,IAAApB,QAAE,EAAE,gBAAiB,CAAC,EACnC,CAAEoB,SAAS,iBACZ,IAAAjD,WAAA,CAAAW,IAAA,EAAAX,WAAA,CAAA+D,QAAA;QAAAjD,QAAA,GACG,CAAEkC,gBAAgB,IAAI,CAAEG,WAAW,iBACpC,IAAAnD,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA2B,uBAAS;UAACC,SAAS,EAAC,qDAAqD;UAAAC,QAAA,eACzE,IAAAd,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA+E,kBAAI;YAAAlD,QAAA,EAAG,IAAAe,QAAE,EAAE,gBAAiB;UAAC,CAAQ;QAAC,CAC7B,CACX,eACD,IAAA7B,WAAA,CAAAe,GAAA,EAACX,eAAe;UACfC,iBAAiB,EAAGA,iBAAmB;UACvCC,iBAAiB,EAAGA,iBAAmB;UACvCC,eAAe,EAAGA,eAAiB;UACnCC,WAAW,EAAGA;QAAa,CAC3B,CAAC;MAAA,CACD,CACF;IAAA,CACA;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.homeEditRoute = void 0;
|
|
8
|
+
var _editor = _interopRequireDefault(require("../editor"));
|
|
9
|
+
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const homeEditRoute = exports.homeEditRoute = {
|
|
16
|
+
name: 'home-edit',
|
|
17
|
+
match: params => {
|
|
18
|
+
return params.canvas === 'edit';
|
|
19
|
+
},
|
|
20
|
+
areas: {
|
|
21
|
+
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {}),
|
|
22
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
23
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=home-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenMain","_jsxRuntime","homeEditRoute","exports","name","match","params","canvas","areas","sidebar","jsx","default","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/home-edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\n\nexport const homeEditRoute = {\n\tname: 'home-edit',\n\tmatch: ( params ) => {\n\t\treturn params.canvas === 'edit';\n\t},\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenMain />,\n\t\tpreview: <Editor />,\n\t\tmobile: <Editor />,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA4E,IAAAE,WAAA,GAAAF,OAAA;AAJ5E;AACA;AACA;;AAIO,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC5BE,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OAAOA,MAAM,CAACC,MAAM,KAAK,MAAM;EAChC,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAR,WAAA,CAAAS,GAAA,EAACV,4BAAA,CAAAW,OAA2B,IAAE,CAAC;IACxCC,OAAO,eAAE,IAAAX,WAAA,CAAAS,GAAA,EAACb,OAAA,CAAAc,OAAM,IAAE,CAAC;IACnBE,MAAM,eAAE,IAAAZ,WAAA,CAAAS,GAAA,EAACb,OAAA,CAAAc,OAAM,IAAE;EAClB;AACD,CAAC","ignoreList":[]}
|