@wordpress/edit-site 5.34.0 → 5.35.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 +9 -3
- package/build/components/add-new-template/index.js +2 -2
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/app/index.js +4 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +4 -18
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +2 -2
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/dataviews-actions/index.js +46 -0
- package/build/components/dataviews-actions/index.js.map +1 -0
- package/build/components/editor/index.js +68 -12
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +13 -1
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +5 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +1 -2
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +5 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +2 -2
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +29 -0
- package/build/components/global-styles/preset-colors.js.map +1 -0
- package/build/components/global-styles/preview-colors.js +3 -7
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +5 -5
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +1 -4
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/typography-example.js +5 -2
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/ui.js +4 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +12 -6
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +5 -5
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
- package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -0
- package/build/components/header-edit-mode/index.js +20 -120
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/layout/index.js +3 -6
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +69 -14
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page/index.js +2 -2
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +4 -15
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +4 -80
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/index.js +9 -20
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/index.js +6 -14
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +2 -2
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +11 -3
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +5 -2
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +4 -4
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +61 -31
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -2
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +5 -3
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +6 -32
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +2 -2
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +4 -9
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -14
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +4 -1
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +3 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +2 -2
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/style-book/index.js +10 -7
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/template-part-converter/index.js +18 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -2
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/use-activate-theme.js +9 -6
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-template/index.js +2 -2
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/app/index.js +4 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +4 -18
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +2 -2
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +38 -0
- package/build-module/components/dataviews-actions/index.js.map +1 -0
- package/build-module/components/editor/index.js +69 -13
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +12 -1
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +4 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +4 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +2 -2
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +22 -0
- package/build-module/components/global-styles/preset-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-colors.js +3 -7
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +5 -5
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -4
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js +4 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +11 -5
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +6 -6
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
- package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +20 -120
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/layout/index.js +3 -6
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +69 -15
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page/index.js +2 -2
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +4 -15
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +4 -80
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/index.js +10 -21
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +6 -14
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +2 -2
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +12 -4
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +4 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +4 -4
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +62 -32
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +2 -2
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +5 -3
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +6 -32
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -2
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +4 -9
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -14
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +3 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +2 -2
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/style-book/index.js +9 -6
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +18 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +4 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +9 -6
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +144 -374
- package/build-style/style.css +144 -374
- package/package.json +43 -45
- package/src/components/add-new-template/index.js +2 -2
- package/src/components/app/index.js +5 -2
- package/src/components/block-editor/editor-canvas.js +6 -26
- package/src/components/block-editor/site-editor-canvas.js +2 -2
- package/src/components/block-editor/style.scss +2 -2
- package/src/components/dataviews-actions/index.js +38 -0
- package/src/components/editor/index.js +76 -16
- package/src/components/editor/style.scss +0 -4
- package/src/components/global-styles/background-panel.js +17 -2
- package/src/components/global-styles/color-indicator-wrapper.js +2 -2
- package/src/components/global-styles/color-palette-panel.js +3 -4
- package/src/components/global-styles/gradients-palette-panel.js +1 -4
- package/src/components/global-styles/hooks.js +2 -1
- package/src/components/global-styles/icon-with-current-color.js +2 -2
- package/src/components/global-styles/preset-colors.js +18 -0
- package/src/components/global-styles/preview-colors.js +4 -7
- package/src/components/global-styles/screen-color-palette.js +4 -4
- package/src/components/global-styles/screen-colors.js +0 -2
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/src/components/global-styles/stories/index.story.js +2 -1
- package/src/components/global-styles/typography-example.js +2 -1
- package/src/components/global-styles/ui.js +5 -1
- package/src/components/global-styles/variations/style.scss +15 -31
- package/src/components/global-styles/variations/variation.js +13 -10
- package/src/components/global-styles/variations/variations-color.js +5 -8
- package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
- package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
- package/src/components/header-edit-mode/index.js +25 -164
- package/src/components/header-edit-mode/style.scss +1 -199
- package/src/components/layout/index.js +3 -8
- package/src/components/layout/router.js +65 -15
- package/src/components/layout/style.scss +2 -1
- package/src/components/page/index.js +2 -2
- package/src/components/page-pages/index.js +8 -38
- package/src/components/page-pages/style.scss +0 -11
- package/src/components/page-patterns/dataviews-pattern-actions.js +3 -92
- package/src/components/page-patterns/index.js +16 -35
- package/src/components/page-templates/index.js +10 -29
- package/src/components/pagination/index.js +2 -2
- package/src/components/resizable-frame/index.js +16 -4
- package/src/components/revisions/index.js +2 -1
- package/src/components/save-panel/index.js +4 -4
- package/src/components/sidebar/index.js +61 -37
- package/src/components/sidebar-button/index.js +2 -5
- package/src/components/sidebar-dataviews/dataview-item.js +4 -7
- package/src/components/sidebar-navigation-item/index.js +3 -3
- package/src/components/sidebar-navigation-screen/index.js +7 -31
- package/src/components/sidebar-navigation-screen/style.scss +11 -9
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +0 -10
- package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +2 -8
- package/src/components/sidebar-navigation-screen-patterns/index.js +2 -13
- package/src/components/sidebar-navigation-screen-template/index.js +2 -1
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
- package/src/components/site-hub/index.js +3 -3
- package/src/components/site-icon/index.js +2 -2
- package/src/components/style-book/index.js +7 -6
- package/src/components/template-part-converter/index.js +16 -3
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/src/style.scss +1 -11
- package/src/utils/get-is-list-page.js +1 -3
- package/src/utils/use-activate-theme.js +4 -4
- package/build/components/global-styles/global-styles-provider.js +0 -129
- package/build/components/global-styles/global-styles-provider.js.map +0 -1
- package/build/components/header-edit-mode/document-tools/index.js +0 -68
- package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/index.js +0 -147
- package/build/components/sidebar-edit-mode/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +0 -129
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -46
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +0 -127
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
- package/build/components/start-template-options/index.js +0 -191
- package/build/components/start-template-options/index.js.map +0 -1
- package/build/utils/math.js +0 -98
- package/build/utils/math.js.map +0 -1
- package/build-module/components/global-styles/global-styles-provider.js +0 -120
- package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
- package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/index.js +0 -138
- package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -121
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -119
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
- package/build-module/components/start-template-options/index.js +0 -184
- package/build-module/components/start-template-options/index.js.map +0 -1
- package/build-module/utils/math.js +0 -92
- package/build-module/utils/math.js.map +0 -1
- package/src/components/global-styles/global-styles-provider.js +0 -162
- package/src/components/header-edit-mode/document-tools/index.js +0 -68
- package/src/components/sidebar-edit-mode/index.js +0 -173
- package/src/components/sidebar-edit-mode/page-panels/index.js +0 -133
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -61
- package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
- package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
- package/src/components/sidebar-edit-mode/template-panel/index.js +0 -134
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
- package/src/components/start-template-options/index.js +0 -231
- package/src/components/start-template-options/style.scss +0 -55
- package/src/utils/math.js +0 -93
- /package/build/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
- /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
- /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import
|
|
12
|
+
import PresetColors from './preset-colors';
|
|
13
13
|
import PreviewIframe from './preview-iframe';
|
|
14
14
|
|
|
15
15
|
const firstFrameVariants = {
|
|
@@ -30,7 +30,7 @@ const StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {
|
|
|
30
30
|
isFocused={ isFocused }
|
|
31
31
|
withHoverView={ withHoverView }
|
|
32
32
|
>
|
|
33
|
-
{ ( {
|
|
33
|
+
{ ( { key } ) => (
|
|
34
34
|
<motion.div
|
|
35
35
|
key={ key }
|
|
36
36
|
variants={ firstFrameVariants }
|
|
@@ -40,17 +40,14 @@ const StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {
|
|
|
40
40
|
} }
|
|
41
41
|
>
|
|
42
42
|
<HStack
|
|
43
|
-
spacing={
|
|
43
|
+
spacing={ 0 }
|
|
44
44
|
justify="center"
|
|
45
45
|
style={ {
|
|
46
46
|
height: '100%',
|
|
47
47
|
overflow: 'hidden',
|
|
48
48
|
} }
|
|
49
49
|
>
|
|
50
|
-
<
|
|
51
|
-
normalizedColorSwatchSize={ 56 }
|
|
52
|
-
ratio={ ratio }
|
|
53
|
-
/>
|
|
50
|
+
<PresetColors />
|
|
54
51
|
</HStack>
|
|
55
52
|
</motion.div>
|
|
56
53
|
) }
|
|
@@ -18,17 +18,17 @@ function ScreenColorPalette( { name } ) {
|
|
|
18
18
|
return (
|
|
19
19
|
<>
|
|
20
20
|
<ScreenHeader
|
|
21
|
-
title={ __( '
|
|
21
|
+
title={ __( 'Edit palette' ) }
|
|
22
22
|
description={ __(
|
|
23
|
-
'
|
|
23
|
+
'The combination of colors used across the site and in color pickers.'
|
|
24
24
|
) }
|
|
25
25
|
/>
|
|
26
26
|
<Tabs>
|
|
27
27
|
<Tabs.TabList>
|
|
28
|
-
<Tabs.Tab tabId="
|
|
28
|
+
<Tabs.Tab tabId="color">{ __( 'Color' ) }</Tabs.Tab>
|
|
29
29
|
<Tabs.Tab tabId="gradient">{ __( 'Gradient' ) }</Tabs.Tab>
|
|
30
30
|
</Tabs.TabList>
|
|
31
|
-
<Tabs.TabPanel tabId="
|
|
31
|
+
<Tabs.TabPanel tabId="color" focusable={ false }>
|
|
32
32
|
<ColorPalettePanel name={ name } />
|
|
33
33
|
</Tabs.TabPanel>
|
|
34
34
|
<Tabs.TabPanel tabId="gradient" focusable={ false }>
|
|
@@ -11,7 +11,6 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
11
11
|
import ScreenHeader from './header';
|
|
12
12
|
import Palette from './palette';
|
|
13
13
|
import { unlock } from '../../lock-unlock';
|
|
14
|
-
import ColorVariations from './variations/variations-color';
|
|
15
14
|
|
|
16
15
|
const {
|
|
17
16
|
useGlobalStyle,
|
|
@@ -40,7 +39,6 @@ function ScreenColors() {
|
|
|
40
39
|
/>
|
|
41
40
|
<div className="edit-site-global-styles-screen">
|
|
42
41
|
<VStack spacing={ 7 }>
|
|
43
|
-
<ColorVariations title={ __( 'Presets' ) } />
|
|
44
42
|
<Palette />
|
|
45
43
|
<StylesColorPanel
|
|
46
44
|
inheritedValue={ inheritedStyle }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -150,7 +150,7 @@ function RevisionsButtons( {
|
|
|
150
150
|
|
|
151
151
|
return (
|
|
152
152
|
<li
|
|
153
|
-
className={
|
|
153
|
+
className={ clsx(
|
|
154
154
|
'edit-site-global-styles-screen-revisions__revision-item',
|
|
155
155
|
{
|
|
156
156
|
'is-selected': isSelected,
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
5
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
5
6
|
import { useMemo, useState } from '@wordpress/element';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
9
10
|
*/
|
|
10
|
-
import { mergeBaseAndUserConfigs } from '../global-styles-provider';
|
|
11
11
|
import { default as GlobalStylesUIComponent } from '../ui';
|
|
12
12
|
import { unlock } from '../../../lock-unlock';
|
|
13
13
|
|
|
14
|
+
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
14
15
|
const { GlobalStylesContext, ExperimentalBlockEditorProvider } = unlock(
|
|
15
16
|
blockEditorPrivateApis
|
|
16
17
|
);
|
|
@@ -5,16 +5,17 @@ import { useContext } from '@wordpress/element';
|
|
|
5
5
|
import { __unstableMotion as motion } from '@wordpress/components';
|
|
6
6
|
import { _x } from '@wordpress/i18n';
|
|
7
7
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
11
12
|
*/
|
|
12
|
-
import { mergeBaseAndUserConfigs } from './global-styles-provider';
|
|
13
13
|
import { unlock } from '../../lock-unlock';
|
|
14
14
|
import { getFamilyPreviewStyle } from './font-library-modal/utils/preview-styles';
|
|
15
15
|
import { getFontFamilies } from './utils';
|
|
16
16
|
|
|
17
17
|
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
|
18
|
+
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
18
19
|
|
|
19
20
|
export default function PreviewTypography( { fontSize, variation } ) {
|
|
20
21
|
const { base } = useContext( GlobalStylesContext );
|
|
@@ -76,7 +76,11 @@ function GlobalStylesActionMenu() {
|
|
|
76
76
|
|
|
77
77
|
return (
|
|
78
78
|
<GlobalStylesMenuFill>
|
|
79
|
-
<DropdownMenu
|
|
79
|
+
<DropdownMenu
|
|
80
|
+
icon={ moreVertical }
|
|
81
|
+
label={ __( 'More' ) }
|
|
82
|
+
toggleProps={ { size: 'compact' } }
|
|
83
|
+
>
|
|
80
84
|
{ ( { onClose } ) => (
|
|
81
85
|
<>
|
|
82
86
|
<MenuGroup>
|
|
@@ -6,48 +6,32 @@
|
|
|
6
6
|
|
|
7
7
|
.edit-site-global-styles-variations_item-preview {
|
|
8
8
|
border-radius: $radius-block-ui;
|
|
9
|
-
|
|
10
|
-
outline:
|
|
9
|
+
outline: $border-width solid rgba($black, 0.15);
|
|
10
|
+
outline-offset: -$border-width;
|
|
11
11
|
position: relative;
|
|
12
12
|
// Add the same transition that block style variations and other buttons have.
|
|
13
|
-
transition:
|
|
13
|
+
transition: outline 0.1s linear;
|
|
14
14
|
@include reduce-motion("transition");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
left: -$border-width;
|
|
21
|
-
bottom: -$border-width;
|
|
22
|
-
right: -$border-width;
|
|
23
|
-
// Visually resembles the $radius-block-ui.
|
|
24
|
-
border-radius: $radius-block-ui + $border-width;
|
|
25
|
-
box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
|
|
26
|
-
// Show a thin outline in Windows high contrast mode, otherwise the button is invisible.
|
|
27
|
-
border: $border-width solid transparent;
|
|
28
|
-
box-sizing: inherit;
|
|
29
|
-
// Add the same transition that block style variations and other buttons have.
|
|
30
|
-
transition: box-shadow 0.1s linear;
|
|
31
|
-
@include reduce-motion("transition");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.edit-site-global-styles-color-variations & {
|
|
35
|
-
padding: $grid-unit-10;
|
|
16
|
+
&.is-pill {
|
|
17
|
+
height: $button-size-next-default-40px;
|
|
18
|
+
border-radius: 100px;
|
|
19
|
+
overflow: hidden;
|
|
36
20
|
}
|
|
37
21
|
}
|
|
38
22
|
|
|
39
|
-
&:not(.is-active):hover .edit-site-global-styles-variations_item-preview
|
|
40
|
-
|
|
23
|
+
&:not(.is-active):hover .edit-site-global-styles-variations_item-preview {
|
|
24
|
+
outline-color: rgba($black, 0.3);
|
|
41
25
|
}
|
|
42
26
|
|
|
43
27
|
&.is-active .edit-site-global-styles-variations_item-preview,
|
|
44
28
|
&:focus-visible .edit-site-global-styles-variations_item-preview {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
outline-width:
|
|
29
|
+
outline-color: $gray-900;
|
|
30
|
+
outline-offset: $border-width;
|
|
31
|
+
outline-width: var(--wp-admin-border-width-focus);
|
|
32
|
+
}
|
|
48
33
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
34
|
+
&:focus-visible .edit-site-global-styles-variations_item-preview {
|
|
35
|
+
outline-color: var(--wp-admin-theme-color);
|
|
52
36
|
}
|
|
53
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -10,18 +10,19 @@ import { useMemo, useContext, useState } from '@wordpress/element';
|
|
|
10
10
|
import { ENTER } from '@wordpress/keycodes';
|
|
11
11
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
12
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
13
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Internal dependencies
|
|
16
17
|
*/
|
|
17
|
-
import { mergeBaseAndUserConfigs } from '../global-styles-provider';
|
|
18
18
|
import { unlock } from '../../../lock-unlock';
|
|
19
19
|
|
|
20
|
+
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
20
21
|
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
|
|
21
22
|
blockEditorPrivateApis
|
|
22
23
|
);
|
|
23
24
|
|
|
24
|
-
export default function Variation( { variation, children } ) {
|
|
25
|
+
export default function Variation( { variation, children, isPill } ) {
|
|
25
26
|
const [ isFocused, setIsFocused ] = useState( false );
|
|
26
27
|
const { base, user, setUserConfig } = useContext( GlobalStylesContext );
|
|
27
28
|
const context = useMemo(
|
|
@@ -69,12 +70,9 @@ export default function Variation( { variation, children } ) {
|
|
|
69
70
|
return (
|
|
70
71
|
<GlobalStylesContext.Provider value={ context }>
|
|
71
72
|
<div
|
|
72
|
-
className={
|
|
73
|
-
'
|
|
74
|
-
|
|
75
|
-
'is-active': isActive,
|
|
76
|
-
}
|
|
77
|
-
) }
|
|
73
|
+
className={ clsx( 'edit-site-global-styles-variations_item', {
|
|
74
|
+
'is-active': isActive,
|
|
75
|
+
} ) }
|
|
78
76
|
role="button"
|
|
79
77
|
onClick={ selectVariation }
|
|
80
78
|
onKeyDown={ selectOnEnter }
|
|
@@ -84,7 +82,12 @@ export default function Variation( { variation, children } ) {
|
|
|
84
82
|
onFocus={ () => setIsFocused( true ) }
|
|
85
83
|
onBlur={ () => setIsFocused( false ) }
|
|
86
84
|
>
|
|
87
|
-
<div
|
|
85
|
+
<div
|
|
86
|
+
className={ clsx(
|
|
87
|
+
'edit-site-global-styles-variations_item-preview',
|
|
88
|
+
{ 'is-pill': isPill }
|
|
89
|
+
) }
|
|
90
|
+
>
|
|
88
91
|
{ children( isFocused ) }
|
|
89
92
|
</div>
|
|
90
93
|
</div>
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
__experimentalGrid as Grid,
|
|
6
|
-
__experimentalVStack as VStack,
|
|
7
|
-
} from '@wordpress/components';
|
|
4
|
+
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* Internal dependencies
|
|
11
8
|
*/
|
|
12
|
-
import Variation from './variation';
|
|
13
9
|
import StylesPreviewColors from '../preview-colors';
|
|
14
10
|
import { useColorVariations } from '../hooks';
|
|
15
11
|
import Subtitle from '../subtitle';
|
|
12
|
+
import Variation from './variation';
|
|
16
13
|
|
|
17
14
|
export default function ColorVariations( { title, gap = 2 } ) {
|
|
18
15
|
const colorVariations = useColorVariations();
|
|
@@ -24,13 +21,13 @@ export default function ColorVariations( { title, gap = 2 } ) {
|
|
|
24
21
|
return (
|
|
25
22
|
<VStack spacing={ 3 }>
|
|
26
23
|
{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }
|
|
27
|
-
<
|
|
24
|
+
<VStack spacing={ gap }>
|
|
28
25
|
{ colorVariations.map( ( variation, index ) => (
|
|
29
|
-
<Variation key={ index } variation={ variation }>
|
|
26
|
+
<Variation key={ index } variation={ variation } isPill>
|
|
30
27
|
{ () => <StylesPreviewColors /> }
|
|
31
28
|
</Variation>
|
|
32
29
|
) ) }
|
|
33
|
-
</
|
|
30
|
+
</VStack>
|
|
34
31
|
</VStack>
|
|
35
32
|
);
|
|
36
33
|
}
|
package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js}
RENAMED
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
/**
|
|
22
22
|
* Internal dependencies
|
|
23
23
|
*/
|
|
24
|
-
import DefaultSidebar from './default-sidebar';
|
|
25
24
|
import { GlobalStylesUI } from '../global-styles';
|
|
26
25
|
import { store as editSiteStore } from '../../store';
|
|
27
26
|
import { GlobalStylesMenuSlot } from '../global-styles/ui';
|
|
28
27
|
import { unlock } from '../../lock-unlock';
|
|
29
28
|
import { store as coreStore } from '@wordpress/core-data';
|
|
29
|
+
import DefaultSidebar from './default-sidebar';
|
|
30
30
|
|
|
31
31
|
const { interfaceStore } = unlock( editorPrivateApis );
|
|
32
32
|
|
|
@@ -136,7 +136,10 @@ export default function GlobalStylesSidebar() {
|
|
|
136
136
|
closeLabel={ __( 'Close Styles' ) }
|
|
137
137
|
panelClassName="edit-site-global-styles-sidebar__panel"
|
|
138
138
|
header={
|
|
139
|
-
<Flex
|
|
139
|
+
<Flex
|
|
140
|
+
className="edit-site-global-styles-sidebar__header"
|
|
141
|
+
gap={ 1 }
|
|
142
|
+
>
|
|
140
143
|
<FlexBlock style={ { minWidth: 'min-content' } }>
|
|
141
144
|
<h2 className="edit-site-global-styles-sidebar__header-title">
|
|
142
145
|
{ __( 'Styles' ) }
|
|
@@ -151,6 +154,7 @@ export default function GlobalStylesSidebar() {
|
|
|
151
154
|
}
|
|
152
155
|
disabled={ shouldClearCanvasContainerView }
|
|
153
156
|
onClick={ toggleStyleBook }
|
|
157
|
+
size="compact"
|
|
154
158
|
/>
|
|
155
159
|
</FlexItem>
|
|
156
160
|
<FlexItem>
|
|
@@ -162,6 +166,7 @@ export default function GlobalStylesSidebar() {
|
|
|
162
166
|
isPressed={
|
|
163
167
|
isRevisionsOpened || isRevisionsStyleBookOpened
|
|
164
168
|
}
|
|
169
|
+
size="compact"
|
|
165
170
|
/>
|
|
166
171
|
</FlexItem>
|
|
167
172
|
<GlobalStylesMenuSlot />
|
|
@@ -38,14 +38,6 @@
|
|
|
38
38
|
margin: 0;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.edit-site-global-styles-sidebar .interface-complementary-area-header .components-button.has-icon {
|
|
42
|
-
margin-left: 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.edit-site-global-styles-sidebar__reset-button.components-button {
|
|
46
|
-
margin-left: auto;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
41
|
.edit-site-global-styles-sidebar .components-navigation__menu-title-heading {
|
|
50
42
|
font-size: $default-font-size * 1.2;
|
|
51
43
|
font-weight: 500;
|
|
@@ -104,6 +96,3 @@
|
|
|
104
96
|
}
|
|
105
97
|
}
|
|
106
98
|
|
|
107
|
-
.edit-site-sidebar__panel {
|
|
108
|
-
margin-top: -1px;
|
|
109
|
-
}
|
|
@@ -1,190 +1,51 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
4
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
5
|
import { useSelect } from '@wordpress/data';
|
|
12
|
-
import { useState } from '@wordpress/element';
|
|
13
|
-
import { __unstableMotion as motion } from '@wordpress/components';
|
|
14
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
|
-
import {
|
|
16
|
-
DocumentBar,
|
|
17
|
-
PostSavedState,
|
|
18
|
-
store as editorStore,
|
|
19
|
-
privateApis as editorPrivateApis,
|
|
20
|
-
} from '@wordpress/editor';
|
|
21
6
|
|
|
22
7
|
/**
|
|
23
8
|
* Internal dependencies
|
|
24
9
|
*/
|
|
25
|
-
import
|
|
10
|
+
import SiteEditorMoreMenu from './more-menu';
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
26
12
|
import SaveButton from '../save-button';
|
|
27
|
-
import
|
|
28
|
-
import { store as editSiteStore } from '../../store';
|
|
13
|
+
import { isPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
29
14
|
import {
|
|
30
15
|
getEditorCanvasContainerTitle,
|
|
31
16
|
useHasEditorCanvasContainer,
|
|
32
17
|
} from '../editor-canvas-container';
|
|
33
|
-
import {
|
|
34
|
-
import { FOCUSABLE_ENTITIES } from '../../utils/constants';
|
|
35
|
-
import { isPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
36
|
-
|
|
37
|
-
const {
|
|
38
|
-
CollapsableBlockToolbar,
|
|
39
|
-
MoreMenu,
|
|
40
|
-
PostViewLink,
|
|
41
|
-
PreviewDropdown,
|
|
42
|
-
PinnedItems,
|
|
43
|
-
PostPublishButtonOrToggle,
|
|
44
|
-
} = unlock( editorPrivateApis );
|
|
18
|
+
import { store as editSiteStore } from '../../store';
|
|
45
19
|
|
|
46
|
-
|
|
47
|
-
const {
|
|
48
|
-
templateType,
|
|
49
|
-
isDistractionFree,
|
|
50
|
-
blockEditorMode,
|
|
51
|
-
showIconLabels,
|
|
52
|
-
editorCanvasView,
|
|
53
|
-
isFixedToolbar,
|
|
54
|
-
isPublishSidebarOpened,
|
|
55
|
-
} = useSelect( ( select ) => {
|
|
56
|
-
const { getEditedPostType } = select( editSiteStore );
|
|
57
|
-
const { __unstableGetEditorMode } = select( blockEditorStore );
|
|
58
|
-
const { get: getPreference } = select( preferencesStore );
|
|
59
|
-
const { getDeviceType } = select( editorStore );
|
|
20
|
+
const { Header: EditorHeader } = unlock( editorPrivateApis );
|
|
60
21
|
|
|
22
|
+
function Header( { setEntitiesSavedStatesCallback } ) {
|
|
23
|
+
const _isPreviewingTheme = isPreviewingTheme();
|
|
24
|
+
const hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();
|
|
25
|
+
const { editorCanvasView } = useSelect( ( select ) => {
|
|
61
26
|
return {
|
|
62
|
-
deviceType: getDeviceType(),
|
|
63
|
-
templateType: getEditedPostType(),
|
|
64
|
-
blockEditorMode: __unstableGetEditorMode(),
|
|
65
|
-
showIconLabels: getPreference( 'core', 'showIconLabels' ),
|
|
66
27
|
editorCanvasView: unlock(
|
|
67
28
|
select( editSiteStore )
|
|
68
29
|
).getEditorCanvasContainerView(),
|
|
69
|
-
isDistractionFree: getPreference( 'core', 'distractionFree' ),
|
|
70
|
-
isFixedToolbar: getPreference( 'core', 'fixedToolbar' ),
|
|
71
|
-
isPublishSidebarOpened:
|
|
72
|
-
select( editorStore ).isPublishSidebarOpened(),
|
|
73
30
|
};
|
|
74
31
|
}, [] );
|
|
75
32
|
|
|
76
|
-
const isLargeViewport = useViewportMatch( 'medium' );
|
|
77
|
-
const showTopToolbar =
|
|
78
|
-
isLargeViewport && isFixedToolbar && blockEditorMode !== 'zoom-out';
|
|
79
|
-
const disableMotion = useReducedMotion();
|
|
80
|
-
|
|
81
|
-
const hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();
|
|
82
|
-
|
|
83
|
-
const isFocusMode = FOCUSABLE_ENTITIES.includes( templateType );
|
|
84
|
-
|
|
85
|
-
const isZoomedOutView = blockEditorMode === 'zoom-out';
|
|
86
|
-
|
|
87
|
-
const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =
|
|
88
|
-
useState( true );
|
|
89
|
-
|
|
90
|
-
const toolbarVariants = {
|
|
91
|
-
isDistractionFree: { y: '-50px' },
|
|
92
|
-
isDistractionFreeHovering: { y: 0 },
|
|
93
|
-
view: { y: 0 },
|
|
94
|
-
edit: { y: 0 },
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const toolbarTransition = {
|
|
98
|
-
type: 'tween',
|
|
99
|
-
duration: disableMotion ? 0 : 0.2,
|
|
100
|
-
ease: 'easeOut',
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const _isPreviewingTheme = isPreviewingTheme();
|
|
104
33
|
return (
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
34
|
+
<EditorHeader
|
|
35
|
+
setEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }
|
|
36
|
+
customSaveButton={
|
|
37
|
+
_isPreviewingTheme && <SaveButton size="compact" />
|
|
38
|
+
}
|
|
39
|
+
forceDisableBlockTools={ ! hasDefaultEditorCanvasView }
|
|
40
|
+
title={
|
|
41
|
+
! hasDefaultEditorCanvasView
|
|
42
|
+
? getEditorCanvasContainerTitle( editorCanvasView )
|
|
43
|
+
: undefined
|
|
44
|
+
}
|
|
110
45
|
>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
className="edit-site-header-edit-mode__start"
|
|
114
|
-
variants={ toolbarVariants }
|
|
115
|
-
transition={ toolbarTransition }
|
|
116
|
-
>
|
|
117
|
-
<DocumentTools
|
|
118
|
-
blockEditorMode={ blockEditorMode }
|
|
119
|
-
isDistractionFree={ isDistractionFree }
|
|
120
|
-
/>
|
|
121
|
-
{ showTopToolbar && (
|
|
122
|
-
<CollapsableBlockToolbar
|
|
123
|
-
isCollapsed={ isBlockToolsCollapsed }
|
|
124
|
-
onToggle={ setIsBlockToolsCollapsed }
|
|
125
|
-
/>
|
|
126
|
-
) }
|
|
127
|
-
</motion.div>
|
|
128
|
-
) }
|
|
129
|
-
|
|
130
|
-
{ ! isDistractionFree && (
|
|
131
|
-
<div className="edit-site-header-edit-mode__center">
|
|
132
|
-
{ ! hasDefaultEditorCanvasView ? (
|
|
133
|
-
getEditorCanvasContainerTitle( editorCanvasView )
|
|
134
|
-
) : (
|
|
135
|
-
<DocumentBar />
|
|
136
|
-
) }
|
|
137
|
-
</div>
|
|
138
|
-
) }
|
|
139
|
-
|
|
140
|
-
<div className="edit-site-header-edit-mode__end">
|
|
141
|
-
<motion.div
|
|
142
|
-
className="edit-site-header-edit-mode__actions"
|
|
143
|
-
variants={ toolbarVariants }
|
|
144
|
-
transition={ toolbarTransition }
|
|
145
|
-
>
|
|
146
|
-
{ isLargeViewport && (
|
|
147
|
-
<div
|
|
148
|
-
className={ classnames(
|
|
149
|
-
'edit-site-header-edit-mode__preview-options',
|
|
150
|
-
{ 'is-zoomed-out': isZoomedOutView }
|
|
151
|
-
) }
|
|
152
|
-
>
|
|
153
|
-
<PreviewDropdown
|
|
154
|
-
disabled={
|
|
155
|
-
isFocusMode || ! hasDefaultEditorCanvasView
|
|
156
|
-
}
|
|
157
|
-
/>
|
|
158
|
-
</div>
|
|
159
|
-
) }
|
|
160
|
-
<PostViewLink />
|
|
161
|
-
{
|
|
162
|
-
// TODO: For now we conditionally render the Save/Publish buttons based on
|
|
163
|
-
// some specific site editor extra handling. Examples are when we're previewing
|
|
164
|
-
// a theme, handling of global styles changes or when we're in 'view' mode,
|
|
165
|
-
// which opens the save panel in a Modal.
|
|
166
|
-
}
|
|
167
|
-
{ ! _isPreviewingTheme && ! isPublishSidebarOpened && (
|
|
168
|
-
// This button isn't completely hidden by the publish sidebar.
|
|
169
|
-
// We can't hide the whole toolbar when the publish sidebar is open because
|
|
170
|
-
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
|
|
171
|
-
// We track that DOM node to return focus to the PostPublishButtonOrToggle
|
|
172
|
-
// when the publish sidebar has been closed.
|
|
173
|
-
<PostSavedState />
|
|
174
|
-
) }
|
|
175
|
-
{ ! _isPreviewingTheme && (
|
|
176
|
-
<PostPublishButtonOrToggle
|
|
177
|
-
setEntitiesSavedStatesCallback={
|
|
178
|
-
setEntitiesSavedStatesCallback
|
|
179
|
-
}
|
|
180
|
-
/>
|
|
181
|
-
) }
|
|
182
|
-
{ _isPreviewingTheme && <SaveButton size="compact" /> }
|
|
183
|
-
{ ! isDistractionFree && <PinnedItems.Slot scope="core" /> }
|
|
184
|
-
<MoreMenu />
|
|
185
|
-
<SiteEditorMoreMenuItems />
|
|
186
|
-
</motion.div>
|
|
187
|
-
</div>
|
|
188
|
-
</div>
|
|
46
|
+
<SiteEditorMoreMenu />
|
|
47
|
+
</EditorHeader>
|
|
189
48
|
);
|
|
190
49
|
}
|
|
50
|
+
|
|
51
|
+
export default Header;
|