@wordpress/edit-site 5.22.0 → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/actions/index.js +115 -15
- package/build/components/actions/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +0 -7
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +7 -2
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +54 -63
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/dataviews/add-filter.js +91 -0
- package/build/components/dataviews/add-filter.js.map +1 -0
- package/build/components/dataviews/constants.js +14 -0
- package/build/components/dataviews/constants.js.map +1 -0
- package/build/components/dataviews/dataviews.js +30 -9
- package/build/components/dataviews/dataviews.js.map +1 -1
- package/build/components/dataviews/filter-summary.js +62 -0
- package/build/components/dataviews/filter-summary.js.map +1 -0
- package/build/components/dataviews/filters.js +37 -48
- package/build/components/dataviews/filters.js.map +1 -1
- package/build/components/dataviews/index.js +9 -2
- package/build/components/dataviews/index.js.map +1 -1
- package/build/components/dataviews/item-actions.js +139 -17
- package/build/components/dataviews/item-actions.js.map +1 -1
- package/build/components/dataviews/pagination.js +7 -2
- package/build/components/dataviews/pagination.js.map +1 -1
- package/build/components/dataviews/reset-filters.js +33 -0
- package/build/components/dataviews/reset-filters.js.map +1 -0
- package/build/components/dataviews/search.js +1 -0
- package/build/components/dataviews/search.js.map +1 -1
- package/build/components/dataviews/view-actions.js +49 -32
- package/build/components/dataviews/view-actions.js.map +1 -1
- package/build/components/dataviews/view-grid.js +48 -25
- package/build/components/dataviews/view-grid.js.map +1 -1
- package/build/components/dataviews/view-list.js +130 -14
- package/build/components/dataviews/view-list.js.map +1 -1
- package/build/components/dataviews/view-side-by-side.js +20 -0
- package/build/components/dataviews/view-side-by-side.js.map +1 -0
- package/build/components/editor/index.js +52 -56
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +1 -1
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +15 -2
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/header.js +4 -2
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +22 -16
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +66 -24
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +52 -24
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +9 -3
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +3 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/ui.js +31 -39
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +1 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +21 -16
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +160 -0
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -0
- package/build/components/header-edit-mode/index.js +50 -117
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +1 -1
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/site-export.js +2 -6
- package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build/components/layout/index.js +4 -19
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +44 -54
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/{page-content-focus-manager → page-content-focus-notifications}/back-to-page-notification.js +11 -15
- package/build/components/page-content-focus-notifications/back-to-page-notification.js.map +1 -0
- package/build/components/{page-content-focus-manager → page-content-focus-notifications}/edit-template-notification.js +9 -13
- package/build/components/page-content-focus-notifications/edit-template-notification.js.map +1 -0
- package/build/components/page-content-focus-notifications/index.js +22 -0
- package/build/components/page-content-focus-notifications/index.js.map +1 -0
- package/build/components/page-main/index.js +2 -1
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +137 -88
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-pages/side-editor.js +25 -0
- package/build/components/page-pages/side-editor.js.map +1 -0
- package/build/components/page-patterns/grid-item.js +2 -2
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +3 -3
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +2 -2
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/dataviews-templates.js +316 -0
- package/build/components/page-templates/dataviews-templates.js.map +1 -0
- package/build/components/page-templates/template-actions.js +168 -0
- package/build/components/page-templates/template-actions.js.map +1 -0
- package/build/components/preferences-modal/index.js +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/save-button/index.js +9 -6
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +14 -0
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +124 -0
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -0
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +191 -0
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -0
- package/build/components/sidebar-dataviews/dataview-item.js +71 -0
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -0
- package/build/components/sidebar-dataviews/default-views.js +65 -0
- package/build/components/sidebar-dataviews/default-views.js.map +1 -0
- package/build/components/sidebar-dataviews/index.js +21 -38
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +2 -6
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +6 -5
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +18 -29
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/hooks.js +22 -8
- package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +8 -5
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +5 -8
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +6 -14
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +4 -12
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -6
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +10 -6
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +3 -3
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +23 -4
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +3 -11
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/site-hub/index.js +18 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +12 -16
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +22 -12
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +150 -55
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +1 -1
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/welcome-guide/page.js +2 -2
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +6 -3
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +24 -14
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +3 -1
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +6 -2
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +0 -3
- package/build/index.js.map +1 -1
- package/build/store/actions.js +39 -83
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +2 -27
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -23
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +1 -40
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +33 -67
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +3 -14
- package/build/utils/constants.js.map +1 -1
- package/build-module/components/actions/index.js +113 -14
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +0 -7
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +7 -2
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +54 -62
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/dataviews/add-filter.js +84 -0
- package/build-module/components/dataviews/add-filter.js.map +1 -0
- package/build-module/components/dataviews/constants.js +6 -0
- package/build-module/components/dataviews/constants.js.map +1 -0
- package/build-module/components/dataviews/dataviews.js +29 -9
- package/build-module/components/dataviews/dataviews.js.map +1 -1
- package/build-module/components/dataviews/filter-summary.js +55 -0
- package/build-module/components/dataviews/filter-summary.js.map +1 -0
- package/build-module/components/dataviews/filters.js +37 -48
- package/build-module/components/dataviews/filters.js.map +1 -1
- package/build-module/components/dataviews/index.js +1 -1
- package/build-module/components/dataviews/index.js.map +1 -1
- package/build-module/components/dataviews/item-actions.js +142 -20
- package/build-module/components/dataviews/item-actions.js.map +1 -1
- package/build-module/components/dataviews/pagination.js +7 -2
- package/build-module/components/dataviews/pagination.js.map +1 -1
- package/build-module/components/dataviews/reset-filters.js +26 -0
- package/build-module/components/dataviews/reset-filters.js.map +1 -0
- package/build-module/components/dataviews/search.js +1 -0
- package/build-module/components/dataviews/search.js.map +1 -1
- package/build-module/components/dataviews/view-actions.js +50 -33
- package/build-module/components/dataviews/view-actions.js.map +1 -1
- package/build-module/components/dataviews/view-grid.js +49 -26
- package/build-module/components/dataviews/view-grid.js.map +1 -1
- package/build-module/components/dataviews/view-list.js +132 -16
- package/build-module/components/dataviews/view-list.js.map +1 -1
- package/build-module/components/dataviews/view-side-by-side.js +12 -0
- package/build-module/components/dataviews/view-side-by-side.js.map +1 -0
- package/build-module/components/editor/index.js +55 -59
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +14 -2
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/header.js +4 -2
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +23 -17
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +67 -25
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +51 -24
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +9 -3
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +3 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/ui.js +31 -39
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +1 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +21 -16
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +152 -0
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +54 -121
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js +2 -6
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build-module/components/layout/index.js +5 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +45 -56
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/{page-content-focus-manager → page-content-focus-notifications}/back-to-page-notification.js +11 -15
- package/build-module/components/page-content-focus-notifications/back-to-page-notification.js.map +1 -0
- package/build-module/components/{page-content-focus-manager → page-content-focus-notifications}/edit-template-notification.js +9 -13
- package/build-module/components/page-content-focus-notifications/edit-template-notification.js.map +1 -0
- package/build-module/components/page-content-focus-notifications/index.js +14 -0
- package/build-module/components/page-content-focus-notifications/index.js.map +1 -0
- package/build-module/components/page-main/index.js +2 -1
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +141 -90
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-pages/side-editor.js +17 -0
- package/build-module/components/page-pages/side-editor.js.map +1 -0
- package/build-module/components/page-patterns/grid-item.js +2 -2
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +4 -4
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +3 -3
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/dataviews-templates.js +308 -0
- package/build-module/components/page-templates/dataviews-templates.js.map +1 -0
- package/build-module/components/page-templates/template-actions.js +157 -0
- package/build-module/components/page-templates/template-actions.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/save-button/index.js +11 -8
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +14 -0
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +116 -0
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -0
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +182 -0
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -0
- package/build-module/components/sidebar-dataviews/dataview-item.js +63 -0
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -0
- package/build-module/components/sidebar-dataviews/default-views.js +57 -0
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -0
- package/build-module/components/sidebar-dataviews/index.js +22 -39
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +2 -6
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +6 -5
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +20 -31
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +21 -7
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +9 -6
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +6 -8
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +8 -16
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +5 -13
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -6
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +10 -6
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +4 -4
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +23 -4
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +3 -11
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/site-hub/index.js +19 -7
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +13 -16
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +22 -12
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +150 -56
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +2 -2
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +6 -3
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +24 -14
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +6 -2
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +0 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +37 -80
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +1 -25
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -22
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +1 -38
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +27 -62
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +1 -11
- package/build-module/utils/constants.js.map +1 -1
- package/build-style/style-rtl.css +221 -181
- package/build-style/style.css +221 -181
- package/package.json +41 -41
- package/src/components/actions/index.js +150 -14
- package/src/components/add-new-template/new-template.js +0 -5
- package/src/components/block-editor/site-editor-canvas.js +8 -2
- package/src/components/block-editor/style.scss +0 -87
- package/src/components/block-editor/use-site-editor-settings.js +68 -89
- package/src/components/dataviews/README.md +80 -83
- package/src/components/dataviews/add-filter.js +108 -0
- package/src/components/dataviews/constants.js +5 -0
- package/src/components/dataviews/dataviews.js +28 -10
- package/src/components/dataviews/filter-summary.js +79 -0
- package/src/components/dataviews/filters.js +48 -58
- package/src/components/dataviews/index.js +1 -1
- package/src/components/dataviews/item-actions.js +169 -30
- package/src/components/dataviews/pagination.js +9 -4
- package/src/components/dataviews/reset-filters.js +26 -0
- package/src/components/dataviews/search.js +1 -0
- package/src/components/dataviews/style.scss +89 -9
- package/src/components/dataviews/view-actions.js +77 -49
- package/src/components/dataviews/view-grid.js +63 -38
- package/src/components/dataviews/view-list.js +182 -18
- package/src/components/dataviews/view-side-by-side.js +9 -0
- package/src/components/editor/index.js +135 -123
- package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +1 -1
- package/src/components/global-styles/font-library-modal/utils/index.js +20 -9
- package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +46 -15
- package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +28 -0
- package/src/components/global-styles/header.js +2 -1
- package/src/components/global-styles/screen-block-list.js +37 -26
- package/src/components/global-styles/screen-revisions/index.js +91 -35
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +65 -45
- package/src/components/global-styles/screen-revisions/style.scss +52 -28
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -6
- package/src/components/global-styles/screen-root.js +2 -1
- package/src/components/global-styles/style.scss +0 -11
- package/src/components/global-styles/ui.js +60 -75
- package/src/components/global-styles-renderer/index.js +1 -1
- package/src/components/header-edit-mode/document-actions/index.js +20 -18
- package/src/components/header-edit-mode/document-tools/index.js +201 -0
- package/src/components/header-edit-mode/index.js +87 -184
- package/src/components/header-edit-mode/more-menu/index.js +1 -1
- package/src/components/header-edit-mode/more-menu/site-export.js +2 -6
- package/src/components/header-edit-mode/style.scss +35 -2
- package/src/components/layout/index.js +4 -11
- package/src/components/layout/style.scss +6 -18
- package/src/components/list/added-by.js +24 -64
- package/src/components/list/style.scss +11 -13
- package/src/components/{page-content-focus-manager → page-content-focus-notifications}/back-to-page-notification.js +10 -22
- package/src/components/{page-content-focus-manager → page-content-focus-notifications}/edit-template-notification.js +9 -13
- package/src/components/page-content-focus-notifications/index.js +14 -0
- package/src/components/page-main/index.js +6 -1
- package/src/components/page-pages/index.js +167 -91
- package/src/components/page-pages/side-editor.js +14 -0
- package/src/components/page-patterns/grid-item.js +3 -3
- package/src/components/page-patterns/patterns-list.js +10 -4
- package/src/components/page-patterns/use-patterns.js +4 -3
- package/src/components/page-templates/dataviews-templates.js +345 -0
- package/src/components/page-templates/style.scss +13 -0
- package/src/components/page-templates/template-actions.js +209 -0
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/save-button/index.js +37 -24
- package/src/components/save-hub/index.js +15 -0
- package/src/components/save-hub/style.scss +7 -0
- package/src/components/sidebar/index.js +1 -2
- package/src/components/sidebar-dataviews/add-new-view.js +141 -0
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +229 -0
- package/src/components/sidebar-dataviews/dataview-item.js +67 -0
- package/src/components/sidebar-dataviews/default-views.js +59 -0
- package/src/components/sidebar-dataviews/index.js +36 -45
- package/src/components/sidebar-dataviews/style.scss +29 -0
- package/src/components/sidebar-edit-mode/default-sidebar.js +6 -6
- package/src/components/sidebar-edit-mode/index.js +13 -9
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +31 -57
- package/src/components/sidebar-edit-mode/page-panels/hooks.js +20 -9
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +6 -6
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +10 -8
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +13 -12
- package/src/components/sidebar-edit-mode/page-panels/style.scss +14 -19
- package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +10 -9
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +6 -6
- package/src/components/sidebar-edit-mode/settings-header/index.js +8 -9
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +11 -7
- package/src/components/sidebar-navigation-screen/style.scss +1 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/src/components/sidebar-navigation-screen-page/index.js +24 -3
- package/src/components/sidebar-navigation-screen-page/page-details.js +4 -17
- package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -2
- package/src/components/sidebar-navigation-screen-template/style.scss +6 -1
- package/src/components/site-hub/index.js +9 -8
- package/src/components/start-template-options/index.js +14 -12
- package/src/components/style-book/index.js +48 -35
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +182 -63
- package/src/components/template-part-converter/convert-to-regular.js +1 -1
- package/src/components/welcome-guide/page.js +2 -2
- package/src/components/welcome-guide/template.js +4 -2
- package/src/hooks/commands/use-edit-mode-commands.js +22 -16
- package/src/hooks/push-changes-to-global-styles/index.js +13 -6
- package/src/hooks/template-part-edit.js +4 -2
- package/src/index.js +0 -8
- package/src/store/actions.js +42 -96
- package/src/store/private-actions.js +1 -24
- package/src/store/private-selectors.js +0 -22
- package/src/store/reducer.js +0 -39
- package/src/store/selectors.js +43 -95
- package/src/store/test/actions.js +14 -169
- package/src/store/test/reducer.js +0 -62
- package/src/store/test/selectors.js +0 -117
- package/src/style.scss +2 -0
- package/src/utils/constants.js +1 -11
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -77
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +0 -1
- package/build/components/block-editor/block-editor-provider/index.js +0 -31
- package/build/components/block-editor/block-editor-provider/index.js.map +0 -1
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -110
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +0 -1
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -84
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +0 -1
- package/build/components/block-editor/index.js +0 -30
- package/build/components/block-editor/index.js.map +0 -1
- package/build/components/dataviews/in-filter.js +0 -49
- package/build/components/dataviews/in-filter.js.map +0 -1
- package/build/components/page-content-focus-manager/back-to-page-notification.js.map +0 -1
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +0 -50
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +0 -1
- package/build/components/page-content-focus-manager/edit-template-notification.js.map +0 -1
- package/build/components/page-content-focus-manager/index.js +0 -61
- package/build/components/page-content-focus-manager/index.js.map +0 -1
- package/build/components/page-pages/default-views.js +0 -62
- package/build/components/page-pages/default-views.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js +0 -87
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -69
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/index.js +0 -23
- package/build-module/components/block-editor/block-editor-provider/index.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -102
- package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -78
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +0 -1
- package/build-module/components/block-editor/index.js +0 -22
- package/build-module/components/block-editor/index.js.map +0 -1
- package/build-module/components/dataviews/in-filter.js +0 -41
- package/build-module/components/dataviews/in-filter.js.map +0 -1
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +0 -1
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +0 -43
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +0 -1
- package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +0 -1
- package/build-module/components/page-content-focus-manager/index.js +0 -52
- package/build-module/components/page-content-focus-manager/index.js.map +0 -1
- package/build-module/components/page-pages/default-views.js +0 -55
- package/build-module/components/page-pages/default-views.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +0 -80
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +0 -1
- package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -75
- package/src/components/block-editor/block-editor-provider/index.js +0 -29
- package/src/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -114
- package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +0 -116
- package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -90
- package/src/components/block-editor/index.js +0 -28
- package/src/components/dataviews/in-filter.js +0 -45
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +0 -52
- package/src/components/page-content-focus-manager/index.js +0 -51
- package/src/components/page-pages/default-views.js +0 -60
- package/src/components/sidebar-edit-mode/page-panels/publish-date.js +0 -94
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import classnames from 'classnames';
|
|
6
|
-
|
|
7
2
|
/**
|
|
8
3
|
* WordPress dependencies
|
|
9
4
|
*/
|
|
@@ -35,11 +30,15 @@ import ScreenRevisions from './screen-revisions';
|
|
|
35
30
|
import { unlock } from '../../lock-unlock';
|
|
36
31
|
import { store as editSiteStore } from '../../store';
|
|
37
32
|
const SLOT_FILL_NAME = 'GlobalStylesMenu';
|
|
33
|
+
const {
|
|
34
|
+
useGlobalStylesReset
|
|
35
|
+
} = unlock(blockEditorPrivateApis);
|
|
38
36
|
const {
|
|
39
37
|
Slot: GlobalStylesMenuSlot,
|
|
40
38
|
Fill: GlobalStylesMenuFill
|
|
41
39
|
} = createSlotFill(SLOT_FILL_NAME);
|
|
42
40
|
function GlobalStylesActionMenu() {
|
|
41
|
+
const [canReset, onReset] = useGlobalStylesReset();
|
|
43
42
|
const {
|
|
44
43
|
toggle
|
|
45
44
|
} = useDispatch(preferencesStore);
|
|
@@ -56,31 +55,35 @@ function GlobalStylesActionMenu() {
|
|
|
56
55
|
canEditCSS: !!globalStyles?._links?.['wp:action-edit-css']
|
|
57
56
|
};
|
|
58
57
|
}, []);
|
|
58
|
+
const {
|
|
59
|
+
setEditorCanvasContainerView
|
|
60
|
+
} = unlock(useDispatch(editSiteStore));
|
|
59
61
|
const {
|
|
60
62
|
goTo
|
|
61
63
|
} = useNavigator();
|
|
62
|
-
const loadCustomCSS = () =>
|
|
64
|
+
const loadCustomCSS = () => {
|
|
65
|
+
setEditorCanvasContainerView('global-styles-css');
|
|
66
|
+
goTo('/css');
|
|
67
|
+
};
|
|
63
68
|
return createElement(GlobalStylesMenuFill, null, createElement(DropdownMenu, {
|
|
64
69
|
icon: moreVertical,
|
|
65
70
|
label: __('More')
|
|
66
71
|
}, ({
|
|
67
72
|
onClose
|
|
68
|
-
}) => createElement(MenuGroup, null, canEditCSS && createElement(MenuItem, {
|
|
73
|
+
}) => createElement(Fragment, null, createElement(MenuGroup, null, canEditCSS && createElement(MenuItem, {
|
|
69
74
|
onClick: loadCustomCSS
|
|
70
75
|
}, __('Additional CSS')), createElement(MenuItem, {
|
|
71
76
|
onClick: () => {
|
|
72
77
|
toggle('core/edit-site', 'welcomeGuideStyles');
|
|
73
78
|
onClose();
|
|
74
79
|
}
|
|
75
|
-
}, __('Welcome Guide')))
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
className: classnames(className, 'edit-site-global-styles-sidebar__revisions-count-badge')
|
|
83
|
-
}, children);
|
|
80
|
+
}, __('Welcome Guide'))), createElement(MenuGroup, null, createElement(MenuItem, {
|
|
81
|
+
onClick: () => {
|
|
82
|
+
onReset();
|
|
83
|
+
onClose();
|
|
84
|
+
},
|
|
85
|
+
disabled: !canReset
|
|
86
|
+
}, __('Reset styles'))))));
|
|
84
87
|
}
|
|
85
88
|
function GlobalStylesRevisionsMenu() {
|
|
86
89
|
const {
|
|
@@ -100,41 +103,30 @@ function GlobalStylesRevisionsMenu() {
|
|
|
100
103
|
revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
|
|
101
104
|
};
|
|
102
105
|
}, []);
|
|
103
|
-
const {
|
|
104
|
-
useGlobalStylesReset
|
|
105
|
-
} = unlock(blockEditorPrivateApis);
|
|
106
|
-
const [canReset, onReset] = useGlobalStylesReset();
|
|
107
106
|
const {
|
|
108
107
|
goTo
|
|
109
108
|
} = useNavigator();
|
|
110
109
|
const {
|
|
111
110
|
setEditorCanvasContainerView
|
|
112
111
|
} = unlock(useDispatch(editSiteStore));
|
|
112
|
+
const isRevisionsOpened = useSelect(select => 'global-styles-revisions' === unlock(select(editSiteStore)).getEditorCanvasContainerView(), []);
|
|
113
113
|
const loadRevisions = () => {
|
|
114
114
|
setIsListViewOpened(false);
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
if (!isRevisionsOpened) {
|
|
116
|
+
goTo('/revisions');
|
|
117
|
+
setEditorCanvasContainerView('global-styles-revisions');
|
|
118
|
+
} else {
|
|
119
|
+
goTo('/');
|
|
120
|
+
setEditorCanvasContainerView(undefined);
|
|
121
|
+
}
|
|
117
122
|
};
|
|
118
123
|
const hasRevisions = revisionsCount > 0;
|
|
119
|
-
return createElement(GlobalStylesMenuFill, null,
|
|
120
|
-
icon: backup,
|
|
121
|
-
label: __('Revisions')
|
|
122
|
-
}, ({
|
|
123
|
-
onClose
|
|
124
|
-
}) => createElement(MenuGroup, null, hasRevisions && createElement(MenuItem, {
|
|
125
|
-
onClick: loadRevisions,
|
|
126
|
-
icon: createElement(RevisionsCountBadge, null, revisionsCount)
|
|
127
|
-
}, __('Revision history')), createElement(MenuItem, {
|
|
128
|
-
onClick: () => {
|
|
129
|
-
onReset();
|
|
130
|
-
onClose();
|
|
131
|
-
},
|
|
132
|
-
disabled: !canReset
|
|
133
|
-
}, __('Reset to defaults')))) : createElement(Button, {
|
|
124
|
+
return createElement(GlobalStylesMenuFill, null, createElement(Button, {
|
|
134
125
|
label: __('Revisions'),
|
|
135
126
|
icon: backup,
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
onClick: loadRevisions,
|
|
128
|
+
disabled: !hasRevisions,
|
|
129
|
+
isPressed: isRevisionsOpened
|
|
138
130
|
}));
|
|
139
131
|
}
|
|
140
132
|
function GlobalStylesNavigationScreen({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","Button","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","backup","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","goTo","loadCustomCSS","createElement","icon","label","onClose","onClick","RevisionsCountBadge","className","children","GlobalStylesRevisionsMenu","setIsListViewOpened","revisionsCount","_globalStyles$_links$","count","useGlobalStylesReset","canReset","onReset","setEditorCanvasContainerView","loadRevisions","hasRevisions","disabled","__experimentalIsFocusable","GlobalStylesNavigationScreen","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","key","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","Fragment","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tButton,\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 { backup, 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 ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\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 { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\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 { goTo } = useNavigator();\n\tconst loadCustomCSS = () => goTo( '/css' );\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ moreVertical } label={ __( 'More' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction RevisionsCountBadge( { className, children } ) {\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-sidebar__revisions-count-badge'\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</span>\n\t);\n}\nfunction GlobalStylesRevisionsMenu() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { revisionsCount } = 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\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount > 0;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t{ canReset || hasRevisions ? (\n\t\t\t\t<DropdownMenu icon={ backup } label={ __( 'Revisions' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ hasRevisions && (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ loadRevisions }\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t<RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t\t\t\t\t\t</RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Revision history' ) }\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\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 to defaults' ) }\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</DropdownMenu>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\ticon={ backup }\n\t\t\t\t\tdisabled\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t/>\n\t\t\t) }\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\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\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\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t} else if ( editorCanvasContainerView === 'global-styles-css' ) {\n\t\t\tgoTo( '/css' );\n\t\t}\n\n\t\t// location?.path is not a dependency because we don't want to track it.\n\t\t// Doing so will cause an infinite loop. We could abstract logic to avoid\n\t\t// having to disable the check later.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ editorCanvasContainerView, 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<NavigatorProvider\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/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=\"/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{ 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<GlobalStylesRevisionsMenu />\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,EAChDC,0BAA0B,IAAIC,YAAY,EAC1CC,cAAc,EACdC,MAAM,EACNC,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,MAAM,EAAEC,YAAY,QAAQ,kBAAkB;AACvD,SAASV,KAAK,IAAIW,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,UAAU,MAAM,eAAe;AACtC,SACCC,uBAAuB,EACvBC,OAAO,IAAIC,eAAe,QACpB,qBAAqB;AAC5B,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,uBAAuB,MAAM,6BAA6B;AACjE,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,qBAAqB,MAAM,2BAA2B;AAC7D,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,eAAe,MAAM,oBAAo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qB,4BAA4B;IAACa,IAAI,EAAG;EAAc,GAClDlC,aAAA,CAACpB,eAAe,MAAE,CACW,CAAC,EAE7BmF,MAAM,CAACjC,GAAG,CAAIoC,KAAK,IACpBlE,aAAA,CAACqB,4BAA4B;IAC5BY,GAAG,EAAG,aAAa,GAAGiC,KAAK,CAAC/B,IAAM;IAClCD,IAAI,EAAG,UAAU,GAAGY,kBAAkB,CAAEoB,KAAK,CAAC/B,IAAK;EAAG,GAEtDnC,aAAA,CAAC7B,WAAW;IAACgE,IAAI,EAAG+B,KAAK,CAAC/B;EAAM,CAAE,CACL,CAC7B,CAAC,EAEHnC,aAAA,CAACqC,cAAc,MAAE,CAAC,EAEhB0B,MAAM,CAACjC,GAAG,CAAIoC,KAAK,IACpBlE,aAAA,CAACqC,cAAc;IACdJ,GAAG,EAAG,gBAAgB,GAAGiC,KAAK,CAAC/B,IAAM;IACrCA,IAAI,EAAG+B,KAAK,CAAC/B,IAAM;IACnBR,UAAU,EAAG,UAAU,GAAGmB,kBAAkB,CAAEoB,KAAK,CAAC/B,IAAK;EAAG,CAC5D,CACA,CAAC,EAED,YAAY,KAAKyB,yBAAyB,IAC3C5D,aAAA,CAAC0C,qBAAqB,MAAE,CACxB,EAED1C,aAAA,CAACQ,yBAAyB,MAAE,CAAC,EAC7BR,aAAA,CAACZ,sBAAsB,MAAE,CAAC,EAC1BY,aAAA,CAACiD,qBAAqB,MAAE,CAAC,EACzBjD,aAAA,CAAC2D,qCAAqC,MAAE,CACtB,CAAC;AAEtB;AACA,SAAS1E,oBAAoB;AAC7B,eAAe6E,cAAc"}
|
|
1
|
+
{"version":3,"names":["__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","Button","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","backup","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","SLOT_FILL_NAME","useGlobalStylesReset","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","canReset","onReset","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","goTo","loadCustomCSS","createElement","icon","label","onClose","Fragment","onClick","disabled","GlobalStylesRevisionsMenu","setIsListViewOpened","revisionsCount","_globalStyles$_links$","count","isRevisionsOpened","getEditorCanvasContainerView","loadRevisions","hasRevisions","isPressed","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","key","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tButton,\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 { backup, 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 ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\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 { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ moreVertical } label={ __( 'More' ) }>\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 GlobalStylesRevisionsMenu() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { revisionsCount } = 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\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst isRevisionsOpened = useSelect(\n\t\t( select ) =>\n\t\t\t'global-styles-revisions' ===\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\n\t\tif ( ! isRevisionsOpened ) {\n\t\t\tgoTo( '/revisions' );\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t} else {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t};\n\tconst hasRevisions = revisionsCount > 0;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<Button\n\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\ticon={ backup }\n\t\t\t\tonClick={ loadRevisions }\n\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\tisPressed={ isRevisionsOpened }\n\t\t\t/>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\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\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\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t} else if ( editorCanvasContainerView === 'global-styles-css' ) {\n\t\t\tgoTo( '/css' );\n\t\t}\n\n\t\t// location?.path is not a dependency because we don't want to track it.\n\t\t// Doing so will cause an infinite loop. We could abstract logic to avoid\n\t\t// having to disable the check later.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ editorCanvasContainerView, 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<NavigatorProvider\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/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=\"/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{ 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<GlobalStylesRevisionsMenu />\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCan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,EAE7BkF,MAAM,CAAC/B,GAAG,CAAIkC,KAAK,IACpB7D,aAAA,CAACiB,4BAA4B;IAC5Ba,GAAG,EAAG,aAAa,GAAG+B,KAAK,CAAC7B,IAAM;IAClCD,IAAI,EAAG,UAAU,GAAGW,kBAAkB,CAAEmB,KAAK,CAAC7B,IAAK;EAAG,GAEtDhC,aAAA,CAACjC,WAAW;IAACiE,IAAI,EAAG6B,KAAK,CAAC7B;EAAM,CAAE,CACL,CAC7B,CAAC,EAEHhC,aAAA,CAACkC,cAAc,MAAE,CAAC,EAEhBwB,MAAM,CAAC/B,GAAG,CAAIkC,KAAK,IACpB7D,aAAA,CAACkC,cAAc;IACdJ,GAAG,EAAG,gBAAgB,GAAG+B,KAAK,CAAC7B,IAAM;IACrCA,IAAI,EAAG6B,KAAK,CAAC7B,IAAM;IACnBR,UAAU,EAAG,UAAU,GAAGkB,kBAAkB,CAAEmB,KAAK,CAAC7B,IAAK;EAAG,CAC5D,CACA,CAAC,EAED,YAAY,KAAKwB,yBAAyB,IAC3CxD,aAAA,CAACsC,qBAAqB,MAAE,CACxB,EAEDtC,aAAA,CAACO,yBAAyB,MAAE,CAAC,EAC7BP,aAAA,CAACf,sBAAsB,MAAE,CAAC,EAC1Be,aAAA,CAAC6C,qBAAqB,MAAE,CAAC,EACzB7C,aAAA,CAACuD,qCAAqC,MAAE,CACtB,CAAC;AAEtB;AACA,SAASzE,oBAAoB;AAC7B,eAAe2E,cAAc"}
|
|
@@ -33,7 +33,7 @@ function useGlobalStylesRenderer() {
|
|
|
33
33
|
styles: [...nonGlobalStyles, ...styles],
|
|
34
34
|
__experimentalFeatures: settings
|
|
35
35
|
});
|
|
36
|
-
}, [styles, settings]);
|
|
36
|
+
}, [styles, settings, updateSettings, getSettings]);
|
|
37
37
|
}
|
|
38
38
|
export function GlobalStylesRenderer() {
|
|
39
39
|
useGlobalStylesRenderer();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useSelect","useDispatch","privateApis","blockEditorPrivateApis","store","editSiteStore","unlock","useGlobalStylesOutput","useGlobalStylesRenderer","styles","settings","getSettings","updateSettings","_currentStoreSettings","currentStoreSettings","nonGlobalStyles","Object","values","filter","style","isGlobalStyles","__experimentalFeatures","GlobalStylesRenderer"],"sources":["@wordpress/edit-site/src/components/global-styles-renderer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );\n\nfunction useGlobalStylesRenderer() {\n\tconst [ styles, settings ] = useGlobalStylesOutput();\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings ] );\n}\n\nexport function GlobalStylesRenderer() {\n\tuseGlobalStylesRenderer();\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAsB,CAAC,GAAGD,MAAM,CAAEH,sBAAuB,CAAC;AAElE,SAASK,uBAAuBA,CAAA,EAAG;EAClC,MAAM,CAAEC,MAAM,EAAEC,QAAQ,CAAE,GAAGH,qBAAqB,CAAC,CAAC;EACpD,MAAM;IAAEI;EAAY,CAAC,GAAGX,SAAS,CAAEK,aAAc,CAAC;EAClD,MAAM;IAAEO;EAAe,CAAC,GAAGX,WAAW,CAAEI,aAAc,CAAC;EAEvDN,SAAS,CAAE,MAAM;IAAA,IAAAc,qBAAA;IAChB,IAAK,CAAEJ,MAAM,IAAI,CAAEC,QAAQ,EAAG;MAC7B;IACD;IAEA,MAAMI,oBAAoB,GAAGH,WAAW,CAAC,CAAC;IAC1C,MAAMI,eAAe,GAAGC,MAAM,CAACC,MAAM,EAAAJ,qBAAA,GACpCC,oBAAoB,CAACL,MAAM,cAAAI,qBAAA,cAAAA,qBAAA,GAAI,EAChC,CAAC,CAACK,MAAM,CAAIC,KAAK,IAAM,CAAEA,KAAK,CAACC,cAAe,CAAC;IAC/CR,cAAc,CAAE;MACf,GAAGE,oBAAoB;MACvBL,MAAM,EAAE,CAAE,GAAGM,eAAe,EAAE,GAAGN,MAAM,CAAE;MACzCY,sBAAsB,EAAEX;IACzB,CAAE,CAAC;EACJ,CAAC,EAAE,CAAED,MAAM,EAAEC,QAAQ,CAAG,CAAC;
|
|
1
|
+
{"version":3,"names":["useEffect","useSelect","useDispatch","privateApis","blockEditorPrivateApis","store","editSiteStore","unlock","useGlobalStylesOutput","useGlobalStylesRenderer","styles","settings","getSettings","updateSettings","_currentStoreSettings","currentStoreSettings","nonGlobalStyles","Object","values","filter","style","isGlobalStyles","__experimentalFeatures","GlobalStylesRenderer"],"sources":["@wordpress/edit-site/src/components/global-styles-renderer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );\n\nfunction useGlobalStylesRenderer() {\n\tconst [ styles, settings ] = useGlobalStylesOutput();\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings, updateSettings, getSettings ] );\n}\n\nexport function GlobalStylesRenderer() {\n\tuseGlobalStylesRenderer();\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAsB,CAAC,GAAGD,MAAM,CAAEH,sBAAuB,CAAC;AAElE,SAASK,uBAAuBA,CAAA,EAAG;EAClC,MAAM,CAAEC,MAAM,EAAEC,QAAQ,CAAE,GAAGH,qBAAqB,CAAC,CAAC;EACpD,MAAM;IAAEI;EAAY,CAAC,GAAGX,SAAS,CAAEK,aAAc,CAAC;EAClD,MAAM;IAAEO;EAAe,CAAC,GAAGX,WAAW,CAAEI,aAAc,CAAC;EAEvDN,SAAS,CAAE,MAAM;IAAA,IAAAc,qBAAA;IAChB,IAAK,CAAEJ,MAAM,IAAI,CAAEC,QAAQ,EAAG;MAC7B;IACD;IAEA,MAAMI,oBAAoB,GAAGH,WAAW,CAAC,CAAC;IAC1C,MAAMI,eAAe,GAAGC,MAAM,CAACC,MAAM,EAAAJ,qBAAA,GACpCC,oBAAoB,CAACL,MAAM,cAAAI,qBAAA,cAAAA,qBAAA,GAAI,EAChC,CAAC,CAACK,MAAM,CAAIC,KAAK,IAAM,CAAEA,KAAK,CAACC,cAAe,CAAC;IAC/CR,cAAc,CAAE;MACf,GAAGE,oBAAoB;MACvBL,MAAM,EAAE,CAAE,GAAGM,eAAe,EAAE,GAAGN,MAAM,CAAE;MACzCY,sBAAsB,EAAEX;IACzB,CAAE,CAAC;EACJ,CAAC,EAAE,CAAED,MAAM,EAAEC,QAAQ,EAAEE,cAAc,EAAED,WAAW,CAAG,CAAC;AACvD;AAEA,OAAO,SAASW,oBAAoBA,CAAA,EAAG;EACtCd,uBAAuB,CAAC,CAAC;EAEzB,OAAO,IAAI;AACZ"}
|
|
@@ -14,8 +14,9 @@ import { BlockIcon } from '@wordpress/block-editor';
|
|
|
14
14
|
import { store as commandsStore } from '@wordpress/commands';
|
|
15
15
|
import { chevronLeftSmall, chevronRightSmall, page as pageIcon, navigation as navigationIcon, symbol } from '@wordpress/icons';
|
|
16
16
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
17
|
-
import { useState, useEffect, useRef } from '@wordpress/element';
|
|
18
17
|
import { store as coreStore } from '@wordpress/core-data';
|
|
18
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
19
|
+
import { useRef, useState, useEffect } from '@wordpress/element';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Internal dependencies
|
|
@@ -35,40 +36,42 @@ export default function DocumentActions() {
|
|
|
35
36
|
}
|
|
36
37
|
function PageDocumentActions() {
|
|
37
38
|
const {
|
|
38
|
-
|
|
39
|
+
isEditingPage,
|
|
39
40
|
hasResolved,
|
|
40
41
|
isFound,
|
|
41
42
|
title
|
|
42
43
|
} = useSelect(select => {
|
|
43
44
|
const {
|
|
44
|
-
hasPageContentFocus: _hasPageContentFocus,
|
|
45
45
|
getEditedPostContext
|
|
46
46
|
} = select(editSiteStore);
|
|
47
47
|
const {
|
|
48
48
|
getEditedEntityRecord,
|
|
49
49
|
hasFinishedResolution
|
|
50
50
|
} = select(coreStore);
|
|
51
|
+
const {
|
|
52
|
+
getRenderingMode
|
|
53
|
+
} = select(editorStore);
|
|
51
54
|
const context = getEditedPostContext();
|
|
52
55
|
const queryArgs = ['postType', context.postType, context.postId];
|
|
53
56
|
const page = getEditedEntityRecord(...queryArgs);
|
|
54
57
|
return {
|
|
55
|
-
|
|
58
|
+
isEditingPage: !!context.postId && getRenderingMode() !== 'template-only',
|
|
56
59
|
hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
|
|
57
60
|
isFound: !!page,
|
|
58
61
|
title: page?.title
|
|
59
62
|
};
|
|
60
63
|
}, []);
|
|
61
64
|
const {
|
|
62
|
-
|
|
63
|
-
} = useDispatch(
|
|
64
|
-
const [
|
|
65
|
-
const
|
|
65
|
+
setRenderingMode
|
|
66
|
+
} = useDispatch(editorStore);
|
|
67
|
+
const [isAnimated, setIsAnimated] = useState(false);
|
|
68
|
+
const isLoading = useRef(true);
|
|
66
69
|
useEffect(() => {
|
|
67
|
-
if (
|
|
68
|
-
|
|
70
|
+
if (!isLoading.current) {
|
|
71
|
+
setIsAnimated(true);
|
|
69
72
|
}
|
|
70
|
-
|
|
71
|
-
}, [
|
|
73
|
+
isLoading.current = false;
|
|
74
|
+
}, [isEditingPage]);
|
|
72
75
|
if (!hasResolved) {
|
|
73
76
|
return null;
|
|
74
77
|
}
|
|
@@ -77,14 +80,16 @@ function PageDocumentActions() {
|
|
|
77
80
|
className: "edit-site-document-actions"
|
|
78
81
|
}, __('Document not found'));
|
|
79
82
|
}
|
|
80
|
-
return
|
|
83
|
+
return isEditingPage ? createElement(BaseDocumentActions, {
|
|
81
84
|
className: classnames('is-page', {
|
|
82
|
-
'is-animated':
|
|
85
|
+
'is-animated': isAnimated
|
|
83
86
|
}),
|
|
84
87
|
icon: pageIcon
|
|
85
88
|
}, title) : createElement(TemplateDocumentActions, {
|
|
86
|
-
className:
|
|
87
|
-
|
|
89
|
+
className: classnames({
|
|
90
|
+
'is-animated': isAnimated
|
|
91
|
+
}),
|
|
92
|
+
onBack: () => setRenderingMode('template-locked')
|
|
88
93
|
});
|
|
89
94
|
}
|
|
90
95
|
function TemplateDocumentActions({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","__","isRTL","useSelect","useDispatch","Button","VisuallyHidden","__experimentalText","Text","__experimentalHStack","HStack","BlockIcon","store","commandsStore","chevronLeftSmall","chevronRightSmall","page","pageIcon","navigation","navigationIcon","symbol","displayShortcut","useState","useEffect","useRef","coreStore","useEditedEntityRecord","editSiteStore","TEMPLATE_POST_TYPE","NAVIGATION_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_TYPES","PATTERN_SYNC_TYPES","typeLabels","user","DocumentActions","isPage","select","createElement","PageDocumentActions","TemplateDocumentActions","hasPageContentFocus","hasResolved","isFound","title","_hasPageContentFocus","getEditedPostContext","getEditedEntityRecord","hasFinishedResolution","context","queryArgs","postType","postId","setHasPageContentFocus","hasEditedTemplate","setHasEditedTemplate","prevHasPageContentFocus","current","className","BaseDocumentActions","icon","onBack","_typeLabels$record$ty","isLoaded","record","getTitle","typeIcon","type","wp_pattern_sync_status","unsynced","as","children","open","openCommandCenter","onClick","event","stopPropagation","spacing","justify","size","primary"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-actions/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { store as commandsStore } from '@wordpress/commands';\nimport {\n\tchevronLeftSmall,\n\tchevronRightSmall,\n\tpage as pageIcon,\n\tnavigation as navigationIcon,\n\tsymbol,\n} from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport { store as editSiteStore } from '../../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_TYPES,\n\tPATTERN_SYNC_TYPES,\n} from '../../../utils/constants';\n\nconst typeLabels = {\n\t[ PATTERN_TYPES.user ]: __( 'Editing pattern:' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Editing navigation menu:' ),\n\t[ TEMPLATE_POST_TYPE ]: __( 'Editing template:' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Editing template part:' ),\n};\n\nexport default function DocumentActions() {\n\tconst isPage = useSelect(\n\t\t( select ) => select( editSiteStore ).isPage(),\n\t\t[]\n\t);\n\treturn isPage ? <PageDocumentActions /> : <TemplateDocumentActions />;\n}\n\nfunction PageDocumentActions() {\n\tconst { hasPageContentFocus, hasResolved, isFound, title } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus,\n\t\t\t\tgetEditedPostContext,\n\t\t\t} = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\tisFound: !! page,\n\t\t\t\ttitle: page?.title,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tconst [ hasEditedTemplate, setHasEditedTemplate ] = useState( false );\n\tconst prevHasPageContentFocus = useRef( false );\n\tuseEffect( () => {\n\t\tif ( prevHasPageContentFocus.current && ! hasPageContentFocus ) {\n\t\t\tsetHasEditedTemplate( true );\n\t\t}\n\t\tprevHasPageContentFocus.current = hasPageContentFocus;\n\t}, [ hasPageContentFocus ] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\tif ( ! isFound ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn hasPageContentFocus ? (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( 'is-page', {\n\t\t\t\t'is-animated': hasEditedTemplate,\n\t\t\t} ) }\n\t\t\ticon={ pageIcon }\n\t\t>\n\t\t\t{ title }\n\t\t</BaseDocumentActions>\n\t) : (\n\t\t<TemplateDocumentActions\n\t\t\tclassName=\"is-animated\"\n\t\t\tonBack={ () => setHasPageContentFocus( true ) }\n\t\t/>\n\t);\n}\n\nfunction TemplateDocumentActions( { className, onBack } ) {\n\tconst { isLoaded, record, getTitle, icon } = useEditedEntityRecord();\n\n\tif ( ! isLoaded ) {\n\t\treturn null;\n\t}\n\n\tif ( ! record ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet typeIcon = icon;\n\tif ( record.type === NAVIGATION_POST_TYPE ) {\n\t\ttypeIcon = navigationIcon;\n\t} else if ( record.type === PATTERN_TYPES.user ) {\n\t\ttypeIcon = symbol;\n\t}\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( className, {\n\t\t\t\t'is-synced-entity':\n\t\t\t\t\trecord.wp_pattern_sync_status !==\n\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced,\n\t\t\t} ) }\n\t\t\ticon={ typeIcon }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t{ typeLabels[ record.type ] ??\n\t\t\t\t\ttypeLabels[ TEMPLATE_POST_TYPE ] }\n\t\t\t</VisuallyHidden>\n\t\t\t{ getTitle() }\n\t\t</BaseDocumentActions>\n\t);\n}\n\nfunction BaseDocumentActions( { className, icon, children, onBack } ) {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', className ) }\n\t\t>\n\t\t\t{ onBack && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-document-actions__back\"\n\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonBack();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-document-actions__command\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t\t<span className=\"edit-site-document-actions__shortcut\">\n\t\t\t\t\t{ displayShortcut.primary( 'k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I,EAAGA;EAAM,CAAE,CAAC,EAC3BtB,aAAA,CAAC9B,IAAI;IAACuE,IAAI,EAAC,MAAM;IAACT,EAAE,EAAC;EAAI,GACtBC,QACG,CACC,CAAC,EACTjC,aAAA;IAAMoB,SAAS,EAAC;EAAsC,GACnDrC,eAAe,CAAC2D,OAAO,CAAE,GAAI,CAC1B,CACC,CACJ,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["classnames","__","isRTL","useSelect","useDispatch","Button","VisuallyHidden","__experimentalText","Text","__experimentalHStack","HStack","BlockIcon","store","commandsStore","chevronLeftSmall","chevronRightSmall","page","pageIcon","navigation","navigationIcon","symbol","displayShortcut","coreStore","editorStore","useRef","useState","useEffect","useEditedEntityRecord","editSiteStore","TEMPLATE_POST_TYPE","NAVIGATION_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_TYPES","PATTERN_SYNC_TYPES","typeLabels","user","DocumentActions","isPage","select","createElement","PageDocumentActions","TemplateDocumentActions","isEditingPage","hasResolved","isFound","title","getEditedPostContext","getEditedEntityRecord","hasFinishedResolution","getRenderingMode","context","queryArgs","postType","postId","setRenderingMode","isAnimated","setIsAnimated","isLoading","current","className","BaseDocumentActions","icon","onBack","_typeLabels$record$ty","isLoaded","record","getTitle","typeIcon","type","wp_pattern_sync_status","unsynced","as","children","open","openCommandCenter","onClick","event","stopPropagation","spacing","justify","size","primary"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-actions/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { store as commandsStore } from '@wordpress/commands';\nimport {\n\tchevronLeftSmall,\n\tchevronRightSmall,\n\tpage as pageIcon,\n\tnavigation as navigationIcon,\n\tsymbol,\n} from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useRef, useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport { store as editSiteStore } from '../../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_TYPES,\n\tPATTERN_SYNC_TYPES,\n} from '../../../utils/constants';\n\nconst typeLabels = {\n\t[ PATTERN_TYPES.user ]: __( 'Editing pattern:' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Editing navigation menu:' ),\n\t[ TEMPLATE_POST_TYPE ]: __( 'Editing template:' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Editing template part:' ),\n};\n\nexport default function DocumentActions() {\n\tconst isPage = useSelect(\n\t\t( select ) => select( editSiteStore ).isPage(),\n\t\t[]\n\t);\n\treturn isPage ? <PageDocumentActions /> : <TemplateDocumentActions />;\n}\n\nfunction PageDocumentActions() {\n\tconst { isEditingPage, hasResolved, isFound, title } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostContext } = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getRenderingMode } = select( editorStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\tisEditingPage:\n\t\t\t\t\t!! context.postId && getRenderingMode() !== 'template-only',\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\tisFound: !! page,\n\t\t\t\ttitle: page?.title,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\tconst [ isAnimated, setIsAnimated ] = useState( false );\n\tconst isLoading = useRef( true );\n\n\tuseEffect( () => {\n\t\tif ( ! isLoading.current ) {\n\t\t\tsetIsAnimated( true );\n\t\t}\n\t\tisLoading.current = false;\n\t}, [ isEditingPage ] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\tif ( ! isFound ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn isEditingPage ? (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( 'is-page', {\n\t\t\t\t'is-animated': isAnimated,\n\t\t\t} ) }\n\t\t\ticon={ pageIcon }\n\t\t>\n\t\t\t{ title }\n\t\t</BaseDocumentActions>\n\t) : (\n\t\t<TemplateDocumentActions\n\t\t\tclassName={ classnames( {\n\t\t\t\t'is-animated': isAnimated,\n\t\t\t} ) }\n\t\t\tonBack={ () => setRenderingMode( 'template-locked' ) }\n\t\t/>\n\t);\n}\n\nfunction TemplateDocumentActions( { className, onBack } ) {\n\tconst { isLoaded, record, getTitle, icon } = useEditedEntityRecord();\n\n\tif ( ! isLoaded ) {\n\t\treturn null;\n\t}\n\n\tif ( ! record ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet typeIcon = icon;\n\tif ( record.type === NAVIGATION_POST_TYPE ) {\n\t\ttypeIcon = navigationIcon;\n\t} else if ( record.type === PATTERN_TYPES.user ) {\n\t\ttypeIcon = symbol;\n\t}\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( className, {\n\t\t\t\t'is-synced-entity':\n\t\t\t\t\trecord.wp_pattern_sync_status !==\n\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced,\n\t\t\t} ) }\n\t\t\ticon={ typeIcon }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t{ typeLabels[ record.type ] ??\n\t\t\t\t\ttypeLabels[ TEMPLATE_POST_TYPE ] }\n\t\t\t</VisuallyHidden>\n\t\t\t{ getTitle() }\n\t\t</BaseDocumentActions>\n\t);\n}\n\nfunction BaseDocumentActions( { className, icon, children, onBack } ) {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', className ) }\n\t\t>\n\t\t\t{ onBack && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-document-actions__back\"\n\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonBack();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-document-actions__command\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t\t<span className=\"edit-site-document-actions__shortcut\">\n\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,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IAAI,EAAGA;EAAM,CAAE,CAAC,EAC3BtB,aAAA,CAAC/B,IAAI;IAACwE,IAAI,EAAC,MAAM;IAACT,EAAE,EAAC;EAAI,GACtBC,QACG,CACC,CAAC,EACTjC,aAAA;IAAMoB,SAAS,EAAC;EAAsC,GACnDtC,eAAe,CAAC4D,OAAO,CAAE,GAAI,CAC1B,CACC,CACJ,CAAC;AAER"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback, useRef } from '@wordpress/element';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
7
|
+
import { ToolSelector, NavigableToolbar, store as blockEditorStore, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
|
+
import { _x, __ } from '@wordpress/i18n';
|
|
10
|
+
import { listView, plus, chevronUpDown } from '@wordpress/icons';
|
|
11
|
+
import { Button, ToolbarItem } from '@wordpress/components';
|
|
12
|
+
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
import UndoButton from '../undo-redo/undo';
|
|
18
|
+
import RedoButton from '../undo-redo/redo';
|
|
19
|
+
import { store as editSiteStore } from '../../../store';
|
|
20
|
+
import { unlock } from '../../../lock-unlock';
|
|
21
|
+
const {
|
|
22
|
+
useShouldContextualToolbarShow
|
|
23
|
+
} = unlock(blockEditorPrivateApis);
|
|
24
|
+
const preventDefault = event => {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
};
|
|
27
|
+
export default function DocumentTools({
|
|
28
|
+
blockEditorMode,
|
|
29
|
+
hasFixedToolbar,
|
|
30
|
+
isDistractionFree,
|
|
31
|
+
showIconLabels,
|
|
32
|
+
setListViewToggleElement
|
|
33
|
+
}) {
|
|
34
|
+
const inserterButton = useRef();
|
|
35
|
+
const {
|
|
36
|
+
isInserterOpen,
|
|
37
|
+
isListViewOpen,
|
|
38
|
+
listViewShortcut,
|
|
39
|
+
isVisualMode
|
|
40
|
+
} = useSelect(select => {
|
|
41
|
+
const {
|
|
42
|
+
__experimentalGetPreviewDeviceType,
|
|
43
|
+
isInserterOpened,
|
|
44
|
+
isListViewOpened,
|
|
45
|
+
getEditorMode
|
|
46
|
+
} = select(editSiteStore);
|
|
47
|
+
const {
|
|
48
|
+
getShortcutRepresentation
|
|
49
|
+
} = select(keyboardShortcutsStore);
|
|
50
|
+
return {
|
|
51
|
+
deviceType: __experimentalGetPreviewDeviceType(),
|
|
52
|
+
isInserterOpen: isInserterOpened(),
|
|
53
|
+
isListViewOpen: isListViewOpened(),
|
|
54
|
+
listViewShortcut: getShortcutRepresentation('core/edit-site/toggle-list-view'),
|
|
55
|
+
isVisualMode: getEditorMode() === 'visual'
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
const {
|
|
59
|
+
__experimentalSetPreviewDeviceType: setPreviewDeviceType,
|
|
60
|
+
setIsInserterOpened,
|
|
61
|
+
setIsListViewOpened
|
|
62
|
+
} = useDispatch(editSiteStore);
|
|
63
|
+
const {
|
|
64
|
+
__unstableSetEditorMode
|
|
65
|
+
} = useDispatch(blockEditorStore);
|
|
66
|
+
const isLargeViewport = useViewportMatch('medium');
|
|
67
|
+
const toggleInserter = useCallback(() => {
|
|
68
|
+
if (isInserterOpen) {
|
|
69
|
+
// Focusing the inserter button should close the inserter popover.
|
|
70
|
+
// However, there are some cases it won't close when the focus is lost.
|
|
71
|
+
// See https://github.com/WordPress/gutenberg/issues/43090 for more details.
|
|
72
|
+
inserterButton.current.focus();
|
|
73
|
+
setIsInserterOpened(false);
|
|
74
|
+
} else {
|
|
75
|
+
setIsInserterOpened(true);
|
|
76
|
+
}
|
|
77
|
+
}, [isInserterOpen, setIsInserterOpened]);
|
|
78
|
+
const toggleListView = useCallback(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
|
|
79
|
+
const {
|
|
80
|
+
shouldShowContextualToolbar,
|
|
81
|
+
canFocusHiddenToolbar,
|
|
82
|
+
fixedToolbarCanBeFocused
|
|
83
|
+
} = useShouldContextualToolbarShow();
|
|
84
|
+
// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
|
|
85
|
+
// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.
|
|
86
|
+
const blockToolbarCanBeFocused = shouldShowContextualToolbar || canFocusHiddenToolbar || fixedToolbarCanBeFocused;
|
|
87
|
+
|
|
88
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
89
|
+
const longLabel = _x('Toggle block inserter', 'Generic label for block inserter button');
|
|
90
|
+
const shortLabel = !isInserterOpen ? __('Add') : __('Close');
|
|
91
|
+
const isZoomedOutViewExperimentEnabled = window?.__experimentalEnableZoomedOutView && isVisualMode;
|
|
92
|
+
const isZoomedOutView = blockEditorMode === 'zoom-out';
|
|
93
|
+
return createElement(NavigableToolbar, {
|
|
94
|
+
className: "edit-site-header-edit-mode__document-tools",
|
|
95
|
+
"aria-label": __('Document tools'),
|
|
96
|
+
shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused
|
|
97
|
+
}, createElement("div", {
|
|
98
|
+
className: "edit-site-header-edit-mode__toolbar"
|
|
99
|
+
}, !isDistractionFree && createElement(ToolbarItem, {
|
|
100
|
+
ref: inserterButton,
|
|
101
|
+
as: Button,
|
|
102
|
+
className: "edit-site-header-edit-mode__inserter-toggle",
|
|
103
|
+
variant: "primary",
|
|
104
|
+
isPressed: isInserterOpen,
|
|
105
|
+
onMouseDown: preventDefault,
|
|
106
|
+
onClick: toggleInserter,
|
|
107
|
+
disabled: !isVisualMode,
|
|
108
|
+
icon: plus,
|
|
109
|
+
label: showIconLabels ? shortLabel : longLabel,
|
|
110
|
+
showTooltip: !showIconLabels,
|
|
111
|
+
"aria-expanded": isInserterOpen
|
|
112
|
+
}), isLargeViewport && createElement(Fragment, null, !hasFixedToolbar && createElement(ToolbarItem, {
|
|
113
|
+
as: ToolSelector,
|
|
114
|
+
showTooltip: !showIconLabels,
|
|
115
|
+
variant: showIconLabels ? 'tertiary' : undefined,
|
|
116
|
+
disabled: !isVisualMode
|
|
117
|
+
}), createElement(ToolbarItem, {
|
|
118
|
+
as: UndoButton,
|
|
119
|
+
showTooltip: !showIconLabels,
|
|
120
|
+
variant: showIconLabels ? 'tertiary' : undefined
|
|
121
|
+
}), createElement(ToolbarItem, {
|
|
122
|
+
as: RedoButton,
|
|
123
|
+
showTooltip: !showIconLabels,
|
|
124
|
+
variant: showIconLabels ? 'tertiary' : undefined
|
|
125
|
+
}), !isDistractionFree && createElement(ToolbarItem, {
|
|
126
|
+
as: Button,
|
|
127
|
+
className: "edit-site-header-edit-mode__list-view-toggle",
|
|
128
|
+
disabled: !isVisualMode || isZoomedOutView,
|
|
129
|
+
icon: listView,
|
|
130
|
+
isPressed: isListViewOpen
|
|
131
|
+
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
132
|
+
label: __('List View'),
|
|
133
|
+
onClick: toggleListView,
|
|
134
|
+
ref: setListViewToggleElement,
|
|
135
|
+
shortcut: listViewShortcut,
|
|
136
|
+
showTooltip: !showIconLabels,
|
|
137
|
+
variant: showIconLabels ? 'tertiary' : undefined,
|
|
138
|
+
"aria-expanded": isListViewOpen
|
|
139
|
+
}), isZoomedOutViewExperimentEnabled && !isDistractionFree && !hasFixedToolbar && createElement(ToolbarItem, {
|
|
140
|
+
as: Button,
|
|
141
|
+
className: "edit-site-header-edit-mode__zoom-out-view-toggle",
|
|
142
|
+
icon: chevronUpDown,
|
|
143
|
+
isPressed: isZoomedOutView
|
|
144
|
+
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
145
|
+
label: __('Zoom-out View'),
|
|
146
|
+
onClick: () => {
|
|
147
|
+
setPreviewDeviceType('Desktop');
|
|
148
|
+
__unstableSetEditorMode(isZoomedOutView ? 'edit' : 'zoom-out');
|
|
149
|
+
}
|
|
150
|
+
}))));
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useRef","useViewportMatch","ToolSelector","NavigableToolbar","store","blockEditorStore","privateApis","blockEditorPrivateApis","useSelect","useDispatch","_x","__","listView","plus","chevronUpDown","Button","ToolbarItem","keyboardShortcutsStore","UndoButton","RedoButton","editSiteStore","unlock","useShouldContextualToolbarShow","preventDefault","event","DocumentTools","blockEditorMode","hasFixedToolbar","isDistractionFree","showIconLabels","setListViewToggleElement","inserterButton","isInserterOpen","isListViewOpen","listViewShortcut","isVisualMode","select","__experimentalGetPreviewDeviceType","isInserterOpened","isListViewOpened","getEditorMode","getShortcutRepresentation","deviceType","__experimentalSetPreviewDeviceType","setPreviewDeviceType","setIsInserterOpened","setIsListViewOpened","__unstableSetEditorMode","isLargeViewport","toggleInserter","current","focus","toggleListView","shouldShowContextualToolbar","canFocusHiddenToolbar","fixedToolbarCanBeFocused","blockToolbarCanBeFocused","longLabel","shortLabel","isZoomedOutViewExperimentEnabled","window","__experimentalEnableZoomedOutView","isZoomedOutView","createElement","className","shouldUseKeyboardFocusShortcut","ref","as","variant","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","Fragment","undefined","shortcut"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tToolSelector,\n\tNavigableToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { _x, __ } from '@wordpress/i18n';\nimport { listView, plus, chevronUpDown } from '@wordpress/icons';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport UndoButton from '../undo-redo/undo';\nimport RedoButton from '../undo-redo/redo';\nimport { store as editSiteStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nconst { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nexport default function DocumentTools( {\n\tblockEditorMode,\n\thasFixedToolbar,\n\tisDistractionFree,\n\tshowIconLabels,\n\tsetListViewToggleElement,\n} ) {\n\tconst inserterButton = useRef();\n\tconst { isInserterOpen, isListViewOpen, listViewShortcut, isVisualMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\t\tisInserterOpened,\n\t\t\t\tisListViewOpened,\n\t\t\t\tgetEditorMode,\n\t\t\t} = select( editSiteStore );\n\t\t\tconst { getShortcutRepresentation } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t\t'core/edit-site/toggle-list-view'\n\t\t\t\t),\n\t\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\t};\n\t\t}, [] );\n\n\tconst {\n\t\t__experimentalSetPreviewDeviceType: setPreviewDeviceType,\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editSiteStore );\n\tconst { __unstableSetEditorMode } = useDispatch( blockEditorStore );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpen ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpen, setIsInserterOpened ] );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst {\n\t\tshouldShowContextualToolbar,\n\t\tcanFocusHiddenToolbar,\n\t\tfixedToolbarCanBeFocused,\n\t} = useShouldContextualToolbarShow();\n\t// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.\n\t// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.\n\tconst blockToolbarCanBeFocused =\n\t\tshouldShowContextualToolbar ||\n\t\tcanFocusHiddenToolbar ||\n\t\tfixedToolbarCanBeFocused;\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpen ? __( 'Add' ) : __( 'Close' );\n\n\tconst isZoomedOutViewExperimentEnabled =\n\t\twindow?.__experimentalEnableZoomedOutView && isVisualMode;\n\tconst isZoomedOutView = blockEditorMode === 'zoom-out';\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-site-header-edit-mode__document-tools\"\n\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }\n\t\t>\n\t\t\t<div className=\"edit-site-header-edit-mode__toolbar\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ ! isVisualMode }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpen }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ ! isVisualMode }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ UndoButton }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ RedoButton }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__list-view-toggle\"\n\t\t\t\t\t\t\t\tdisabled={ ! isVisualMode || isZoomedOutView }\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tref={ setListViewToggleElement }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isZoomedOutViewExperimentEnabled &&\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\t! hasFixedToolbar && (\n\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__zoom-out-view-toggle\"\n\t\t\t\t\t\t\t\t\ticon={ chevronUpDown }\n\t\t\t\t\t\t\t\t\tisPressed={ isZoomedOutView }\n\t\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Zoom-out View' ) }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetPreviewDeviceType( 'Desktop' );\n\t\t\t\t\t\t\t\t\t\t__unstableSetEditorMode(\n\t\t\t\t\t\t\t\t\t\t\tisZoomedOutView\n\t\t\t\t\t\t\t\t\t\t\t\t? 'edit'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'zoom-out'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableTo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