@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","useDefaultViews","unlock","DataViewItem","CustomDataViewsList","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","DataViewsSidebarContent","params","postType","activeView","isCustom","defaultViews","isCustomBoolean","children","map","dataview","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { postType, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t{ window?.__experimentalCustomViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\tisCustom\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,mBAAmB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","useDefaultViews","unlock","DataViewItem","CustomDataViewsList","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","DataViewsSidebarContent","params","postType","activeView","isCustom","defaultViews","isCustomBoolean","children","map","dataview","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { postType, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t{ window?.__experimentalCustomViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\tisCustom\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,mBAAmB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1D,MAAM;EAAEC;AAAY,CAAC,GAAGT,MAAM,CAAEF,iBAAkB,CAAC;AAEnD,eAAe,SAASY,uBAAuBA,CAAA,EAAG;EACjD,MAAM;IACLC,MAAM,EAAE;MAAEC,QAAQ;MAAEC,UAAU,GAAG,KAAK;MAAEC,QAAQ,GAAG;IAAQ;EAC5D,CAAC,GAAGL,WAAW,CAAC,CAAC;EACjB,MAAMM,YAAY,GAAGhB,eAAe,CAAE;IAAEa;EAAS,CAAE,CAAC;EACpD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EACA,MAAMI,eAAe,GAAGF,QAAQ,KAAK,MAAM;EAE3C,oBACCN,KAAA,CAAAF,SAAA;IAAAW,QAAA,gBACCb,IAAA,CAACR,SAAS;MAAAqB,QAAA,EACPF,YAAY,CAACG,GAAG,CAAIC,QAAQ,IAAM;QACnC,oBACCf,IAAA,CAACH,YAAY;UAEZmB,IAAI,EAAGD,QAAQ,CAACC,IAAM;UACtBC,KAAK,EAAGF,QAAQ,CAACE,KAAO;UACxBC,IAAI,EAAGH,QAAQ,CAACG,IAAM;UACtBC,IAAI,EAAGJ,QAAQ,CAACK,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAET,eAAe,IACjBG,QAAQ,CAACC,IAAI,KAAKP,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZK,QAAQ,CAACC,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClCvB,IAAA,CAACF,mBAAmB;MACnBW,UAAU,EAAGA,UAAY;MACzBU,IAAI,EAAGX,QAAU;MACjBE,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -17,8 +17,7 @@ import { useContext } from '@wordpress/element';
|
|
|
17
17
|
*/
|
|
18
18
|
import { unlock } from '../../lock-unlock';
|
|
19
19
|
import { SidebarNavigationContext } from '../sidebar';
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
21
|
const {
|
|
23
22
|
useHistory
|
|
24
23
|
} = unlock(routerPrivateApis);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","isRTL","chevronRightSmall","chevronLeftSmall","Icon","privateApis","routerPrivateApis","useContext","unlock","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","useHistory","SidebarNavigationItem","className","icon","withChevron","suffix","uid","params","onClick","children","props","history","navigate","handleClick","e","preventDefault","push","id","justify","style","fill","size"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tparams,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( params ) {\n\t\t\te.preventDefault();\n\t\t\thistory.push( params );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ handleClick }\n\t\t\tid={ uid }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! withChevron && suffix }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,SAAS,QACH,uBAAuB;AAC9B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,iBAAiB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,kBAAkB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","isRTL","chevronRightSmall","chevronLeftSmall","Icon","privateApis","routerPrivateApis","useContext","unlock","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","useHistory","SidebarNavigationItem","className","icon","withChevron","suffix","uid","params","onClick","children","props","history","navigate","handleClick","e","preventDefault","push","id","justify","style","fill","size"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tparams,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( params ) {\n\t\t\te.preventDefault();\n\t\t\thistory.push( params );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ handleClick }\n\t\t\tid={ uid }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tcl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,CAACK,IAAI,CAAET,MAAO,CAAC;MACtBK,QAAQ,CAAE,SAAS,EAAE,QAASN,GAAG,IAAM,CAAC;IACzC;EACD;EAEA,oBACCT,IAAA,CAACd,IAAI;IACJmB,SAAS,EAAGrB,IAAI,CACf,mCAAmC,EACnC;MAAE,aAAa,EAAE,CAAEuB,WAAW,IAAIC;IAAO,CAAC,EAC1CH,SACD,CAAG;IACHM,OAAO,EAAGK,WAAa;IACvBI,EAAE,EAAGX,GAAK;IAAA,GACLI,KAAK;IAAAD,QAAA,eAEVV,KAAA,CAACd,MAAM;MAACiC,OAAO,EAAC,YAAY;MAAAT,QAAA,GACzBN,IAAI,iBACLN,IAAA,CAACP,IAAI;QACJ6B,KAAK,EAAG;UAAEC,IAAI,EAAE;QAAe,CAAG;QAClCjB,IAAI,EAAGA,IAAM;QACbkB,IAAI,EAAG;MAAI,CACX,CACD,eACDxB,IAAA,CAACX,SAAS;QAAAuB,QAAA,EAAGA;MAAQ,CAAa,CAAC,EACjCL,WAAW,iBACZP,IAAA,CAACP,IAAI;QACJa,IAAI,EAAGhB,KAAK,CAAC,CAAC,GAAGE,gBAAgB,GAAGD,iBAAmB;QACvDc,SAAS,EAAC,wDAAwD;QAClEmB,IAAI,EAAG;MAAI,CACX,CACD,EACC,CAAEjB,WAAW,IAAIC,MAAM;IAAA,CAClB;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
|
|
@@ -22,9 +22,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
22
22
|
import SidebarButton from '../sidebar-button';
|
|
23
23
|
import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
24
24
|
import { SidebarNavigationContext } from '../sidebar';
|
|
25
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
26
|
const {
|
|
29
27
|
useHistory,
|
|
30
28
|
useLocation
|
|
@@ -91,7 +89,8 @@ export default function SidebarNavigationScreen({
|
|
|
91
89
|
color: '#e0e0e0' /* $gray-200 */,
|
|
92
90
|
level: 1,
|
|
93
91
|
size: 20,
|
|
94
|
-
children: !isPreviewingTheme() ? title : sprintf(
|
|
92
|
+
children: !isPreviewingTheme() ? title : sprintf(/* translators: 1: theme name. 2: title */
|
|
93
|
+
__('Previewing %1$s: %2$s'), previewingThemeName, title)
|
|
95
94
|
}), actions && /*#__PURE__*/_jsx("div", {
|
|
96
95
|
className: "edit-site-sidebar-navigation-screen__actions",
|
|
97
96
|
children: actions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","useContext","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","select","getSettings","currentlyPreviewingThemeId","__experimentalDashboardLink","__experimentalDashboardLinkText","getTheme","name","rendered","undefined","location","history","navigate","state","icon","children","className","spacing","justify","alignment","onClick","push","label","showTooltip","href","color","level","size"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,YAAY,EAAEC,WAAW,QAAQ,kBAAkB;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SACCC,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AACxC,SAASC,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","useContext","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","select","getSettings","currentlyPreviewingThemeId","__experimentalDashboardLink","__experimentalDashboardLinkText","getTheme","name","rendered","undefined","location","history","navigate","state","icon","children","className","spacing","justify","alignment","onClick","push","label","showTooltip","href","color","level","size"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: theme name. 2: title */\n\t\t\t\t\t\t\t\t\t__( 'Previewing %1$s: %2$s' ),\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\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+13,7 @@ import { backup } from '@wordpress/icons';
|
|
|
13
13
|
*/
|
|
14
14
|
import { SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue } from '../sidebar-navigation-screen-details-panel';
|
|
15
15
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
17
|
export default function SidebarNavigationScreenDetailsFooter({
|
|
19
18
|
record,
|
|
20
19
|
...otherProps
|
|
@@ -47,7 +46,7 @@ export default function SidebarNavigationScreenDetailsFooter({
|
|
|
47
46
|
children: [/*#__PURE__*/_jsx(SidebarNavigationScreenDetailsPanelLabel, {
|
|
48
47
|
children: __('Last modified')
|
|
49
48
|
}), /*#__PURE__*/_jsx(SidebarNavigationScreenDetailsPanelValue, {
|
|
50
|
-
children: createInterpolateElement(sprintf(
|
|
49
|
+
children: createInterpolateElement(sprintf(/* translators: %s: is the relative time when the post was last modified. */
|
|
51
50
|
__('<time>%s</time>'), humanTimeDiff(record.modified)), {
|
|
52
51
|
time: /*#__PURE__*/_jsx("time", {
|
|
53
52
|
dateTime: record.modified
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","humanTimeDiff","createInterpolateElement","addQueryArgs","Icon","__experimentalItemGroup","ItemGroup","backup","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","SidebarNavigationItem","jsx","_jsx","jsxs","_jsxs","SidebarNavigationScreenDetailsFooter","record","otherProps","_record$_links$predec","_record$_links$versio","hrefProps","lastRevisionId","_links","id","revisionsCount","count","href","revision","as","className","children","justify","modified","time","dateTime","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\nimport {\n\tIcon,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\trecord,\n\t...otherProps\n} ) {\n\t/*\n\t * There might be other items in the future,\n\t * but for now it's just modified date.\n\t * Later we might render a list of items and isolate\n\t * the following logic.\n\t */\n\tconst hrefProps = {};\n\tconst lastRevisionId =\n\t\trecord?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\tconst revisionsCount =\n\t\trecord?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t// Enable the revisions link if there is a last revision and there are more than one revisions.\n\tif ( lastRevisionId && revisionsCount > 1 ) {\n\t\threfProps.href = addQueryArgs( 'revision.php', {\n\t\t\trevision: record?._links[ 'predecessor-version' ][ 0 ].id,\n\t\t} );\n\t\threfProps.as = 'a';\n\t}\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-details-footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\taria-label={ __( 'Revisions' ) }\n\t\t\t\t{ ...hrefProps }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow justify=\"space-between\">\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was last modified. */\n\t\t\t\t\t\t\t\t__( '<time>%s</time>' ),\n\t\t\t\t\t\t\t\thumanTimeDiff( record.modified )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: <time dateTime={ record.modified } />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-details-footer__icon\"\n\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SACCC,IAAI,EACJC,uBAAuB,IAAIC,SAAS,QAC9B,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,kBAAkB;;AAEzC;AACA;AACA;AACA,SACCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,OAAOC,qBAAqB,MAAM,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","sprintf","humanTimeDiff","createInterpolateElement","addQueryArgs","Icon","__experimentalItemGroup","ItemGroup","backup","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","SidebarNavigationItem","jsx","_jsx","jsxs","_jsxs","SidebarNavigationScreenDetailsFooter","record","otherProps","_record$_links$predec","_record$_links$versio","hrefProps","lastRevisionId","_links","id","revisionsCount","count","href","revision","as","className","children","justify","modified","time","dateTime","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\nimport {\n\tIcon,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\trecord,\n\t...otherProps\n} ) {\n\t/*\n\t * There might be other items in the future,\n\t * but for now it's just modified date.\n\t * Later we might render a list of items and isolate\n\t * the following logic.\n\t */\n\tconst hrefProps = {};\n\tconst lastRevisionId =\n\t\trecord?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\tconst revisionsCount =\n\t\trecord?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t// Enable the revisions link if there is a last revision and there are more than one revisions.\n\tif ( lastRevisionId && revisionsCount > 1 ) {\n\t\threfProps.href = addQueryArgs( 'revision.php', {\n\t\t\trevision: record?._links[ 'predecessor-version' ][ 0 ].id,\n\t\t} );\n\t\threfProps.as = 'a';\n\t}\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-details-footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\taria-label={ __( 'Revisions' ) }\n\t\t\t\t{ ...hrefProps }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow justify=\"space-between\">\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was last modified. */\n\t\t\t\t\t\t\t\t__( '<time>%s</time>' ),\n\t\t\t\t\t\t\t\thumanTimeDiff( record.modified )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: <time dateTime={ record.modified } />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-details-footer__icon\"\n\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SACCC,IAAI,EACJC,uBAAuB,IAAIC,SAAS,QAC9B,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,kBAAkB;;AAEzC;AACA;AACA;AACA,SACCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,OAAOC,qBAAqB,MAAM,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/D,eAAe,SAASC,oCAAoCA,CAAE;EAC7DC,MAAM;EACN,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B,IAAA;cAAMsB,QAAQ,EAAGlB,MAAM,CAACgB;YAAU,CAAE;UAC3C,CACD;QAAC,CACwC,CAAC,eAC3CpB,IAAA,CAACT,IAAI;UACJ0B,SAAS,EAAC,0DAA0D;UACpEM,IAAI,EAAG7B;QAAQ,CACf,CAAC;MAAA,CACqC;IAAC,CACnB;EAAC,CACd,CAAC;AAEd","ignoreList":[]}
|
|
@@ -9,8 +9,7 @@ import { __experimentalVStack as VStack, __experimentalHeading as Heading } from
|
|
|
9
9
|
import SidebarNavigationScreenDetailsPanelLabel from './sidebar-navigation-screen-details-panel-label';
|
|
10
10
|
import SidebarNavigationScreenDetailsPanelRow from './sidebar-navigation-screen-details-panel-row';
|
|
11
11
|
import SidebarNavigationScreenDetailsPanelValue from './sidebar-navigation-screen-details-panel-value';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
function SidebarNavigationScreenDetailsPanel({
|
|
15
14
|
title,
|
|
16
15
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalVStack","VStack","__experimentalHeading","Heading","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelValue","jsx","_jsx","jsxs","_jsxs","SidebarNavigationScreenDetailsPanel","title","children","spacing","className","level"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenDetailsPanelLabel from './sidebar-navigation-screen-details-panel-label';\nimport SidebarNavigationScreenDetailsPanelRow from './sidebar-navigation-screen-details-panel-row';\nimport SidebarNavigationScreenDetailsPanelValue from './sidebar-navigation-screen-details-panel-value';\n\nfunction SidebarNavigationScreenDetailsPanel( { title, children, spacing } ) {\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-sidebar-navigation-details-screen-panel\"\n\t\t\tspacing={ spacing }\n\t\t>\n\t\t\t{ title && (\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-details-screen-panel__heading\"\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t) }\n\t\t\t{ children }\n\t\t</VStack>\n\t);\n}\n\nexport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,QAC1B,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,wCAAwC,MAAM,iDAAiD;AACtG,OAAOC,sCAAsC,MAAM,+CAA+C;AAClG,OAAOC,wCAAwC,MAAM,iDAAiD;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__experimentalVStack","VStack","__experimentalHeading","Heading","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelValue","jsx","_jsx","jsxs","_jsxs","SidebarNavigationScreenDetailsPanel","title","children","spacing","className","level"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenDetailsPanelLabel from './sidebar-navigation-screen-details-panel-label';\nimport SidebarNavigationScreenDetailsPanelRow from './sidebar-navigation-screen-details-panel-row';\nimport SidebarNavigationScreenDetailsPanelValue from './sidebar-navigation-screen-details-panel-value';\n\nfunction SidebarNavigationScreenDetailsPanel( { title, children, spacing } ) {\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-sidebar-navigation-details-screen-panel\"\n\t\t\tspacing={ spacing }\n\t\t>\n\t\t\t{ title && (\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-details-screen-panel__heading\"\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t) }\n\t\t\t{ children }\n\t\t</VStack>\n\t);\n}\n\nexport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,QAC1B,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,wCAAwC,MAAM,iDAAiD;AACtG,OAAOC,sCAAsC,MAAM,+CAA+C;AAClG,OAAOC,wCAAwC,MAAM,iDAAiD;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvG,SAASC,mCAAmCA,CAAE;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EAC5E,oBACCJ,KAAA,CAACT,MAAM;IACNc,SAAS,EAAC,mDAAmD;IAC7DD,OAAO,EAAGA,OAAS;IAAAD,QAAA,GAEjBD,KAAK,iBACNJ,IAAA,CAACL,OAAO;MACPY,SAAS,EAAC,4DAA4D;MACtEC,KAAK,EAAG,CAAG;MAAAH,QAAA,EAETD;IAAK,CACC,CACT,EACCC,QAAQ;EAAA,CACH,CAAC;AAEX;AAEA,SACCF,mCAAmC,EACnCN,sCAAsC,EACtCD,wCAAwC,EACxCE,wCAAwC","ignoreList":[]}
|
|
@@ -14,8 +14,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
14
14
|
import { store as editSiteStore } from '../../store';
|
|
15
15
|
import ColorVariations from '../global-styles/variations/variations-color';
|
|
16
16
|
import TypographyVariations from '../global-styles/variations/variations-typography';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
const noop = () => {};
|
|
20
19
|
export default function SidebarNavigationScreenGlobalStylesContent() {
|
|
21
20
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useSelect","__experimentalVStack","VStack","BlockEditorProvider","StyleVariationsContainer","unlock","store","editSiteStore","ColorVariations","TypographyVariations","jsx","_jsx","jsxs","_jsxs","noop","SidebarNavigationScreenGlobalStylesContent","storedSettings","select","getSettings","gap","settings","onChange","onInput","children","spacing","className","title"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\n\nconst noop = () => {};\n\nexport default function SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst gap = 3;\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<VStack\n\t\t\t\tspacing={ 10 }\n\t\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t\t>\n\t\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t\t<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />\n\t\t\t\t<TypographyVariations\n\t\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\t\tgap={ gap }\n\t\t\t\t/>\n\t\t\t</VStack>\n\t\t</BlockEditorProvider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,mBAAmB,QAAQ,yBAAyB;;AAE7D;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,6CAA6C;AAClF,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,OAAOC,eAAe,MAAM,8CAA8C;AAC1E,OAAOC,oBAAoB,MAAM,mDAAmD;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","useSelect","__experimentalVStack","VStack","BlockEditorProvider","StyleVariationsContainer","unlock","store","editSiteStore","ColorVariations","TypographyVariations","jsx","_jsx","jsxs","_jsxs","noop","SidebarNavigationScreenGlobalStylesContent","storedSettings","select","getSettings","gap","settings","onChange","onInput","children","spacing","className","title"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\n\nconst noop = () => {};\n\nexport default function SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst gap = 3;\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<VStack\n\t\t\t\tspacing={ 10 }\n\t\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t\t>\n\t\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t\t<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />\n\t\t\t\t<TypographyVariations\n\t\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\t\tgap={ gap }\n\t\t\t\t/>\n\t\t\t</VStack>\n\t\t</BlockEditorProvider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,mBAAmB,Q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 -9,6 +9,7 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
9
9
|
import { useCallback } from '@wordpress/element';
|
|
10
10
|
import { store as editorStore } from '@wordpress/editor';
|
|
11
11
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
12
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
@@ -22,16 +23,19 @@ import StyleBook from '../style-book';
|
|
|
22
23
|
import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';
|
|
23
24
|
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
|
24
25
|
import SidebarNavigationScreenGlobalStylesContent from './content';
|
|
25
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
|
+
const {
|
|
28
|
+
useLocation,
|
|
29
|
+
useHistory
|
|
30
|
+
} = unlock(routerPrivateApis);
|
|
28
31
|
export function SidebarNavigationItemGlobalStyles(props) {
|
|
29
32
|
const {
|
|
30
33
|
openGeneralSidebar
|
|
31
34
|
} = useDispatch(editSiteStore);
|
|
35
|
+
const history = useHistory();
|
|
32
36
|
const {
|
|
33
|
-
|
|
34
|
-
} =
|
|
37
|
+
params
|
|
38
|
+
} = useLocation();
|
|
35
39
|
const hasGlobalStyleVariations = useSelect(select => !!select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
|
|
36
40
|
if (hasGlobalStyleVariations) {
|
|
37
41
|
return /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
@@ -46,7 +50,12 @@ export function SidebarNavigationItemGlobalStyles(props) {
|
|
|
46
50
|
...props,
|
|
47
51
|
onClick: () => {
|
|
48
52
|
// Switch to edit mode.
|
|
49
|
-
|
|
53
|
+
history.push({
|
|
54
|
+
...params,
|
|
55
|
+
canvas: 'edit'
|
|
56
|
+
}, undefined, {
|
|
57
|
+
transition: 'canvas-mode-edit-transition'
|
|
58
|
+
});
|
|
50
59
|
// Open global styles sidebar.
|
|
51
60
|
openGeneralSidebar('edit-site/global-styles');
|
|
52
61
|
}
|
|
@@ -55,6 +64,13 @@ export function SidebarNavigationItemGlobalStyles(props) {
|
|
|
55
64
|
export default function SidebarNavigationScreenGlobalStyles({
|
|
56
65
|
backPath
|
|
57
66
|
}) {
|
|
67
|
+
const history = useHistory();
|
|
68
|
+
const {
|
|
69
|
+
params
|
|
70
|
+
} = useLocation();
|
|
71
|
+
const {
|
|
72
|
+
canvas = 'view'
|
|
73
|
+
} = params;
|
|
58
74
|
const {
|
|
59
75
|
revisions,
|
|
60
76
|
isLoading: isLoadingRevisions
|
|
@@ -67,17 +83,14 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
67
83
|
} = useDispatch(editorStore);
|
|
68
84
|
const isMobileViewport = useViewportMatch('medium', '<');
|
|
69
85
|
const {
|
|
70
|
-
setCanvasMode,
|
|
71
86
|
setEditorCanvasContainerView
|
|
72
87
|
} = unlock(useDispatch(editSiteStore));
|
|
73
88
|
const {
|
|
74
|
-
isViewMode,
|
|
75
89
|
isStyleBookOpened,
|
|
76
90
|
revisionsCount
|
|
77
91
|
} = useSelect(select => {
|
|
78
92
|
var _globalStyles$_links$;
|
|
79
93
|
const {
|
|
80
|
-
getCanvasMode,
|
|
81
94
|
getEditorCanvasContainerView
|
|
82
95
|
} = unlock(select(editSiteStore));
|
|
83
96
|
const {
|
|
@@ -87,7 +100,6 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
87
100
|
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
88
101
|
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
89
102
|
return {
|
|
90
|
-
isViewMode: 'view' === getCanvasMode(),
|
|
91
103
|
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
|
92
104
|
revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
|
|
93
105
|
};
|
|
@@ -96,8 +108,14 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
96
108
|
set: setPreference
|
|
97
109
|
} = useDispatch(preferencesStore);
|
|
98
110
|
const openGlobalStyles = useCallback(async () => {
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
history.push({
|
|
112
|
+
...params,
|
|
113
|
+
canvas: 'edit'
|
|
114
|
+
}, undefined, {
|
|
115
|
+
transition: 'canvas-mode-edit-transition'
|
|
116
|
+
});
|
|
117
|
+
return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
|
|
118
|
+
}, [history, params, openGeneralSidebar, setPreference]);
|
|
101
119
|
const openStyleBook = useCallback(async () => {
|
|
102
120
|
await openGlobalStyles();
|
|
103
121
|
// Open the Style Book once the canvas mode is set to edit,
|
|
@@ -141,7 +159,7 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
141
159
|
onClick: async () => await openGlobalStyles()
|
|
142
160
|
})]
|
|
143
161
|
})
|
|
144
|
-
}), isStyleBookOpened && !isMobileViewport &&
|
|
162
|
+
}), isStyleBookOpened && !isMobileViewport && canvas === 'view' && /*#__PURE__*/_jsx(StyleBook, {
|
|
145
163
|
enableResizing: false,
|
|
146
164
|
isSelected: () => false,
|
|
147
165
|
onClick: openStyleBook,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","useViewportMatch","useCallback","editorStore","preferencesStore","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenGlobalStylesContent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","params","path","uid","onClick","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","children","title","description","content","footer","record","actions","icon","label","isPressed","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,S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version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","useViewportMatch","useCallback","editorStore","preferencesStore","privateApis","routerPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenGlobalStylesContent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","history","params","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","path","uid","onClick","push","canvas","undefined","transition","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","children","title","description","content","footer","record","actions","icon","label","isPressed","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;AACxD,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAAST,KAAK,IAAIU,aAAa,QAAQ,aAAa;AACpD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,wBAAwB,MAAM,+DAA+D;AACpG,OAAOC,oCAAoC,MAAM,6CAA6C;AAC9F,OAAOC,0CAA0C,MA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EACLL,4BAA4B,iBAC3BnD,IAAA,CAACH,oCAAoC;QACpC4D,MAAM,EAAGhC,SAAS,GAAI,CAAC,CAAI;QAC3BP,OAAO,EAAG6B;MAAe,CACzB,CAEF;MACDW,OAAO,eACNtD,KAAA,CAAAF,SAAA;QAAAkD,QAAA,GACG,CAAEvB,gBAAgB,iBACnB7B,IAAA,CAACP,aAAa;UACbkE,IAAI,EAAGhF,IAAM;UACbiF,KAAK,EAAGnF,EAAE,CAAE,YAAa,CAAG;UAC5ByC,OAAO,EAAGA,CAAA,KACTY,4BAA4B,CAC3B,CAAEC,iBAAiB,GAChB,YAAY,GACZV,SACJ,CACA;UACDwC,SAAS,EAAG9B;QAAmB,CAC/B,CACD,eACD/B,IAAA,CAACP,aAAa;UACbkE,IAAI,EAAGjF,IAAM;UACbkF,KAAK,EAAGnF,EAAE,CAAE,aAAc,CAAG;UAC7ByC,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAMyB,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAZ,iBAAiB,IAAI,CAAEF,gBAAgB,IAAIT,MAAM,KAAK,MAAM,iBAC7DpB,IAAA,CAACL,SAAS;MACTmE,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1B7C,OAAO,EAAG4B,aAAe;MACzBkB,QAAQ,EAAGlB,aAAe;MAC1BmB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -16,9 +16,7 @@ import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-
|
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
17
|
import { store as editSiteStore } from '../../store';
|
|
18
18
|
import { NAVIGATION_POST_TYPE, TEMPLATE_POST_TYPE, PATTERN_TYPES } from '../../utils/constants';
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
20
|
export default function SidebarNavigationScreenMain() {
|
|
23
21
|
const {
|
|
24
22
|
setEditorCanvasContainerView
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SidebarNavigationScreenMain","setEditorCanvasContainerView","undefined","isRoot","title","description","content","children","uid","params","postType","withChevron","icon","user"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Pages' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAEC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAC3E,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SACCC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,QACP,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SidebarNavigationScreenMain","setEditorCanvasContainerView","undefined","isRoot","title","description","content","children","uid","params","postType","withChevron","icon","user"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Pages' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAEC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAC3E,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,4BAA4B;AA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UACXC,IAAI,EAAG9B,IAAM;UAAAyB,QAAA,EAEX9B,EAAE,CAAE,OAAQ;QAAC,CACO,CAAC,eACxBkB,IAAA,CAACT,qBAAqB;UACrBsB,GAAG,EAAC,0BAA0B;UAC9BC,MAAM,EAAG;YAAEC,QAAQ,EAAElB;UAAmB,CAAG;UAC3CmB,WAAW;UACXC,IAAI,EAAGlC,MAAQ;UAAA6B,QAAA,EAEb9B,EAAE,CAAE,WAAY;QAAC,CACG,CAAC,eACxBkB,IAAA,CAACT,qBAAqB;UACrBsB,GAAG,EAAC,0BAA0B;UAC9BC,MAAM,EAAG;YAAEC,QAAQ,EAAEjB,aAAa,CAACoB;UAAK,CAAG;UAC3CF,WAAW;UACXC,IAAI,EAAGjC,MAAQ;UAAA4B,QAAA,EAEb9B,EAAE,CAAE,UAAW;QAAC,CACI,CAAC;MAAA,CACd;IAAC,CACX;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEntityRecord","store","coreStore","Spinner","__","useSelect","decodeEntities","privateApis","routerPrivateApis","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","SingleNavigationMenu","useNavigationMenuHandlers","buildNavigationLabel","unlock","jsx","_jsx","useLocation","postType","SidebarNavigationScreenNavigationMenu","backPath","params","postId","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","_handleDelete","_handleSave","edits","_handleDuplicate","description","children","className","content","raw","actions","menuId","id","onDelete","onSave","onDuplicate","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":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC1E,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,+CAA+C;AAC9F,OAAOC,wBAAwB,MAAM,aAAa;AAClD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,yBAAyB,MAAM,gCAAgC;AACtE,OAAOC,oBAAoB,MAAM,sEAAsE;AACvG,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEN,iBAAkB,CAAC;AAEnD,OAAO,MAAMU,QAAQ,
|
|
1
|
+
{"version":3,"names":["useEntityRecord","store","coreStore","Spinner","__","useSelect","decodeEntities","privateApis","routerPrivateApis","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","SingleNavigationMenu","useNavigationMenuHandlers","buildNavigationLabel","unlock","jsx","_jsx","useLocation","postType","SidebarNavigationScreenNavigationMenu","backPath","params","postId","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","_handleDelete","_handleSave","edits","_handleDuplicate","description","children","className","content","raw","actions","menuId","id","onDelete","onSave","onDuplicate","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":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC1E,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,+CAA+C;AAC9F,OAAOC,wBAAwB,MAAM,aAAa;AAClD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAO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J","ignoreList":[]}
|
|
@@ -13,9 +13,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
13
13
|
import RenameModal from './rename-modal';
|
|
14
14
|
import DeleteConfirmDialog from './delete-confirm-dialog';
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
17
|
const {
|
|
20
18
|
useHistory
|
|
21
19
|
} = unlock(routerPrivateApis);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DropdownMenu","MenuItem","MenuGroup","moreVertical","__","useState","privateApis","routerPrivateApis","RenameModal","DeleteConfirmDialog","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","children","className","label","icon","popoverProps","onClose","onClick","push","postId","postType","canvas","isDestructive","onConfirm"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteConfirmDialog from './delete-confirm-dialog';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle, menuId } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =\n\t\tuseState( false );\n\n\tconst history = useHistory();\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteConfirmDialogOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\tpostId: menuId,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_navigation',\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteConfirmDialog();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t{ deleteConfirmDialogOpen && (\n\t\t\t\t<DeleteConfirmDialog\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,uBAAuB;AACzE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["DropdownMenu","MenuItem","MenuGroup","moreVertical","__","useState","privateApis","routerPrivateApis","RenameModal","DeleteConfirmDialog","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","children","className","label","icon","popoverProps","onClose","onClick","push","postId","postType","canvas","isDestructive","onConfirm"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteConfirmDialog from './delete-confirm-dialog';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle, menuId } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =\n\t\tuseState( false );\n\n\tconst history = useHistory();\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteConfirmDialogOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\tpostId: menuId,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_navigation',\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteConfirmDialog();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t{ deleteConfirmDialogOpen && (\n\t\t\t\t<DeleteConfirmDialog\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,uBAAuB;AACzE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE3C,MAAM;EAAEC;AAAW,CAAC,GAAGP,MAAM,CAAEH,iBAAkB,CAAC;AAElD,MAAMW,aAAa,GAAG;EACrBC,QAAQ,EAAE;AACX,CAAC;AAED,eAAe,SAASC,wBAAwBA,CAAEC,KAAK,EAAG;EACzD,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC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AAC,CACL,CAAC,eACXQ,IAAA,CAACX,QAAQ;YACRwC,OAAO,EAAGA,CAAA,KAAM;cACfjB,WAAW,CAAC,CAAC;cACbgB,OAAO,CAAC,CAAC;YACV,CAAG;YAAAL,QAAA,EAED/B,EAAE,CAAE,WAAY;UAAC,CACV,CAAC,eACXQ,IAAA,CAACX,QAAQ;YACR6C,aAAa;YACbL,OAAO,EAAGA,CAAA,KAAM;cACfP,uBAAuB,CAAC,CAAC;;cAEzB;cACAM,OAAO,CAAC,CAAC;YACV,CAAG;YAAAL,QAAA,EAED/B,EAAE,CAAE,QAAS;UAAC,CACP,CAAC;QAAA,CACD;MAAC,CACR;IACL,CACY,CAAC,EACbyB,uBAAuB,iBACxBjB,IAAA,CAACH,mBAAmB;MACnB+B,OAAO,EAAGR,WAAa;MACvBe,SAAS,EAAGzB;IAAU,CACtB,CACD,EACCK,eAAe,iBAChBf,IAAA,CAACJ,WAAW;MACXgC,OAAO,EAAGR,WAAa;MACvBP,SAAS,EAAGA,SAAW;MACvBF,MAAM,EAAGA;IAAQ,CACjB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
import { __experimentalHStack as HStack, __experimentalVStack as VStack, Button, TextControl, Modal } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { useState } from '@wordpress/element';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
const notEmptyString = testString => testString?.trim()?.length > 0;
|
|
10
9
|
export default function RenameModal({
|
|
11
10
|
menuTitle,
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","jsx","_jsx","jsxs","_jsxs","notEmptyString","testString","trim","length","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","titleHasChanged","isEditedMenuTitleValid","title","onRequestClose","focusOnMount","size","children","className","spacing","__nextHasNoMarginBottom","__next40pxDefaultSize","value","placeholder","onChange","label","justify","variant","onClick","accessibleWhenDisabled","disabled","type","e","preventDefault"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\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{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,WAAW,EACXC,KAAK,QACC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","jsx","_jsx","jsxs","_jsxs","notEmptyString","testString","trim","length","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","titleHasChanged","isEditedMenuTitleValid","title","onRequestClose","focusOnMount","size","children","className","spacing","__nextHasNoMarginBottom","__next40pxDefaultSize","value","placeholder","onChange","label","justify","variant","onClick","accessibleWhenDisabled","disabled","type","e","preventDefault"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\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{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,WAAW,EACXC,KAAK,QACC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAMC,cAAc,GAAKC,UAAU,IAAMA,UAAU,EAAEC,IAAI,CAAC,CAAC,EAAEC,MAAM,GAAG,CAAC;AAEvE,eAAe,SAASC,WAAWA,CAAE;EAAEC,SAAS;EAAEC,OAAO;EAAEC;AAAO,CAAC,EAAG;EACrE,MAAM,CAAEC,eAAe,EAAEC,kBAAkB,CAAE,GAAGd,QAAQ,CAAEU,SAAU,CAAC;EAErE,MAAMK,eAAe,GAAGF,eAAe,KAAKH,SAAS;EAErD,MAAMM,sBAAs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