@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
|
@@ -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
|
|
@@ -48,7 +48,6 @@ import {
|
|
|
48
48
|
} from '../../utils/constants';
|
|
49
49
|
import {
|
|
50
50
|
exportJSONaction,
|
|
51
|
-
renameAction,
|
|
52
51
|
resetAction,
|
|
53
52
|
deleteAction,
|
|
54
53
|
duplicatePatternAction,
|
|
@@ -60,12 +59,13 @@ import usePatterns from './use-patterns';
|
|
|
60
59
|
import PatternsHeader from './header';
|
|
61
60
|
import { useLink } from '../routes/link';
|
|
62
61
|
import { useAddedBy } from '../page-templates/hooks';
|
|
62
|
+
import { useEditPostAction } from '../dataviews-actions';
|
|
63
63
|
|
|
64
64
|
const { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock(
|
|
65
65
|
blockEditorPrivateApis
|
|
66
66
|
);
|
|
67
67
|
const { usePostActions } = unlock( editorPrivateApis );
|
|
68
|
-
const {
|
|
68
|
+
const { useLocation } = unlock( routerPrivateApis );
|
|
69
69
|
|
|
70
70
|
const EMPTY_ARRAY = [];
|
|
71
71
|
const defaultConfigPerViewType = {
|
|
@@ -177,12 +177,9 @@ function Author( { item, viewType } ) {
|
|
|
177
177
|
<HStack alignment="left" spacing={ 1 }>
|
|
178
178
|
{ withIcon && imageUrl && (
|
|
179
179
|
<div
|
|
180
|
-
className={
|
|
181
|
-
'
|
|
182
|
-
|
|
183
|
-
'is-loaded': isImageLoaded,
|
|
184
|
-
}
|
|
185
|
-
) }
|
|
180
|
+
className={ clsx( 'page-templates-author-field__avatar', {
|
|
181
|
+
'is-loaded': isImageLoaded,
|
|
182
|
+
} ) }
|
|
186
183
|
>
|
|
187
184
|
<img
|
|
188
185
|
onLoad={ () => setIsImageLoaded( true ) }
|
|
@@ -378,45 +375,29 @@ export default function DataviewsPatterns() {
|
|
|
378
375
|
return filterSortAndPaginate( patterns, viewWithoutFilters, fields );
|
|
379
376
|
}, [ patterns, view, fields, type ] );
|
|
380
377
|
|
|
381
|
-
const
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const post = items[ 0 ];
|
|
386
|
-
history.push( {
|
|
387
|
-
postId: post.id,
|
|
388
|
-
postType: post.type,
|
|
389
|
-
categoryId,
|
|
390
|
-
categoryType: type,
|
|
391
|
-
canvas: 'edit',
|
|
392
|
-
} );
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
[ history, categoryId, type ]
|
|
396
|
-
);
|
|
397
|
-
const [ editAction, viewRevisionsAction ] = usePostActions(
|
|
398
|
-
onActionPerformed,
|
|
399
|
-
[ 'edit-post', 'view-post-revisions' ]
|
|
400
|
-
);
|
|
378
|
+
const templatePartActions = usePostActions( TEMPLATE_PART_POST_TYPE );
|
|
379
|
+
const patternActions = usePostActions( PATTERN_TYPES.user );
|
|
380
|
+
const editAction = useEditPostAction();
|
|
381
|
+
|
|
401
382
|
const actions = useMemo( () => {
|
|
402
383
|
if ( type === TEMPLATE_PART_POST_TYPE ) {
|
|
403
384
|
return [
|
|
404
385
|
editAction,
|
|
405
|
-
|
|
386
|
+
...templatePartActions,
|
|
406
387
|
duplicateTemplatePartAction,
|
|
407
|
-
viewRevisionsAction,
|
|
408
388
|
resetAction,
|
|
409
389
|
deleteAction,
|
|
410
|
-
];
|
|
390
|
+
].filter( Boolean );
|
|
411
391
|
}
|
|
412
392
|
return [
|
|
413
|
-
|
|
393
|
+
editAction,
|
|
394
|
+
...patternActions,
|
|
414
395
|
duplicatePatternAction,
|
|
415
396
|
exportJSONaction,
|
|
416
397
|
resetAction,
|
|
417
398
|
deleteAction,
|
|
418
|
-
];
|
|
419
|
-
}, [ type,
|
|
399
|
+
].filter( Boolean );
|
|
400
|
+
}, [ editAction, type, templatePartActions, patternActions ] );
|
|
420
401
|
const onChangeView = useCallback(
|
|
421
402
|
( newView ) => {
|
|
422
403
|
if ( newView.type !== view.type ) {
|
|
@@ -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
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
|
|
44
44
|
import usePatternSettings from '../page-patterns/use-pattern-settings';
|
|
45
45
|
import { unlock } from '../../lock-unlock';
|
|
46
|
+
import { useEditPostAction } from '../dataviews-actions';
|
|
46
47
|
|
|
47
48
|
const { usePostActions } = unlock( editorPrivateApis );
|
|
48
49
|
|
|
@@ -111,12 +112,9 @@ function AuthorField( { item, viewType } ) {
|
|
|
111
112
|
<HStack alignment="left" spacing={ 1 }>
|
|
112
113
|
{ withIcon && imageUrl && (
|
|
113
114
|
<div
|
|
114
|
-
className={
|
|
115
|
-
'
|
|
116
|
-
|
|
117
|
-
'is-loaded': isImageLoaded,
|
|
118
|
-
}
|
|
119
|
-
) }
|
|
115
|
+
className={ clsx( 'page-templates-author-field__avatar', {
|
|
116
|
+
'is-loaded': isImageLoaded,
|
|
117
|
+
} ) }
|
|
120
118
|
>
|
|
121
119
|
<img
|
|
122
120
|
onLoad={ () => setIsImageLoaded( true ) }
|
|
@@ -186,14 +184,6 @@ function Preview( { item, viewType } ) {
|
|
|
186
184
|
);
|
|
187
185
|
}
|
|
188
186
|
|
|
189
|
-
const TEMPLATE_ACTIONS = [
|
|
190
|
-
'edit-post',
|
|
191
|
-
'reset-template',
|
|
192
|
-
'rename-template',
|
|
193
|
-
'view-post-revisions',
|
|
194
|
-
'delete-template',
|
|
195
|
-
];
|
|
196
|
-
|
|
197
187
|
export default function PageTemplates() {
|
|
198
188
|
const { params } = useLocation();
|
|
199
189
|
const { activeView = 'all', layout } = params;
|
|
@@ -333,22 +323,13 @@ export default function PageTemplates() {
|
|
|
333
323
|
return filterSortAndPaginate( records, view, fields );
|
|
334
324
|
}, [ records, view, fields ] );
|
|
335
325
|
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
postId: post.id,
|
|
342
|
-
postType: post.type,
|
|
343
|
-
canvas: 'edit',
|
|
344
|
-
} );
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
[ history ]
|
|
326
|
+
const postTypeActions = usePostActions( TEMPLATE_POST_TYPE );
|
|
327
|
+
const editAction = useEditPostAction();
|
|
328
|
+
const actions = useMemo(
|
|
329
|
+
() => [ editAction, ...postTypeActions ],
|
|
330
|
+
[ postTypeActions, editAction ]
|
|
348
331
|
);
|
|
349
332
|
|
|
350
|
-
const actions = usePostActions( onActionPerformed, TEMPLATE_ACTIONS );
|
|
351
|
-
|
|
352
333
|
const onChangeView = useCallback(
|
|
353
334
|
( newView ) => {
|
|
354
335
|
if ( newView.type !== view.type ) {
|
|
@@ -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
|
|
@@ -30,7 +30,7 @@ export default function Pagination( {
|
|
|
30
30
|
aria-label={ label }
|
|
31
31
|
spacing={ 3 }
|
|
32
32
|
justify="flex-start"
|
|
33
|
-
className={
|
|
33
|
+
className={ clsx( 'edit-site-pagination', className ) }
|
|
34
34
|
>
|
|
35
35
|
<Text variant="muted" className="edit-site-pagination__total">
|
|
36
36
|
{
|
|
@@ -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
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Tooltip,
|
|
13
13
|
__unstableMotion as motion,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
15
|
+
import { useInstanceId, useReducedMotion } from '@wordpress/compose';
|
|
16
16
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
17
|
import { __ } from '@wordpress/i18n';
|
|
18
18
|
|
|
@@ -86,6 +86,7 @@ function ResizableFrame( {
|
|
|
86
86
|
defaultSize,
|
|
87
87
|
innerContentStyle,
|
|
88
88
|
} ) {
|
|
89
|
+
const disableMotion = useReducedMotion();
|
|
89
90
|
const [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );
|
|
90
91
|
// The width of the resizable frame when a new resize gesture starts.
|
|
91
92
|
const [ startingWidth, setStartingWidth ] = useState();
|
|
@@ -230,6 +231,17 @@ function ResizableFrame( {
|
|
|
230
231
|
setFrameSize( { width: '100%', height: '100%' } );
|
|
231
232
|
}
|
|
232
233
|
} }
|
|
234
|
+
whileHover={
|
|
235
|
+
canvasMode === 'view'
|
|
236
|
+
? {
|
|
237
|
+
scale: 1.005,
|
|
238
|
+
transition: {
|
|
239
|
+
duration: disableMotion ? 0 : 0.5,
|
|
240
|
+
ease: 'easeOut',
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
: {}
|
|
244
|
+
}
|
|
233
245
|
transition={ FRAME_TRANSITION }
|
|
234
246
|
size={ frameSize }
|
|
235
247
|
enable={ {
|
|
@@ -266,7 +278,7 @@ function ResizableFrame( {
|
|
|
266
278
|
key="handle"
|
|
267
279
|
role="separator"
|
|
268
280
|
aria-orientation="vertical"
|
|
269
|
-
className={
|
|
281
|
+
className={ clsx(
|
|
270
282
|
'edit-site-resizable-frame__handle',
|
|
271
283
|
{ 'is-resizing': isResizing }
|
|
272
284
|
) }
|
|
@@ -298,7 +310,7 @@ function ResizableFrame( {
|
|
|
298
310
|
onResizeStart={ handleResizeStart }
|
|
299
311
|
onResize={ handleResize }
|
|
300
312
|
onResizeStop={ handleResizeStop }
|
|
301
|
-
className={
|
|
313
|
+
className={ clsx( 'edit-site-resizable-frame__inner', {
|
|
302
314
|
'is-resizing': isResizing,
|
|
303
315
|
} ) }
|
|
304
316
|
showHandle={ false } // Do not show the default handle, as we're using a custom one.
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
__unstableEditorStyles as EditorStyles,
|
|
11
11
|
__unstableIframe as Iframe,
|
|
12
12
|
} from '@wordpress/block-editor';
|
|
13
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
13
14
|
import { useSelect } from '@wordpress/data';
|
|
14
15
|
import { useContext, useMemo } from '@wordpress/element';
|
|
15
16
|
|
|
@@ -18,7 +19,6 @@ import { useContext, useMemo } from '@wordpress/element';
|
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
import { unlock } from '../../lock-unlock';
|
|
21
|
-
import { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';
|
|
22
22
|
import EditorCanvasContainer from '../editor-canvas-container';
|
|
23
23
|
|
|
24
24
|
const {
|
|
@@ -26,6 +26,7 @@ const {
|
|
|
26
26
|
GlobalStylesContext,
|
|
27
27
|
useGlobalStylesOutputWithConfig,
|
|
28
28
|
} = unlock( blockEditorPrivateApis );
|
|
29
|
+
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
29
30
|
|
|
30
31
|
function isObjectEmpty( object ) {
|
|
31
32
|
return ! object || Object.keys( object ).length === 0;
|
|
@@ -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
|
|
@@ -139,19 +139,19 @@ export default function SavePanel() {
|
|
|
139
139
|
const disabled = isSaving || ! activateSaveEnabled;
|
|
140
140
|
return (
|
|
141
141
|
<NavigableRegion
|
|
142
|
-
className={
|
|
142
|
+
className={ clsx( 'edit-site-layout__actions', {
|
|
143
143
|
'is-entity-save-view-open': isSaveViewOpen,
|
|
144
144
|
} ) }
|
|
145
145
|
ariaLabel={ __( 'Save panel' ) }
|
|
146
146
|
>
|
|
147
147
|
<div
|
|
148
|
-
className={
|
|
148
|
+
className={ clsx( 'edit-site-editor__toggle-save-panel', {
|
|
149
149
|
'screen-reader-text': isSaveViewOpen,
|
|
150
150
|
} ) }
|
|
151
151
|
>
|
|
152
152
|
<Button
|
|
153
153
|
variant="secondary"
|
|
154
|
-
className={
|
|
154
|
+
className={ clsx(
|
|
155
155
|
'edit-site-editor__toggle-save-panel-button'
|
|
156
156
|
) }
|
|
157
157
|
onClick={ () => setIsSaveViewOpened( true ) }
|
|
@@ -1,68 +1,92 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
-
useCallback,
|
|
11
10
|
createContext,
|
|
11
|
+
useContext,
|
|
12
12
|
useState,
|
|
13
13
|
useRef,
|
|
14
|
-
|
|
14
|
+
useLayoutEffect,
|
|
15
15
|
} from '@wordpress/element';
|
|
16
16
|
import { focus } from '@wordpress/dom';
|
|
17
17
|
|
|
18
18
|
export const SidebarNavigationContext = createContext( () => {} );
|
|
19
|
+
// Focus a sidebar element after a navigation. The element to focus is either
|
|
20
|
+
// specified by `focusSelector` (when navigating back) or it is the first
|
|
21
|
+
// tabbable element (usually the "Back" button).
|
|
22
|
+
function focusSidebarElement( el, direction, focusSelector ) {
|
|
23
|
+
let elementToFocus;
|
|
24
|
+
if ( direction === 'back' && focusSelector ) {
|
|
25
|
+
elementToFocus = el.querySelector( focusSelector );
|
|
26
|
+
}
|
|
27
|
+
if ( direction !== null && ! elementToFocus ) {
|
|
28
|
+
const [ firstTabbable ] = focus.tabbable.find( el );
|
|
29
|
+
elementToFocus = firstTabbable ?? el;
|
|
30
|
+
}
|
|
31
|
+
elementToFocus?.focus();
|
|
32
|
+
}
|
|
19
33
|
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
// Navigation state that is updated when navigating back or forward. Helps us
|
|
35
|
+
// manage the animations and also focus.
|
|
36
|
+
function createNavState() {
|
|
37
|
+
let state = {
|
|
22
38
|
direction: null,
|
|
23
39
|
focusSelector: null,
|
|
24
|
-
}
|
|
40
|
+
};
|
|
25
41
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
return {
|
|
43
|
+
get() {
|
|
44
|
+
return state;
|
|
45
|
+
},
|
|
46
|
+
navigate( direction, focusSelector = null ) {
|
|
47
|
+
state = {
|
|
48
|
+
direction,
|
|
49
|
+
focusSelector:
|
|
50
|
+
direction === 'forward' && focusSelector
|
|
51
|
+
? focusSelector
|
|
52
|
+
: state.focusSelector,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
35
57
|
|
|
58
|
+
function SidebarContentWrapper( { children } ) {
|
|
59
|
+
const navState = useContext( SidebarNavigationContext );
|
|
36
60
|
const wrapperRef = useRef();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
if ( navState.direction !== null && ! elementToFocus ) {
|
|
45
|
-
const [ firstTabbable ] = focus.tabbable.find( wrapperRef.current );
|
|
46
|
-
elementToFocus = firstTabbable ?? wrapperRef.current;
|
|
47
|
-
}
|
|
48
|
-
elementToFocus?.focus();
|
|
61
|
+
const [ navAnimation, setNavAnimation ] = useState( null );
|
|
62
|
+
|
|
63
|
+
useLayoutEffect( () => {
|
|
64
|
+
const { direction, focusSelector } = navState.get();
|
|
65
|
+
focusSidebarElement( wrapperRef.current, direction, focusSelector );
|
|
66
|
+
setNavAnimation( direction );
|
|
49
67
|
}, [ navState ] );
|
|
50
68
|
|
|
51
|
-
const wrapperCls =
|
|
52
|
-
'slide-from-left':
|
|
53
|
-
'slide-from-right':
|
|
69
|
+
const wrapperCls = clsx( 'edit-site-sidebar__screen-wrapper', {
|
|
70
|
+
'slide-from-left': navAnimation === 'back',
|
|
71
|
+
'slide-from-right': navAnimation === 'forward',
|
|
54
72
|
} );
|
|
55
73
|
|
|
56
74
|
return (
|
|
57
|
-
<
|
|
75
|
+
<div ref={ wrapperRef } className={ wrapperCls }>
|
|
76
|
+
{ children }
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default function SidebarContent( { routeKey, children } ) {
|
|
82
|
+
const [ navState ] = useState( createNavState );
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<SidebarNavigationContext.Provider value={ navState }>
|
|
58
86
|
<div className="edit-site-sidebar__content">
|
|
59
|
-
<
|
|
60
|
-
ref={ wrapperRef }
|
|
61
|
-
key={ routeKey }
|
|
62
|
-
className={ wrapperCls }
|
|
63
|
-
>
|
|
87
|
+
<SidebarContentWrapper key={ routeKey }>
|
|
64
88
|
{ children }
|
|
65
|
-
</
|
|
89
|
+
</SidebarContentWrapper>
|
|
66
90
|
</div>
|
|
67
91
|
</SidebarNavigationContext.Provider>
|
|
68
92
|
);
|
|
@@ -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
|
|
@@ -12,10 +12,7 @@ export default function SidebarButton( props ) {
|
|
|
12
12
|
return (
|
|
13
13
|
<Button
|
|
14
14
|
{ ...props }
|
|
15
|
-
className={
|
|
16
|
-
'edit-site-sidebar-button',
|
|
17
|
-
props.className
|
|
18
|
-
) }
|
|
15
|
+
className={ clsx( 'edit-site-sidebar-button', props.className ) }
|
|
19
16
|
/>
|
|
20
17
|
);
|
|
21
18
|
}
|
|
@@ -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
|
|
@@ -44,12 +44,9 @@ export default function DataViewItem( {
|
|
|
44
44
|
return (
|
|
45
45
|
<HStack
|
|
46
46
|
justify="flex-start"
|
|
47
|
-
className={
|
|
48
|
-
'
|
|
49
|
-
|
|
50
|
-
'is-selected': isActive,
|
|
51
|
-
}
|
|
52
|
-
) }
|
|
47
|
+
className={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {
|
|
48
|
+
'is-selected': isActive,
|
|
49
|
+
} ) }
|
|
53
50
|
>
|
|
54
51
|
<SidebarNavigationItem
|
|
55
52
|
icon={ iconToUse }
|
|
@@ -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
|
|
@@ -35,7 +35,7 @@ export default function SidebarNavigationItem( {
|
|
|
35
35
|
...props
|
|
36
36
|
} ) {
|
|
37
37
|
const history = useHistory();
|
|
38
|
-
const navigate = useContext( SidebarNavigationContext );
|
|
38
|
+
const { navigate } = useContext( SidebarNavigationContext );
|
|
39
39
|
|
|
40
40
|
// If there is no custom click handler, create one that navigates to `path`.
|
|
41
41
|
function handleClick( e ) {
|
|
@@ -51,7 +51,7 @@ export default function SidebarNavigationItem( {
|
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<Item
|
|
54
|
-
className={
|
|
54
|
+
className={ clsx(
|
|
55
55
|
'edit-site-sidebar-navigation-item',
|
|
56
56
|
{ 'with-suffix': ! withChevron && suffix },
|
|
57
57
|
className
|
|
@@ -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
|
|
@@ -32,25 +32,6 @@ import { SidebarNavigationContext } from '../sidebar';
|
|
|
32
32
|
|
|
33
33
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
34
34
|
|
|
35
|
-
function getBackPath( params ) {
|
|
36
|
-
// From a data view path we navigate back to root
|
|
37
|
-
if ( params.path ) {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// From edit screen for a post we navigate back to post-type specific data view
|
|
42
|
-
if ( params.postType === 'page' ) {
|
|
43
|
-
return { path: '/page', postId: params.postId };
|
|
44
|
-
} else if ( params.postType === 'wp_template' ) {
|
|
45
|
-
return { path: '/wp_template', postId: params.postId };
|
|
46
|
-
} else if ( params.postType === 'wp_navigation' ) {
|
|
47
|
-
return { path: '/navigation', postId: params.postId };
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Go back to root by default
|
|
51
|
-
return {};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
35
|
export default function SidebarNavigationScreen( {
|
|
55
36
|
isRoot,
|
|
56
37
|
title,
|
|
@@ -81,17 +62,16 @@ export default function SidebarNavigationScreen( {
|
|
|
81
62
|
);
|
|
82
63
|
const location = useLocation();
|
|
83
64
|
const history = useHistory();
|
|
84
|
-
const navigate = useContext( SidebarNavigationContext );
|
|
65
|
+
const { navigate } = useContext( SidebarNavigationContext );
|
|
66
|
+
const backPath = backPathProp ?? location.state?.backPath;
|
|
85
67
|
const icon = isRTL() ? chevronRight : chevronLeft;
|
|
68
|
+
|
|
86
69
|
return (
|
|
87
70
|
<>
|
|
88
71
|
<VStack
|
|
89
|
-
className={
|
|
90
|
-
'
|
|
91
|
-
|
|
92
|
-
'has-footer': !! footer,
|
|
93
|
-
}
|
|
94
|
-
) }
|
|
72
|
+
className={ clsx( 'edit-site-sidebar-navigation-screen__main', {
|
|
73
|
+
'has-footer': !! footer,
|
|
74
|
+
} ) }
|
|
95
75
|
spacing={ 0 }
|
|
96
76
|
justify="flex-start"
|
|
97
77
|
>
|
|
@@ -103,10 +83,6 @@ export default function SidebarNavigationScreen( {
|
|
|
103
83
|
{ ! isRoot && (
|
|
104
84
|
<SidebarButton
|
|
105
85
|
onClick={ () => {
|
|
106
|
-
const backPath =
|
|
107
|
-
backPathProp ??
|
|
108
|
-
location.state?.backPath ??
|
|
109
|
-
getBackPath( location.params );
|
|
110
86
|
history.push( backPath );
|
|
111
87
|
navigate( 'back' );
|
|
112
88
|
} }
|
|
@@ -99,20 +99,22 @@
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-variations_item {
|
|
102
|
+
|
|
103
|
+
// Use a white outline to provide contrast with the dark background.
|
|
102
104
|
.edit-site-global-styles-variations_item-preview {
|
|
103
|
-
|
|
105
|
+
outline-color: rgba($white, 0.05);
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
&:
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
&:not(.is-active):hover .edit-site-global-styles-variations_item-preview {
|
|
109
|
+
outline-color: rgba($white, 0.15);
|
|
110
|
+
}
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
outline-
|
|
112
|
+
&.is-active .edit-site-global-styles-variations_item-preview {
|
|
113
|
+
outline-color: $white;
|
|
114
|
+
}
|
|
112
115
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
+
&:focus-visible .edit-site-global-styles-variations_item-preview {
|
|
117
|
+
outline-color: var(--wp-admin-theme-color);
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
|
|
@@ -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
|
|
@@ -19,7 +19,7 @@ export default function SidebarNavigationScreenDetailsPanelRow( {
|
|
|
19
19
|
key={ label }
|
|
20
20
|
spacing={ 5 }
|
|
21
21
|
alignment="left"
|
|
22
|
-
className={
|
|
22
|
+
className={ clsx(
|
|
23
23
|
'edit-site-sidebar-navigation-details-screen-panel__row',
|
|
24
24
|
className
|
|
25
25
|
) }
|
|
@@ -103,7 +103,7 @@ function SidebarNavigationScreenGlobalStylesContent() {
|
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export default function SidebarNavigationScreenGlobalStyles() {
|
|
106
|
+
export default function SidebarNavigationScreenGlobalStyles( { backPath } ) {
|
|
107
107
|
const { revisions, isLoading: isLoadingRevisions } =
|
|
108
108
|
useGlobalStylesRevisions();
|
|
109
109
|
const { openGeneralSidebar } = useDispatch( editSiteStore );
|
|
@@ -179,6 +179,7 @@ export default function SidebarNavigationScreenGlobalStyles() {
|
|
|
179
179
|
description={ __(
|
|
180
180
|
'Choose a different style combination for the theme styles.'
|
|
181
181
|
) }
|
|
182
|
+
backPath={ backPath }
|
|
182
183
|
content={ <SidebarNavigationScreenGlobalStylesContent /> }
|
|
183
184
|
footer={
|
|
184
185
|
shouldShowGlobalStylesFooter && (
|