@wordpress/edit-site 6.10.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 +2 -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/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 +2 -0
- 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 -10
- 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/font-sizes/font-size.js +6 -6
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -1
- 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/palette.js +16 -13
- package/build/components/global-styles/palette.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 +0 -4
- 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/revisions-buttons.js +2 -2
- 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 +5 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +9 -10
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +0 -3
- package/build/components/global-styles/shadows-panel.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/ui.js +7 -0
- package/build/components/global-styles/ui.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 -30
- 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 +22 -35
- 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/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 +1 -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 +6 -52
- 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/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-dataviews/default-views.js +2 -5
- package/build/components/sidebar-dataviews/default-views.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-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/use-navigation-menu-handlers.js +1 -1
- 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/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/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 +10 -6
- 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/store/private-actions.js +8 -60
- 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-module/components/add-new-post/index.js +1 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +1 -1
- 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 +4 -2
- 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 +23 -10
- 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/global-styles/font-sizes/font-size.js +6 -6
- 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 +0 -1
- 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 +4 -4
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/palette.js +17 -14
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +0 -4
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +0 -4
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +0 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +5 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +9 -10
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +0 -3
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +2 -5
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/ui.js +7 -0
- package/build-module/components/global-styles/ui.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-panel.js +0 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +44 -31
- 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 +22 -35
- 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/page-patterns/delete-category-menu-item.js +4 -4
- package/build-module/components/page-patterns/delete-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/index.js +1 -2
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +1 -1
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +8 -4
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -51
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +1 -1
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +2 -2
- 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 -10
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/revisions/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 +17 -6
- package/build-module/components/save-panel/index.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-navigation-screen/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +30 -10
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- 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/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 +3 -2
- 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 +94 -38
- 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/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 +10 -6
- 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/store/private-actions.js +6 -58
- 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-style/posts-rtl.css +10 -13
- package/build-style/posts.css +10 -13
- package/build-style/style-rtl.css +127 -26
- package/build-style/style.css +127 -26
- package/package.json +43 -41
- 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 -13
- 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-sizes/font-size.js +11 -15
- 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 +0 -7
- package/src/components/global-styles/screen-css.js +1 -0
- 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 +4 -1
- package/src/components/global-styles/shadows-edit-panel.js +12 -13
- package/src/components/global-styles/shadows-panel.js +0 -4
- package/src/components/global-styles/typography-elements.js +3 -11
- package/src/components/global-styles/ui.js +11 -0
- 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 -65
- package/src/components/global-styles-sidebar/style.scss +6 -0
- package/src/components/layout/animation.js +0 -1
- package/src/components/layout/index.js +16 -34
- 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/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-dataviews/default-views.js +2 -5
- package/src/components/sidebar-navigation-screen/index.js +2 -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/store/private-actions.js +7 -79
- 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":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalItemGroup","ItemGroup","Button","Flex","FlexItem","__","sprintf","privateApis","blockEditorPrivateApis","plus","shadow","shadowIcon","unlock","Subtitle","NavigationButtonAsItem","ScreenHeader","getNewIndexFromPresets","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useGlobalSetting","defaultShadow","ShadowsPanel","defaultShadows","defaultShadowsEnabled","themeShadows","customShadows","setCustomShadows","onCreateShadow","children","title","description","className","spacing","ShadowList","label","shadows","category","length","canCreate","onCreate","handleAddShadow","newIndex","name","slug","justify","align","level","size","icon","onClick","isBordered","isSeparated","map","ShadowItem","path"],"sources":["@wordpress/edit-site/src/components/global-styles/shadows-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalItemGroup as ItemGroup,\n\tButton,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { plus, shadow as shadowIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport ScreenHeader from './header';\nimport { getNewIndexFromPresets } from './utils';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nexport const defaultShadow = '6px 6px 9px rgba(0, 0, 0, 0.2)';\n\nexport default function ShadowsPanel() {\n\tconst [ defaultShadows ] = useGlobalSetting( 'shadow.presets.default' );\n\tconst [ defaultShadowsEnabled ] = useGlobalSetting(\n\t\t'shadow.defaultPresets'\n\t);\n\tconst [ themeShadows ] = useGlobalSetting( 'shadow.presets.theme' );\n\tconst [ customShadows, setCustomShadows ] = useGlobalSetting(\n\t\t'shadow.presets.custom'\n\t);\n\n\tconst onCreateShadow = ( shadow ) => {\n\t\tsetCustomShadows( [ ...( customShadows || [] ), shadow ] );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Shadows' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage and create shadow styles for use across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<VStack\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadows-panel\"\n\t\t\t\t\tspacing={ 7 }\n\t\t\t\t>\n\t\t\t\t\t{ defaultShadowsEnabled && (\n\t\t\t\t\t\t<ShadowList\n\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\tshadows={ defaultShadows || [] }\n\t\t\t\t\t\t\tcategory=\"default\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ themeShadows && themeShadows.length > 0 && (\n\t\t\t\t\t\t<ShadowList\n\t\t\t\t\t\t\tlabel={ __( 'Theme' ) }\n\t\t\t\t\t\t\tshadows={ themeShadows || [] }\n\t\t\t\t\t\t\tcategory=\"theme\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ShadowList\n\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\tshadows={ customShadows || [] }\n\t\t\t\t\t\tcategory=\"custom\"\n\t\t\t\t\t\tcanCreate\n\t\t\t\t\t\tonCreate={ onCreateShadow }\n\t\t\t\t\t/>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nfunction ShadowList( { label, shadows, category, canCreate, onCreate } ) {\n\tconst handleAddShadow = () => {\n\t\tconst newIndex = getNewIndexFromPresets( shadows, 'shadow-' );\n\t\tonCreate( {\n\t\t\tname: sprintf(\n\t\t\t\t/* translators: %s: is an index for a preset */\n\t\t\t\t__( 'Shadow %s' ),\n\t\t\t\tnewIndex\n\t\t\t),\n\t\t\tshadow: defaultShadow,\n\t\t\tslug: `shadow-${ newIndex }`,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t<Flex\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadows-panel__title\"\n\t\t\t\t>\n\t\t\t\t\t<Subtitle level={ 3 }>{ label }</Subtitle>\n\t\t\t\t</Flex>\n\t\t\t\t{ canCreate && (\n\t\t\t\t\t<FlexItem className=\"edit-site-global-styles__shadows-panel__options-container\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={ __( 'Add shadow' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thandleAddShadow();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ shadows.length > 0 && (\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ shadows.map( ( shadow ) => (\n\t\t\t\t\t\t<ShadowItem\n\t\t\t\t\t\t\tkey={ shadow.slug }\n\t\t\t\t\t\t\tshadow={ shadow }\n\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</ItemGroup>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ShadowItem( { shadow, category } ) {\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ `/shadows/edit/${ category }/${ shadow.slug }` }\n\t\t\
|
|
1
|
+
{"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalItemGroup","ItemGroup","Button","Flex","FlexItem","__","sprintf","privateApis","blockEditorPrivateApis","plus","shadow","shadowIcon","unlock","Subtitle","NavigationButtonAsItem","ScreenHeader","getNewIndexFromPresets","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useGlobalSetting","defaultShadow","ShadowsPanel","defaultShadows","defaultShadowsEnabled","themeShadows","customShadows","setCustomShadows","onCreateShadow","children","title","description","className","spacing","ShadowList","label","shadows","category","length","canCreate","onCreate","handleAddShadow","newIndex","name","slug","justify","align","level","size","icon","onClick","isBordered","isSeparated","map","ShadowItem","path"],"sources":["@wordpress/edit-site/src/components/global-styles/shadows-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalItemGroup as ItemGroup,\n\tButton,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { plus, shadow as shadowIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport ScreenHeader from './header';\nimport { getNewIndexFromPresets } from './utils';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nexport const defaultShadow = '6px 6px 9px rgba(0, 0, 0, 0.2)';\n\nexport default function ShadowsPanel() {\n\tconst [ defaultShadows ] = useGlobalSetting( 'shadow.presets.default' );\n\tconst [ defaultShadowsEnabled ] = useGlobalSetting(\n\t\t'shadow.defaultPresets'\n\t);\n\tconst [ themeShadows ] = useGlobalSetting( 'shadow.presets.theme' );\n\tconst [ customShadows, setCustomShadows ] = useGlobalSetting(\n\t\t'shadow.presets.custom'\n\t);\n\n\tconst onCreateShadow = ( shadow ) => {\n\t\tsetCustomShadows( [ ...( customShadows || [] ), shadow ] );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Shadows' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage and create shadow styles for use across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<VStack\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadows-panel\"\n\t\t\t\t\tspacing={ 7 }\n\t\t\t\t>\n\t\t\t\t\t{ defaultShadowsEnabled && (\n\t\t\t\t\t\t<ShadowList\n\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\tshadows={ defaultShadows || [] }\n\t\t\t\t\t\t\tcategory=\"default\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ themeShadows && themeShadows.length > 0 && (\n\t\t\t\t\t\t<ShadowList\n\t\t\t\t\t\t\tlabel={ __( 'Theme' ) }\n\t\t\t\t\t\t\tshadows={ themeShadows || [] }\n\t\t\t\t\t\t\tcategory=\"theme\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ShadowList\n\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\tshadows={ customShadows || [] }\n\t\t\t\t\t\tcategory=\"custom\"\n\t\t\t\t\t\tcanCreate\n\t\t\t\t\t\tonCreate={ onCreateShadow }\n\t\t\t\t\t/>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nfunction ShadowList( { label, shadows, category, canCreate, onCreate } ) {\n\tconst handleAddShadow = () => {\n\t\tconst newIndex = getNewIndexFromPresets( shadows, 'shadow-' );\n\t\tonCreate( {\n\t\t\tname: sprintf(\n\t\t\t\t/* translators: %s: is an index for a preset */\n\t\t\t\t__( 'Shadow %s' ),\n\t\t\t\tnewIndex\n\t\t\t),\n\t\t\tshadow: defaultShadow,\n\t\t\tslug: `shadow-${ newIndex }`,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t<Flex\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tclassName=\"edit-site-global-styles__shadows-panel__title\"\n\t\t\t\t>\n\t\t\t\t\t<Subtitle level={ 3 }>{ label }</Subtitle>\n\t\t\t\t</Flex>\n\t\t\t\t{ canCreate && (\n\t\t\t\t\t<FlexItem className=\"edit-site-global-styles__shadows-panel__options-container\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={ __( 'Add shadow' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thandleAddShadow();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ shadows.length > 0 && (\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ shadows.map( ( shadow ) => (\n\t\t\t\t\t\t<ShadowItem\n\t\t\t\t\t\t\tkey={ shadow.slug }\n\t\t\t\t\t\t\tshadow={ shadow }\n\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</ItemGroup>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ShadowItem( { shadow, category } ) {\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ `/shadows/edit/${ category }/${ shadow.slug }` }\n\t\t\ticon={ shadowIcon }\n\t\t>\n\t\t\t{ shadow.name }\n\t\t</NavigationButtonAsItem>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,uBAAuB,IAAIC,SAAS,EACpCC,MAAM,EACNC,IAAI,EACJC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,IAAI,EAAEC,MAAM,IAAIC,UAAU,QAAQ,kBAAkB;;AAE7D;AACA;AACA;AACA,SAASC,MAAM,QA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;QAAK,CAAY;MAAC,CACrC,CAAC,EACLI,SAAS,iBACVxB,IAAA,CAACd,QAAQ;QAAC+B,SAAS,EAAC,2DAA2D;QAAAH,QAAA,eAC9Ed,IAAA,CAAChB,MAAM;UACNiD,IAAI,EAAC,OAAO;UACZC,IAAI,EAAG3C,IAAM;UACb6B,KAAK,EAAGjC,EAAE,CAAE,YAAa,CAAG;UAC5BgD,OAAO,EAAGA,CAAA,KAAM;YACfT,eAAe,CAAC,CAAC;UAClB;QAAG,CACH;MAAC,CACO,CACV;IAAA,CACM,CAAC,EACPL,OAAO,CAACE,MAAM,GAAG,CAAC,iBACnBvB,IAAA,CAACjB,SAAS;MAACqD,UAAU;MAACC,WAAW;MAAAvB,QAAA,EAC9BO,OAAO,CAACiB,GAAG,CAAI9C,MAAM,iBACtBQ,IAAA,CAACuC,UAAU;QAEV/C,MAAM,EAAGA,MAAQ;QACjB8B,QAAQ,EAAGA;MAAU,GAFf9B,MAAM,CAACqC,IAGb,CACA;IAAC,CACO,CACX;EAAA,CACM,CAAC;AAEX;AAEA,SAASU,UAAUA,CAAE;EAAE/C,MAAM;EAAE8B;AAAS,CAAC,EAAG;EAC3C,oBACCtB,IAAA,CAACJ,sBAAsB;IACtB4C,IAAI,EAAG,iBAAkBlB,QAAQ,IAAM9B,MAAM,CAACqC,IAAI,EAAK;IACvDK,IAAI,EAAGzC,UAAY;IAAAqB,QAAA,EAEjBtB,MAAM,CAACoC;EAAI,CACU,CAAC;AAE3B","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { __experimentalItemGroup as ItemGroup, __experimentalVStack as VStack, __experimentalHStack as HStack, FlexItem } from '@wordpress/components';
|
|
6
6
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
7
|
|
|
@@ -32,12 +32,8 @@ function ElementItem({
|
|
|
32
32
|
const [fallbackBackgroundColor] = useGlobalStyle('color.background');
|
|
33
33
|
const [gradientValue] = useGlobalStyle(prefix + 'color.gradient');
|
|
34
34
|
const [color] = useGlobalStyle(prefix + 'color.text');
|
|
35
|
-
const navigationButtonLabel = sprintf(
|
|
36
|
-
// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.
|
|
37
|
-
__('Typography %s styles'), label);
|
|
38
35
|
return /*#__PURE__*/_jsx(NavigationButtonAsItem, {
|
|
39
36
|
path: parentMenu + '/typography/' + element,
|
|
40
|
-
"aria-label": navigationButtonLabel,
|
|
41
37
|
children: /*#__PURE__*/_jsxs(HStack, {
|
|
42
38
|
justify: "flex-start",
|
|
43
39
|
children: [/*#__PURE__*/_jsx(FlexItem, {
|
|
@@ -50,6 +46,7 @@ function ElementItem({
|
|
|
50
46
|
fontWeight,
|
|
51
47
|
...extraStyles
|
|
52
48
|
},
|
|
49
|
+
"aria-hidden": "true",
|
|
53
50
|
children: __('Aa')
|
|
54
51
|
}), /*#__PURE__*/_jsx(FlexItem, {
|
|
55
52
|
children: label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","
|
|
1
|
+
{"version":3,"names":["__","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","privateApis","blockEditorPrivateApis","NavigationButtonAsItem","Subtitle","unlock","jsx","_jsx","jsxs","_jsxs","useGlobalStyle","ElementItem","parentMenu","element","label","_ref","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","backgroundColor","fallbackBackgroundColor","gradientValue","color","path","children","justify","className","style","background","TypographyElements","spacing","level","isBordered","isSeparated"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-elements.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\n\nimport { unlock } from '../../lock-unlock';\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ElementItem( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\treturn (\n\t\t<NavigationButtonAsItem path={ parentMenu + '/typography/' + element }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\tbackgroundColor ??\n\t\t\t\t\t\t\tfallbackBackgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction TypographyElements() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"text\"\n\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"link\"\n\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"heading\"\n\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"caption\"\n\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"button\"\n\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t/>\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nexport default TypographyElements;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,qBAAqB;AAC5D,OAAOC,QAAQ,MAAM,YAAY;AAEjC,SAASC,MAAM,QAAQ,mBAAmB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B,CAAC,eACFc,IAAA,CAACI,WAAW;QACXC,UAAU,EAAGA,UAAY;QACzBC,OAAO,EAAC,QAAQ;QAChBC,KAAK,EAAGrB,EAAE,CAAE,SAAU;MAAG,CACzB,CAAC;IAAA,CACQ,CAAC;EAAA,CACL,CAAC;AAEX;AAEA,eAAeuC,kBAAkB","ignoreList":[]}
|
|
@@ -32,6 +32,7 @@ import ScreenCSS from './screen-css';
|
|
|
32
32
|
import ScreenRevisions from './screen-revisions';
|
|
33
33
|
import { unlock } from '../../lock-unlock';
|
|
34
34
|
import { store as editSiteStore } from '../../store';
|
|
35
|
+
import { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';
|
|
35
36
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
36
37
|
const SLOT_FILL_NAME = 'GlobalStylesMenu';
|
|
37
38
|
const {
|
|
@@ -157,6 +158,12 @@ function GlobalStylesStyleBook() {
|
|
|
157
158
|
// '/blocks/core%2Fbuttons'.
|
|
158
159
|
path === `/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/blocks/${encodeURIComponent(blockName)}/`),
|
|
159
160
|
onSelect: blockName => {
|
|
161
|
+
if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
|
|
162
|
+
// Go to color palettes Global Styles.
|
|
163
|
+
navigator.goTo('/colors/palette');
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
160
167
|
// Now go to the selected block.
|
|
161
168
|
navigator.goTo('/blocks/' + encodeURIComponent(blockName));
|
|
162
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Navigator","useNavigator","createSlotFill","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","FontSize","FontSizes","ScreenColors","ScreenColorPalette","ScreenBackground","ScreenShadows","ScreenShadowsEdit","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_FILL_NAME","useGlobalStylesReset","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","canReset","onReset","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","loadCustomCSS","children","icon","label","toggleProps","size","onClose","onClick","disabled","GlobalStylesNavigationScreen","className","props","Screen","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","goTo","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","isBack","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tNavigator,\n\tuseNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport FontSize from './font-sizes/font-size';\nimport FontSizes from './font-sizes/font-sizes';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenBackground from './screen-background';\nimport { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\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\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\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{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\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\tonReset();\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\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<Navigator.Screen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tif ( ! isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/revisions' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\t// The stand-alone style book is open\n\t\t\t// and the revisions panel is open,\n\t\t\t// close the revisions panel.\n\t\t\t// Otherwise keep the style book open while\n\t\t\t// browsing global styles panel.\n\t\t\t//\n\t\t\t// Falling through as it matches the default scenario.\n\t\t\tcase 'style-book':\n\t\t\tdefault:\n\t\t\t\t// In general, if the revision screen is in view but the\n\t\t\t\t// `editorCanvasContainerView` is not a revision view, close it.\n\t\t\t\t// This also includes the scenario when the stand-alone style\n\t\t\t\t// book is open, in which case we want the user to close the\n\t\t\t\t// revisions screen and browse global styles.\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/', { isBack: true } );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Navigator\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes\">\n\t\t\t\t<FontSizes />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/:origin/:slug\">\n\t\t\t\t<FontSize />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows\">\n\t\t\t\t<ScreenShadows />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows/edit/:category/:slug\">\n\t\t\t\t<ScreenShadowsEdit />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/revisions\">\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/background\">\n\t\t\t\t<ScreenBackground />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</Navigator>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,YAAY,EACZC,SAAS,EACTC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACvE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,W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AACjC,IAAM;MACnBP,UAAU,EAAG,UAAU,GAAGiB,kBAAkB,CAAEuB,KAAK,CAACjC,IAAK;IAAG,GAFtD,gBAAgB,GAAGiC,KAAK,CAACjC,IAG/B,CACA,CAAC,EAED,YAAY,KAAKyB,yBAAyB,iBAC3CzE,IAAA,CAACsD,qBAAqB,IAAE,CACxB,eAEDtD,IAAA,CAACW,sBAAsB,IAAE,CAAC,eAC1BX,IAAA,CAAC8D,qBAAqB,IAAE,CAAC,eACzB9D,IAAA,CAACwE,qCAAqC,IAAE,CAAC;EAAA,CAC/B,CAAC;AAEd;AACA,SAAShE,oBAAoB;AAC7B,eAAeqE,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Navigator","useNavigator","createSlotFill","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","FontSize","FontSizes","ScreenColors","ScreenColorPalette","ScreenBackground","ScreenShadows","ScreenShadowsEdit","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_FILL_NAME","useGlobalStylesReset","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","canReset","onReset","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","loadCustomCSS","children","icon","label","toggleProps","size","onClose","onClick","disabled","GlobalStylesNavigationScreen","className","props","Screen","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","find","group","slug","goTo","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","isBack","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tNavigator,\n\tuseNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport FontSize from './font-sizes/font-size';\nimport FontSizes from './font-sizes/font-sizes';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenBackground from './screen-background';\nimport { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\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\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\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{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\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\tonReset();\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\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<Navigator.Screen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\tif (\n\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\tnavigator.goTo( '/colors/palette' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tif ( ! isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/revisions' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\t// The stand-alone style book is open\n\t\t\t// and the revisions panel is open,\n\t\t\t// close the revisions panel.\n\t\t\t// Otherwise keep the style book open while\n\t\t\t// browsing global styles panel.\n\t\t\t//\n\t\t\t// Falling through as it matches the default scenario.\n\t\t\tcase 'style-book':\n\t\t\tdefault:\n\t\t\t\t// In general, if the revision screen is in view but the\n\t\t\t\t// `editorCanvasContainerView` is not a revision view, close it.\n\t\t\t\t// This also includes the scenario when the stand-alone style\n\t\t\t\t// book is open, in which case we want the user to close the\n\t\t\t\t// revisions screen and browse global styles.\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/', { isBack: true } );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Navigator\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes\">\n\t\t\t\t<FontSizes />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/:origin/:slug\">\n\t\t\t\t<FontSize />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows\">\n\t\t\t\t<ScreenShadows />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows/edit/:category/:slug\">\n\t\t\t\t<ScreenShadowsEdit />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/revisions\">\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/background\">\n\t\t\t\t<ScreenBackground />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</Navigator>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,YAAY,EACZC,SAAS,EACTC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACvE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,IAAIC,sBAAsB,EACrCL,KAAK,IAAIM,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA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G,GAFtD,gBAAgB,GAAGoC,KAAK,CAACpC,IAG/B,CACA,CAAC,EAED,YAAY,KAAK4B,yBAAyB,iBAC3C5E,IAAA,CAACsD,qBAAqB,IAAE,CACxB,eAEDtD,IAAA,CAACW,sBAAsB,IAAE,CAAC,eAC1BX,IAAA,CAACiE,qBAAqB,IAAE,CAAC,eACzBjE,IAAA,CAAC2E,qCAAqC,IAAE,CAAC;EAAA,CAC/B,CAAC;AAEd;AACA,SAASnE,oBAAoB;AAC7B,eAAewE,cAAc","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { Tooltip } from '@wordpress/components';
|
|
10
10
|
import { useMemo, useContext, useState } from '@wordpress/element';
|
|
11
11
|
import { ENTER } from '@wordpress/keycodes';
|
|
12
|
-
import {
|
|
12
|
+
import { _x, sprintf } from '@wordpress/i18n';
|
|
13
13
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
14
14
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
15
15
|
|
|
@@ -61,8 +61,8 @@ export default function Variation({
|
|
|
61
61
|
const isActive = useMemo(() => areGlobalStyleConfigsEqual(user, variation), [user, variation]);
|
|
62
62
|
let label = variation?.title;
|
|
63
63
|
if (variation?.description) {
|
|
64
|
-
label = sprintf(/* translators:
|
|
65
|
-
|
|
64
|
+
label = sprintf(/* translators: 1: variation title. 2: variation description. */
|
|
65
|
+
_x('%1$s (%2$s)', 'variation label'), variation?.title, variation?.description);
|
|
66
66
|
}
|
|
67
67
|
const content = /*#__PURE__*/_jsx("div", {
|
|
68
68
|
className: clsx('edit-site-global-styles-variations_item', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","Tooltip","useMemo","useContext","useState","ENTER","
|
|
1
|
+
{"version":3,"names":["clsx","Tooltip","useMemo","useContext","useState","ENTER","_x","sprintf","privateApis","blockEditorPrivateApis","editorPrivateApis","filterObjectByProperties","unlock","jsx","_jsx","mergeBaseAndUserConfigs","GlobalStylesContext","areGlobalStyleConfigsEqual","Variation","variation","children","isPill","properties","showTooltip","isFocused","setIsFocused","base","user","setUserConfig","context","merged","selectVariation","selectOnEnter","event","keyCode","preventDefault","isActive","label","title","description","content","className","role","onClick","onKeyDown","tabIndex","onFocus","onBlur","Provider","value","text"],"sources":["@wordpress/edit-site/src/components/global-styles/variations/variation.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Tooltip } from '@wordpress/components';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { filterObjectByProperties } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport { unlock } from '../../../lock-unlock';\n\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function Variation( {\n\tvariation,\n\tchildren,\n\tisPill,\n\tproperties,\n\tshowTooltip,\n} ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\n\tconst context = useMemo( () => {\n\t\tlet merged = mergeBaseAndUserConfigs( base, variation );\n\t\tif ( properties ) {\n\t\t\tmerged = filterObjectByProperties( merged, properties );\n\t\t}\n\t\treturn {\n\t\t\tuser: variation,\n\t\t\tbase,\n\t\t\tmerged,\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base, properties ] );\n\n\tconst selectVariation = () => setUserConfig( variation );\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo(\n\t\t() => areGlobalStyleConfigsEqual( user, variation ),\n\t\t[ user, variation ]\n\t);\n\n\tlet label = variation?.title;\n\tif ( variation?.description ) {\n\t\tlabel = sprintf(\n\t\t\t/* translators: 1: variation title. 2: variation description. */\n\t\t\t_x( '%1$s (%2$s)', 'variation label' ),\n\t\t\tvariation?.title,\n\t\t\tvariation?.description\n\t\t);\n\t}\n\n\tconst content = (\n\t\t<div\n\t\t\tclassName={ clsx( 'edit-site-global-styles-variations_item', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\trole=\"button\"\n\t\t\tonClick={ selectVariation }\n\t\t\tonKeyDown={ selectOnEnter }\n\t\t\ttabIndex=\"0\"\n\t\t\taria-label={ label }\n\t\t\taria-current={ isActive }\n\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-global-styles-variations_item-preview',\n\t\t\t\t\t{ 'is-pill': isPill }\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children( isFocused ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ showTooltip ? (\n\t\t\t\t<Tooltip text={ variation?.title }>{ content }</Tooltip>\n\t\t\t) : (\n\t\t\t\tcontent\n\t\t\t) }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;AAClE,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBA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|
45
45
|
}
|
|
46
46
|
return /*#__PURE__*/_jsx(NavigationButtonAsItem, {
|
|
47
47
|
path: '/blocks/' + encodeURIComponent(name) + '/variations/' + encodeURIComponent(style.name),
|
|
48
|
-
"aria-label": style.label,
|
|
49
48
|
children: style.label
|
|
50
49
|
}, index);
|
|
51
50
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","privateApis","blockEditorPrivateApis","useSelect","__experimentalItemGroup","ItemGroup","NavigationButtonAsItem","unlock","jsx","_jsx","useGlobalStyle","getFilteredBlockStyles","blockStyles","variations","filter","style","source","includes","name","useBlockVariations","select","getBlockStyles","variationNames","Object","keys","VariationsPanel","coreBlockStyles","isBordered","isSeparated","children","map","index","isDefault","path","encodeURIComponent","label"],"sources":["@wordpress/edit-site/src/components/global-styles/variations/variations-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from '../navigation-button';\nimport { unlock } from '../../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\n// Only core block styles (source === block) or block styles with a matching\n// theme.json style variation will be configurable via Global Styles.\nfunction getFilteredBlockStyles( blockStyles, variations ) {\n\treturn blockStyles?.filter(\n\t\t( style ) =>\n\t\t\tstyle.source === 'block' || variations.includes( style.name )\n\t);\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst [ variations ] = useGlobalStyle( 'variations', name );\n\tconst variationNames = Object.keys( variations ?? {} );\n\n\treturn getFilteredBlockStyles( blockStyles, variationNames );\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t
|
|
1
|
+
{"version":3,"names":["store","blocksStore","privateApis","blockEditorPrivateApis","useSelect","__experimentalItemGroup","ItemGroup","NavigationButtonAsItem","unlock","jsx","_jsx","useGlobalStyle","getFilteredBlockStyles","blockStyles","variations","filter","style","source","includes","name","useBlockVariations","select","getBlockStyles","variationNames","Object","keys","VariationsPanel","coreBlockStyles","isBordered","isSeparated","children","map","index","isDefault","path","encodeURIComponent","label"],"sources":["@wordpress/edit-site/src/components/global-styles/variations/variations-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from '../navigation-button';\nimport { unlock } from '../../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\n// Only core block styles (source === block) or block styles with a matching\n// theme.json style variation will be configurable via Global Styles.\nfunction getFilteredBlockStyles( blockStyles, variations ) {\n\treturn blockStyles?.filter(\n\t\t( style ) =>\n\t\t\tstyle.source === 'block' || variations.includes( style.name )\n\t);\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst [ variations ] = useGlobalStyle( 'variations', name );\n\tconst variationNames = Object.keys( variations ?? {} );\n\n\treturn getFilteredBlockStyles( blockStyles, variationNames );\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,MAAM,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9C,MAAM;EAAEC;AAAe,CAAC,GAAGH,MAAM,CAAEL,sBAAuB,CAAC;;AAE3D;AACA;AACA,SAASS,sBAAsBA,CAAEC,WAAW,EAAEC,UAAU,EAAG;EAC1D,OAA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@
|
|
|
1
|
-
{"version":3,"names":["privateApis","editorPrivateApis","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ComplementaryArea","ComplementaryAreaMoreMenuItem","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","isActiveByDefault","scope"
|
|
1
|
+
{"version":3,"names":["privateApis","editorPrivateApis","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ComplementaryArea","ComplementaryAreaMoreMenuItem","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","isActiveByDefault","scope"],"sources":["@wordpress/edit-site/src/components/global-styles-sidebar/default-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { ComplementaryArea, ComplementaryAreaMoreMenuItem } =\n\tunlock( editorPrivateApis );\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n\tpanelClassName,\n\tisActiveByDefault,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t\tpanelClassName={ panelClassName }\n\t\t\t\tisActiveByDefault={ isActiveByDefault }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC,iBAAiB;EAAEC;AAA8B,CAAC,GACzDR,MAAM,CAAED,iBAAkB,CAAC;AAE5B,eAAe,SAASU,cAAcA,CAAE;EACvCC,SAAS;EACTC,UAAU;EACVC,KAAK;EACLC,IAAI;EACJC,QAAQ;EACRC,UAAU;EACVC,MAAM;EACNC,eAAe;EACfC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,oBACCb,KAAA,CAAAF,SAAA;IAAAU,QAAA,gBACCZ,IAAA,CAACK,iBAAiB;MACjBG,SAAS,EAAGA,SAAW;MACvBU,KAAK,EAAC,MAAM;MACZT,UAAU,EAAGA,UAAY;MACzBC,KAAK,EAAGA,KAAO;MACfC,IAAI,EAAGA,IAAM;MACbE,UAAU,EAAGA,UAAY;MACzBC,MAAM,EAAGA,MAAQ;MACjBC,eAAe,EAAGA,eAAiB;MACnCC,cAAc,EAAGA,cAAgB;MACjCC,iBAAiB,EAAGA,iBAAmB;MAAAL,QAAA,EAErCA;IAAQ,CACQ,CAAC,eACpBZ,IAAA,CAACM,6BAA6B;MAC7BY,KAAK,EAAC,MAAM;MACZT,UAAU,EAAGA,UAAY;MACzBE,IAAI,EAAGA,IAAM;MAAAC,QAAA,EAEXF;IAAK,CACuB,CAAC;EAAA,CAC/B,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { FlexItem,
|
|
4
|
+
import { FlexItem, Flex, Button } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { styles, seen, backup } from '@wordpress/icons';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
8
|
import { useEffect } from '@wordpress/element';
|
|
9
9
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
10
10
|
import { store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
12
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Internal dependencies
|
|
@@ -22,7 +24,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
22
24
|
const {
|
|
23
25
|
interfaceStore
|
|
24
26
|
} = unlock(editorPrivateApis);
|
|
27
|
+
const {
|
|
28
|
+
useLocation
|
|
29
|
+
} = unlock(routerPrivateApis);
|
|
25
30
|
export default function GlobalStylesSidebar() {
|
|
31
|
+
const {
|
|
32
|
+
params
|
|
33
|
+
} = useLocation();
|
|
34
|
+
const {
|
|
35
|
+
canvas = 'view'
|
|
36
|
+
} = params;
|
|
26
37
|
const {
|
|
27
38
|
shouldClearCanvasContainerView,
|
|
28
39
|
isStyleBookOpened,
|
|
@@ -35,12 +46,11 @@ export default function GlobalStylesSidebar() {
|
|
|
35
46
|
getActiveComplementaryArea
|
|
36
47
|
} = select(interfaceStore);
|
|
37
48
|
const {
|
|
38
|
-
getEditorCanvasContainerView
|
|
39
|
-
getCanvasMode
|
|
49
|
+
getEditorCanvasContainerView
|
|
40
50
|
} = unlock(select(editSiteStore));
|
|
41
51
|
const canvasContainerView = getEditorCanvasContainerView();
|
|
42
52
|
const _isVisualEditorMode = 'visual' === select(editorStore).getEditorMode();
|
|
43
|
-
const _isEditCanvasMode = 'edit' ===
|
|
53
|
+
const _isEditCanvasMode = 'edit' === canvas;
|
|
44
54
|
const _showListViewByDefault = select(preferencesStore).get('core', 'showListViewByDefault');
|
|
45
55
|
const {
|
|
46
56
|
getEntityRecord,
|
|
@@ -56,15 +66,16 @@ export default function GlobalStylesSidebar() {
|
|
|
56
66
|
isRevisionsStyleBookOpened: 'global-styles-revisions:style-book' === canvasContainerView,
|
|
57
67
|
isRevisionsOpened: 'global-styles-revisions' === canvasContainerView
|
|
58
68
|
};
|
|
59
|
-
}, []);
|
|
69
|
+
}, [canvas]);
|
|
60
70
|
const {
|
|
61
71
|
setEditorCanvasContainerView
|
|
62
72
|
} = unlock(useDispatch(editSiteStore));
|
|
73
|
+
const isMobileViewport = useViewportMatch('medium', '<');
|
|
63
74
|
useEffect(() => {
|
|
64
75
|
if (shouldClearCanvasContainerView) {
|
|
65
76
|
setEditorCanvasContainerView(undefined);
|
|
66
77
|
}
|
|
67
|
-
}, [shouldClearCanvasContainerView]);
|
|
78
|
+
}, [shouldClearCanvasContainerView, setEditorCanvasContainerView]);
|
|
68
79
|
const {
|
|
69
80
|
setIsListViewOpened
|
|
70
81
|
} = useDispatch(editorStore);
|
|
@@ -106,35 +117,37 @@ export default function GlobalStylesSidebar() {
|
|
|
106
117
|
header: /*#__PURE__*/_jsxs(Flex, {
|
|
107
118
|
className: "edit-site-global-styles-sidebar__header",
|
|
108
119
|
gap: 1,
|
|
109
|
-
children: [/*#__PURE__*/_jsx(
|
|
110
|
-
style: {
|
|
111
|
-
minWidth: 'min-content'
|
|
112
|
-
},
|
|
120
|
+
children: [/*#__PURE__*/_jsx(FlexItem, {
|
|
113
121
|
children: /*#__PURE__*/_jsx("h2", {
|
|
114
122
|
className: "edit-site-global-styles-sidebar__header-title",
|
|
115
123
|
children: __('Styles')
|
|
116
124
|
})
|
|
117
|
-
}), /*#__PURE__*/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
125
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
126
|
+
justify: "flex-end",
|
|
127
|
+
gap: 1,
|
|
128
|
+
className: "edit-site-global-styles-sidebar__header-actions",
|
|
129
|
+
children: [!isMobileViewport && /*#__PURE__*/_jsx(FlexItem, {
|
|
130
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
131
|
+
icon: seen,
|
|
132
|
+
label: __('Style Book'),
|
|
133
|
+
isPressed: isStyleBookOpened || isRevisionsStyleBookOpened,
|
|
134
|
+
accessibleWhenDisabled: true,
|
|
135
|
+
disabled: shouldClearCanvasContainerView,
|
|
136
|
+
onClick: toggleStyleBook,
|
|
137
|
+
size: "compact"
|
|
138
|
+
})
|
|
139
|
+
}), /*#__PURE__*/_jsx(FlexItem, {
|
|
140
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
141
|
+
label: __('Revisions'),
|
|
142
|
+
icon: backup,
|
|
143
|
+
onClick: toggleRevisions,
|
|
144
|
+
accessibleWhenDisabled: true,
|
|
145
|
+
disabled: !hasRevisions,
|
|
146
|
+
isPressed: isRevisionsOpened || isRevisionsStyleBookOpened,
|
|
147
|
+
size: "compact"
|
|
148
|
+
})
|
|
149
|
+
}), /*#__PURE__*/_jsx(GlobalStylesMenuSlot, {})]
|
|
150
|
+
})]
|
|
138
151
|
}),
|
|
139
152
|
children: /*#__PURE__*/_jsx(GlobalStylesUI, {})
|
|
140
153
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FlexItem","FlexBlock","Flex","Button","__","styles","seen","backup","useSelect","useDispatch","useEffect","store","preferencesStore","editorStore","privateApis","editorPrivateApis","GlobalStylesUI","editSiteStore","GlobalStylesMenuSlot","unlock","coreStore","DefaultSidebar","jsx","_jsx","jsxs","_jsxs","interfaceStore","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","canvasContainerView","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","_showListViewByDefault","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","setIsListViewOpened","toggleRevisions","toggleStyleBook","className","identifier","title","icon","closeLabel","panelClassName","header","gap","children","style","minWidth","label","isPressed","accessibleWhenDisabled","disabled","onClick","size"],"sources":["@wordpress/edit-site/src/components/global-styles-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexItem, FlexBlock, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\nimport DefaultSidebar from './default-sidebar';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t'global-styles-revisions:style-book' === canvasContainerView,\n\t\t\tisRevisionsOpened:\n\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header\"\n\t\t\t\t\tgap={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<h2 className=\"edit-site-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisStyleBookOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisRevisionsOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,IAAI,EAAEC,MAAM,QAAQ,uBAAuB;AACzE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SACCD,KAAK,IAAIE,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASR,KAAK,IAAIS,SAAS,QAAQ,sBAAsB;AACzD,OAAOC,cAAc,MAA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,IAAA,CAACP,cAAc,IAAE;EAAC,CACH,CAAC;AAEnB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["FlexItem","Flex","Button","__","styles","seen","backup","useSelect","useDispatch","useEffect","store","preferencesStore","editorStore","privateApis","editorPrivateApis","useViewportMatch","routerPrivateApis","GlobalStylesUI","editSiteStore","GlobalStylesMenuSlot","unlock","coreStore","DefaultSidebar","jsx","_jsx","jsxs","_jsxs","interfaceStore","useLocation","GlobalStylesSidebar","params","canvas","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","select","getActiveComplementaryArea","getEditorCanvasContainerView","canvasContainerView","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","_showListViewByDefault","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","isMobileViewport","setIsListViewOpened","toggleRevisions","toggleStyleBook","className","identifier","title","icon","closeLabel","panelClassName","header","gap","children","justify","label","isPressed","accessibleWhenDisabled","disabled","onClick","size"],"sources":["@wordpress/edit-site/src/components/global-styles-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexItem, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\nimport DefaultSidebar from './default-sidebar';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function GlobalStylesSidebar() {\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\t\tconst { getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\t\tconst _isVisualEditorMode =\n\t\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\t\tconst _isEditCanvasMode = 'edit' === canvas;\n\t\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showListViewByDefault'\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\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\n\t\t\treturn {\n\t\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t\t! _isEditCanvasMode,\n\t\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\t\thasRevisions:\n\t\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]\n\t\t\t\t\t\t?.count,\n\t\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t\t'global-styles-revisions:style-book' ===\n\t\t\t\t\tcanvasContainerView,\n\t\t\t\tisRevisionsOpened:\n\t\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t\t};\n\t\t},\n\t\t[ canvas ]\n\t);\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView, setEditorCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header\"\n\t\t\t\t\tgap={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<h2 className=\"edit-site-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<Flex\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\tgap={ 1 }\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header-actions\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\t\t\tisStyleBookOpened ||\n\t\t\t\t\t\t\t\t\t\tisRevisionsStyleBookOpened\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\t\taccessibleWhenDis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sBAAsB;YACtBC,QAAQ,EAAG,CAAErC,YAAc;YAC3BmC,SAAS,EACRlC,iBAAiB,IACjBC,0BACA;YACDqC,IAAI,EAAC;UAAS,CACd;QAAC,CACO,CAAC,eACXlD,IAAA,CAACL,oBAAoB,IAAE,CAAC;MAAA,CACnB,CAAC;IAAA,CACF,CACN;IAAAgD,QAAA,eAED3C,IAAA,CAACP,cAAc,IAAE;EAAC,CACH,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -42,9 +42,7 @@ function useMovingAnimation({
|
|
|
42
42
|
} = useMemo(() => ({
|
|
43
43
|
previous: ref.current && getAbsolutePosition(ref.current),
|
|
44
44
|
prevRect: ref.current && ref.current.getBoundingClientRect()
|
|
45
|
-
}),
|
|
46
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
-
[triggerAnimationOnChange]);
|
|
45
|
+
}), [triggerAnimationOnChange]);
|
|
48
46
|
useLayoutEffect(() => {
|
|
49
47
|
if (!previous || !ref.current) {
|
|
50
48
|
return;
|