@wordpress/edit-site 5.33.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 +11 -3
- package/build/components/add-new-page/index.js +3 -0
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +8 -7
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- 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/resize-handle.js +20 -5
- package/build/components/block-editor/resize-handle.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/create-template-part-modal/index.js +3 -0
- package/build/components/create-template-part-modal/index.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 +95 -16
- 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/font-library-modal/context.js +9 -3
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +7 -2
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +22 -20
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.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/style-variations-container.js +8 -2
- package/build/components/global-styles/style-variations-container.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 +21 -137
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +3 -97
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -49
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +9 -9
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +70 -44
- 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 -14
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +15 -87
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/header.js +3 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +28 -68
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +1 -0
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/hooks.js.map +1 -0
- package/build/components/{page-templates-template-parts → page-templates}/index.js +73 -94
- package/build/components/page-templates/index.js.map +1 -0
- package/build/components/pagination/index.js +2 -2
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/pattern-modal/duplicate.js +7 -5
- package/build/components/pattern-modal/duplicate.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +9 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +20 -9
- 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/index.js +39 -8
- package/build/components/sidebar-navigation-screen-page/index.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 +3 -15
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +25 -29
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +5 -2
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -33
- 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/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/template-actions/index.js +1 -1
- package/build/components/template-actions/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/deprecated.js +55 -0
- package/build/deprecated.js.map +1 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +40 -6
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +18 -18
- package/build/index.js.map +1 -1
- package/build/utils/constants.js +1 -2
- package/build/utils/constants.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-page/index.js +3 -0
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +8 -7
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +2 -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/resize-handle.js +21 -6
- package/build-module/components/block-editor/resize-handle.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/create-template-part-modal/index.js +3 -0
- package/build-module/components/create-template-part-modal/index.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 +96 -17
- 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/font-library-modal/context.js +9 -3
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +7 -2
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +22 -20
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.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/style-variations-container.js +8 -2
- package/build-module/components/global-styles/style-variations-container.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 +22 -138
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +5 -99
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -49
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +9 -9
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +70 -45
- 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 +5 -15
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +15 -87
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/header.js +3 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +31 -71
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +1 -0
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/hooks.js.map +1 -0
- package/build-module/components/{page-templates-template-parts → page-templates}/index.js +73 -94
- package/build-module/components/page-templates/index.js.map +1 -0
- package/build-module/components/pagination/index.js +2 -2
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/pattern-modal/duplicate.js +7 -5
- package/build-module/components/pattern-modal/duplicate.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +8 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +21 -10
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +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/index.js +40 -9
- package/build-module/components/sidebar-navigation-screen-page/index.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 +3 -15
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +26 -30
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -33
- 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/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +1 -1
- package/build-module/components/template-actions/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/deprecated.js +45 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +38 -5
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +2 -4
- package/build-module/index.js.map +1 -1
- package/build-module/utils/constants.js +0 -1
- package/build-module/utils/constants.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 +208 -484
- package/build-style/style.css +208 -484
- package/package.json +43 -45
- package/src/components/add-new-page/index.js +7 -1
- package/src/components/add-new-pattern/index.js +15 -12
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
- 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/resize-handle.js +30 -11
- package/src/components/block-editor/site-editor-canvas.js +2 -2
- package/src/components/block-editor/style.scss +12 -17
- package/src/components/create-template-part-modal/index.js +3 -0
- package/src/components/dataviews-actions/index.js +38 -0
- package/src/components/editor/index.js +117 -18
- package/src/components/editor/style.scss +6 -5
- 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/font-library-modal/context.js +9 -3
- package/src/components/global-styles/font-library-modal/font-collection.js +31 -12
- package/src/components/global-styles/font-library-modal/installed-fonts.js +82 -54
- package/src/components/global-styles/font-library-modal/style.scss +17 -0
- package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- 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/style-variations-container.js +11 -2
- 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 -184
- package/src/components/header-edit-mode/more-menu/index.js +8 -145
- package/src/components/header-edit-mode/style.scss +1 -271
- package/src/components/keyboard-shortcuts/register.js +0 -58
- package/src/components/layout/index.js +14 -10
- package/src/components/layout/router.js +66 -56
- package/src/components/layout/style.scss +2 -1
- package/src/components/page/index.js +2 -2
- package/src/components/page-pages/index.js +8 -28
- package/src/components/page-patterns/dataviews-pattern-actions.js +11 -101
- package/src/components/page-patterns/header.js +3 -1
- package/src/components/page-patterns/index.js +32 -110
- package/src/components/page-patterns/style.scss +14 -1
- package/src/components/page-patterns/use-patterns.js +1 -0
- package/src/components/{page-templates-template-parts → page-templates}/index.js +33 -75
- package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
- package/src/components/pagination/index.js +2 -2
- package/src/components/pattern-modal/duplicate.js +4 -3
- package/src/components/plugin-template-setting-panel/index.js +8 -0
- package/src/components/resizable-frame/index.js +20 -7
- 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/index.js +48 -9
- package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +1 -12
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/index.js +20 -39
- package/src/components/sidebar-navigation-screen-template/index.js +3 -2
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +8 -39
- 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/sync-state-with-url/use-init-edited-entity-from-url.js +0 -4
- package/src/components/template-actions/index.js +1 -1
- package/src/components/template-part-converter/index.js +16 -3
- package/src/deprecated.js +42 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +71 -17
- package/src/index.js +2 -9
- package/src/style.scss +2 -16
- package/src/utils/constants.js +1 -1
- 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/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -56
- package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build/components/page-templates-template-parts/add-new-template-part.js +0 -65
- package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build/components/page-templates-template-parts/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 -146
- package/build/components/sidebar-edit-mode/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +0 -98
- 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-status.js +0 -188
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
- 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 -130
- 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/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -49
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -57
- package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build-module/components/page-templates-template-parts/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 -137
- package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -90
- 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-status.js +0 -180
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -31
- 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 -122
- 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/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -59
- package/src/components/page-templates-template-parts/add-new-template-part.js +0 -62
- package/src/components/sidebar-edit-mode/index.js +0 -162
- package/src/components/sidebar-edit-mode/page-panels/index.js +0 -105
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -49
- package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -34
- 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 -144
- 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/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
- /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
- /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
|
@@ -9,10 +9,10 @@ var _react = require("react");
|
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
+
var _editor = require("@wordpress/editor");
|
|
12
13
|
var _data = require("@wordpress/data");
|
|
13
14
|
var _element = require("@wordpress/element");
|
|
14
15
|
var _lockUnlock = require("../../lock-unlock");
|
|
15
|
-
var _globalStylesProvider = require("../global-styles/global-styles-provider");
|
|
16
16
|
var _editorCanvasContainer = _interopRequireDefault(require("../editor-canvas-container"));
|
|
17
17
|
/**
|
|
18
18
|
* WordPress dependencies
|
|
@@ -27,6 +27,9 @@ const {
|
|
|
27
27
|
GlobalStylesContext,
|
|
28
28
|
useGlobalStylesOutputWithConfig
|
|
29
29
|
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
30
|
+
const {
|
|
31
|
+
mergeBaseAndUserConfigs
|
|
32
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
30
33
|
function isObjectEmpty(object) {
|
|
31
34
|
return !object || Object.keys(object).length === 0;
|
|
32
35
|
}
|
|
@@ -39,7 +42,7 @@ function Revisions({
|
|
|
39
42
|
} = (0, _element.useContext)(GlobalStylesContext);
|
|
40
43
|
const mergedConfig = (0, _element.useMemo)(() => {
|
|
41
44
|
if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) {
|
|
42
|
-
return
|
|
45
|
+
return mergeBaseAndUserConfigs(baseConfig, userConfig);
|
|
43
46
|
}
|
|
44
47
|
return {};
|
|
45
48
|
}, [baseConfig, userConfig]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_blockEditor","_data","_element","_lockUnlock","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_blockEditor","_editor","_data","_element","_lockUnlock","_editorCanvasContainer","_interopRequireDefault","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","editorPrivateApis","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","useContext","mergedConfig","useMemo","renderedBlocksArray","Array","isArray","originalSettings","useSelect","select","blockEditorStore","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","_react","createElement","default","title","__","closeButtonLabel","enableResizing","__unstableIframe","className","name","tabIndex","__unstableEditorStyles","Disabled","value","BlockList","renderAppender","_default","exports"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAC,sBAAA,CAAAR,OAAA;AArBA;AACA;AACA;;AAcA;AACA;AACA;;AAKA,MAAM;EACLS,+BAA+B;EAC/BC,mBAAmB;EACnBC;AACD,CAAC,GAAG,IAAAC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AAa,CAAC,IAAI,CAAEvB,aAAa,CAAEM,UAAW,CAAC,GAC7DiB,YAAY,GACZF,QAAQ,CAACI,MAAM;EAEnB,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACpC,sBAAA,CAAAqC,OAAqB;IACrBC,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BC,gBAAgB,EAAG,IAAAD,QAAE,EAAE,iBAAkB,CAAG;IAC5CE,cAAc;EAAA,GAEd,IAAAN,MAAA,CAAAC,aAAA,EAACzC,YAAA,CAAA+C,gBAAM;IACNC,SAAS,EAAC,6BAA6B;IACvCC,IAAI,EAAC,WAAW;IAChBC,QAAQ,EAAG;EAAG,GAEd,IAAAV,MAAA,CAAAC,aAAA,EAACzC,YAAA,CAAAmD,sBAAY;IAACZ,MAAM,EAAGD;EAAc,CAAE,CAAC,EACxC,IAAAE,MAAA,CAAAC,aAAA;EAEE;EACA;EACC,4CAEI,CAAC,EACR,IAAAD,MAAA,CAAAC,aAAA,EAAC5C,WAAA,CAAAuD,QAAQ;IAACJ,SAAS,EAAC;EAA+C,GAClE,IAAAR,MAAA,CAAAC,aAAA,EAAClC,+BAA+B;IAC/B8C,KAAK,EAAG1B,mBAAqB;IAC7BQ,QAAQ,EAAGA;EAAU,GAErB,IAAAK,MAAA,CAAAC,aAAA,EAACzC,YAAA,CAAAsD,SAAS;IAACC,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACH,CACc,CAAC;AAE1B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcvB,SAAS","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SavePanel;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
@@ -121,17 +121,17 @@ function SavePanel() {
|
|
|
121
121
|
const activateSaveEnabled = (0, _isPreviewingTheme.isPreviewingTheme)() || isDirty;
|
|
122
122
|
const disabled = isSaving || !activateSaveEnabled;
|
|
123
123
|
return (0, _react.createElement)(NavigableRegion, {
|
|
124
|
-
className: (0,
|
|
124
|
+
className: (0, _clsx.default)('edit-site-layout__actions', {
|
|
125
125
|
'is-entity-save-view-open': isSaveViewOpen
|
|
126
126
|
}),
|
|
127
127
|
ariaLabel: (0, _i18n.__)('Save panel')
|
|
128
128
|
}, (0, _react.createElement)("div", {
|
|
129
|
-
className: (0,
|
|
129
|
+
className: (0, _clsx.default)('edit-site-editor__toggle-save-panel', {
|
|
130
130
|
'screen-reader-text': isSaveViewOpen
|
|
131
131
|
})
|
|
132
132
|
}, (0, _react.createElement)(_components.Button, {
|
|
133
133
|
variant: "secondary",
|
|
134
|
-
className: (0,
|
|
134
|
+
className: (0, _clsx.default)('edit-site-editor__toggle-save-panel-button'),
|
|
135
135
|
onClick: () => setIsSaveViewOpened(true),
|
|
136
136
|
"aria-haspopup": 'dialog',
|
|
137
137
|
disabled: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","_react","createElement","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","isPreviewingTheme","EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","classnames","ariaLabel","Button","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={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A2B,EAAE;MACpD,0BAA0B,EAAEzB;IAC7B,CAAE,CAAG;IACL0B,SAAS,EAAG,IAAArD,QAAE,EAAE,YAAa;EAAG,GAEhC,IAAAS,MAAA,CAAAC,aAAA;IACCoC,SAAS,EAAG,IAAAM,mBAAU,EAAE,qCAAqC,EAAE;MAC9D,oBAAoB,EAAEzB;IACvB,CAAE;EAAG,GAEL,IAAAlB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA4E,MAAM;IACNC,OAAO,EAAC,WAAW;IACnBT,SAAS,EAAG,IAAAM,mBAAU,EACrB,4CACD,CAAG;IACHI,OAAO,EAAGA,CAAA,KAAMb,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BQ,QAAQ,EAAGA,QAAU;IACrBM,yBAAyB;EAAA,GAEvB,IAAAzD,QAAE,EAAE,iBAAkB,CACjB,CACJ,CAAC,EACJ2B,cAAc,IACf,IAAAlB,MAAA,CAAAC,aAAA,EAACW,oBAAoB;IAAC5B,OAAO,EAAGA,OAAS;IAAC6B,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","_react","createElement","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","isPreviewingTheme","EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","clsx","ariaLabel","Button","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ clsx( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion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CAAE,CAAG;IACL0B,SAAS,EAAG,IAAArD,QAAE,EAAE,YAAa;EAAG,GAEhC,IAAAS,MAAA,CAAAC,aAAA;IACCoC,SAAS,EAAG,IAAAM,aAAI,EAAE,qCAAqC,EAAE;MACxD,oBAAoB,EAAEzB;IACvB,CAAE;EAAG,GAEL,IAAAlB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA4E,MAAM;IACNC,OAAO,EAAC,WAAW;IACnBT,SAAS,EAAG,IAAAM,aAAI,EACf,4CACD,CAAG;IACHI,OAAO,EAAGA,CAAA,KAAMb,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BQ,QAAQ,EAAGA,QAAU;IACrBM,yBAAyB;EAAA,GAEvB,IAAAzD,QAAE,EAAE,iBAAkB,CACjB,CACJ,CAAC,EACJ2B,cAAc,IACf,IAAAlB,MAAA,CAAAC,aAAA,EAACW,oBAAoB;IAAC5B,OAAO,EAAGA,OAAS;IAAC6B,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.SidebarNavigationContext = void 0;
|
|
8
8
|
exports.default = SidebarContent;
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var
|
|
10
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
11
|
var _element = require("@wordpress/element");
|
|
12
12
|
var _dom = require("@wordpress/dom");
|
|
13
13
|
/**
|
|
@@ -19,44 +19,74 @@ var _dom = require("@wordpress/dom");
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
const SidebarNavigationContext = exports.SidebarNavigationContext = (0, _element.createContext)(() => {});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
// Focus a sidebar element after a navigation. The element to focus is either
|
|
23
|
+
// specified by `focusSelector` (when navigating back) or it is the first
|
|
24
|
+
// tabbable element (usually the "Back" button).
|
|
25
|
+
function focusSidebarElement(el, direction, focusSelector) {
|
|
26
|
+
let elementToFocus;
|
|
27
|
+
if (direction === 'back' && focusSelector) {
|
|
28
|
+
elementToFocus = el.querySelector(focusSelector);
|
|
29
|
+
}
|
|
30
|
+
if (direction !== null && !elementToFocus) {
|
|
31
|
+
const [firstTabbable] = _dom.focus.tabbable.find(el);
|
|
32
|
+
elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : el;
|
|
33
|
+
}
|
|
34
|
+
elementToFocus?.focus();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Navigation state that is updated when navigating back or forward. Helps us
|
|
38
|
+
// manage the animations and also focus.
|
|
39
|
+
function createNavState() {
|
|
40
|
+
let state = {
|
|
27
41
|
direction: null,
|
|
28
42
|
focusSelector: null
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (navState.direction === 'back' && navState.focusSelector) {
|
|
40
|
-
elementToFocus = wrapperRef.current.querySelector(navState.focusSelector);
|
|
41
|
-
}
|
|
42
|
-
if (navState.direction !== null && !elementToFocus) {
|
|
43
|
-
const [firstTabbable] = _dom.focus.tabbable.find(wrapperRef.current);
|
|
44
|
-
elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperRef.current;
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
get() {
|
|
46
|
+
return state;
|
|
47
|
+
},
|
|
48
|
+
navigate(direction, focusSelector = null) {
|
|
49
|
+
state = {
|
|
50
|
+
direction,
|
|
51
|
+
focusSelector: direction === 'forward' && focusSelector ? focusSelector : state.focusSelector
|
|
52
|
+
};
|
|
45
53
|
}
|
|
46
|
-
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function SidebarContentWrapper({
|
|
57
|
+
children
|
|
58
|
+
}) {
|
|
59
|
+
const navState = (0, _element.useContext)(SidebarNavigationContext);
|
|
60
|
+
const wrapperRef = (0, _element.useRef)();
|
|
61
|
+
const [navAnimation, setNavAnimation] = (0, _element.useState)(null);
|
|
62
|
+
(0, _element.useLayoutEffect)(() => {
|
|
63
|
+
const {
|
|
64
|
+
direction,
|
|
65
|
+
focusSelector
|
|
66
|
+
} = navState.get();
|
|
67
|
+
focusSidebarElement(wrapperRef.current, direction, focusSelector);
|
|
68
|
+
setNavAnimation(direction);
|
|
47
69
|
}, [navState]);
|
|
48
|
-
const wrapperCls = (0,
|
|
49
|
-
'slide-from-left':
|
|
50
|
-
'slide-from-right':
|
|
70
|
+
const wrapperCls = (0, _clsx.default)('edit-site-sidebar__screen-wrapper', {
|
|
71
|
+
'slide-from-left': navAnimation === 'back',
|
|
72
|
+
'slide-from-right': navAnimation === 'forward'
|
|
51
73
|
});
|
|
74
|
+
return (0, _react.createElement)("div", {
|
|
75
|
+
ref: wrapperRef,
|
|
76
|
+
className: wrapperCls
|
|
77
|
+
}, children);
|
|
78
|
+
}
|
|
79
|
+
function SidebarContent({
|
|
80
|
+
routeKey,
|
|
81
|
+
children
|
|
82
|
+
}) {
|
|
83
|
+
const [navState] = (0, _element.useState)(createNavState);
|
|
52
84
|
return (0, _react.createElement)(SidebarNavigationContext.Provider, {
|
|
53
|
-
value:
|
|
85
|
+
value: navState
|
|
54
86
|
}, (0, _react.createElement)("div", {
|
|
55
87
|
className: "edit-site-sidebar__content"
|
|
56
|
-
}, (0, _react.createElement)(
|
|
57
|
-
|
|
58
|
-
key: routeKey,
|
|
59
|
-
className: wrapperCls
|
|
88
|
+
}, (0, _react.createElement)(SidebarContentWrapper, {
|
|
89
|
+
key: routeKey
|
|
60
90
|
}, children)));
|
|
61
91
|
}
|
|
62
92
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_dom","SidebarNavigationContext","exports","createContext","focusSidebarElement","el","direction","focusSelector","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","createNavState","state","get","navigate","SidebarContentWrapper","children","navState","useContext","wrapperRef","useRef","navAnimation","setNavAnimation","useState","useLayoutEffect","current","wrapperCls","clsx","_react","createElement","ref","className","SidebarContent","routeKey","Provider","value","key"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nexport const SidebarNavigationContext = createContext( () => {} );\n// Focus a sidebar element after a navigation. The element to focus is either\n// specified by `focusSelector` (when navigating back) or it is the first\n// tabbable element (usually the \"Back\" button).\nfunction focusSidebarElement( el, direction, focusSelector ) {\n\tlet elementToFocus;\n\tif ( direction === 'back' && focusSelector ) {\n\t\telementToFocus = el.querySelector( focusSelector );\n\t}\n\tif ( direction !== null && ! elementToFocus ) {\n\t\tconst [ firstTabbable ] = focus.tabbable.find( el );\n\t\telementToFocus = firstTabbable ?? el;\n\t}\n\telementToFocus?.focus();\n}\n\n// Navigation state that is updated when navigating back or forward. Helps us\n// manage the animations and also focus.\nfunction createNavState() {\n\tlet state = {\n\t\tdirection: null,\n\t\tfocusSelector: null,\n\t};\n\n\treturn {\n\t\tget() {\n\t\t\treturn state;\n\t\t},\n\t\tnavigate( direction, focusSelector = null ) {\n\t\t\tstate = {\n\t\t\t\tdirection,\n\t\t\t\tfocusSelector:\n\t\t\t\t\tdirection === 'forward' && focusSelector\n\t\t\t\t\t\t? focusSelector\n\t\t\t\t\t\t: state.focusSelector,\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction SidebarContentWrapper( { children } ) {\n\tconst navState = useContext( SidebarNavigationContext );\n\tconst wrapperRef = useRef();\n\tconst [ navAnimation, setNavAnimation ] = useState( null );\n\n\tuseLayoutEffect( () => {\n\t\tconst { direction, focusSelector } = navState.get();\n\t\tfocusSidebarElement( wrapperRef.current, direction, focusSelector );\n\t\tsetNavAnimation( direction );\n\t}, [ navState ] );\n\n\tconst wrapperCls = clsx( 'edit-site-sidebar__screen-wrapper', {\n\t\t'slide-from-left': navAnimation === 'back',\n\t\t'slide-from-right': navAnimation === 'forward',\n\t} );\n\n\treturn (\n\t\t<div ref={ wrapperRef } className={ wrapperCls }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default function SidebarContent( { routeKey, children } ) {\n\tconst [ navState ] = useState( createNavState );\n\n\treturn (\n\t\t<SidebarNavigationContext.Provider value={ navState }>\n\t\t\t<div className=\"edit-site-sidebar__content\">\n\t\t\t\t<SidebarContentWrapper key={ routeKey }>\n\t\t\t\t\t{ children }\n\t\t\t\t</SidebarContentWrapper>\n\t\t\t</div>\n\t\t</SidebarNavigationContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,IAAA,GAAAF,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAUO,MAAMG,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,IAAAE,sBAAa,EAAE,MAAM,CAAC,CAAE,CAAC;AACjE;AACA;AACA;AACA,SAASC,mBAAmBA,CAAEC,EAAE,EAAEC,SAAS,EAAEC,aAAa,EAAG;EAC5D,IAAIC,cAAc;EAClB,IAAKF,SAAS,KAAK,MAAM,IAAIC,aAAa,EAAG;IAC5CC,cAAc,GAAGH,EAAE,CAACI,aAAa,CAAEF,aAAc,CAAC;EACnD;EACA,IAAKD,SAAS,KAAK,IAAI,IAAI,CAAEE,cAAc,EAAG;IAC7C,MAAM,CAAEE,aAAa,CAAE,GAAGC,UAAK,CAACC,QAAQ,CAACC,IAAI,CAAER,EAAG,CAAC;IACnDG,cA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EAAGX,UAAY;IAACY,SAAS,EAAGL;EAAY,GAC7CV,QACE,CAAC;AAER;AAEe,SAASgB,cAAcA,CAAE;EAAEC,QAAQ;EAAEjB;AAAS,CAAC,EAAG;EAChE,MAAM,CAAEC,QAAQ,CAAE,GAAG,IAAAM,iBAAQ,EAAEZ,cAAe,CAAC;EAE/C,OACC,IAAAiB,MAAA,CAAAC,aAAA,EAAC/B,wBAAwB,CAACoC,QAAQ;IAACC,KAAK,EAAGlB;EAAU,GACpD,IAAAW,MAAA,CAAAC,aAAA;IAAKE,SAAS,EAAC;EAA4B,GAC1C,IAAAH,MAAA,CAAAC,aAAA,EAACd,qBAAqB;IAACqB,GAAG,EAAGH;EAAU,GACpCjB,QACoB,CACnB,CAC6B,CAAC;AAEtC","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarButton;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
/**
|
|
12
12
|
* External dependencies
|
|
@@ -19,7 +19,7 @@ var _components = require("@wordpress/components");
|
|
|
19
19
|
function SidebarButton(props) {
|
|
20
20
|
return (0, _react.createElement)(_components.Button, {
|
|
21
21
|
...props,
|
|
22
|
-
className: (0,
|
|
22
|
+
className: (0, _clsx.default)('edit-site-sidebar-button', props.className)
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","SidebarButton","props","_react","createElement","Button","className","clsx"],"sources":["@wordpress/edit-site/src/components/sidebar-button/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\n\nexport default function SidebarButton( props ) {\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'edit-site-sidebar-button', props.className ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASE,aAAaA,CAAEC,KAAK,EAAG;EAC9C,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,WAAA,CAAAK,MAAM;IAAA,GACDH,KAAK;IACVI,SAAS,EAAG,IAAAC,aAAI,EAAE,0BAA0B,EAAEL,KAAK,CAACI,SAAU;EAAG,CACjE,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = DataViewItem;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _router = require("@wordpress/router");
|
|
11
11
|
var _components = require("@wordpress/components");
|
|
12
12
|
var _dataviews = require("@wordpress/dataviews");
|
|
@@ -53,7 +53,7 @@ function DataViewItem({
|
|
|
53
53
|
});
|
|
54
54
|
return (0, _react.createElement)(_components.__experimentalHStack, {
|
|
55
55
|
justify: "flex-start",
|
|
56
|
-
className: (0,
|
|
56
|
+
className: (0, _clsx.default)('edit-site-sidebar-dataviews-dataview-item', {
|
|
57
57
|
'is-selected': isActive
|
|
58
58
|
})
|
|
59
59
|
}, (0, _react.createElement)(_sidebarNavigationItem.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_router","_components","_dataviews","_link","_sidebarNavigationItem","_lockUnlock","useLocation","unlock","routerPrivateApis","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","params","path","layout","iconToUse","VIEW_LAYOUTS","find","v","linkInfo","useLink","activeView","_react","createElement","__experimentalHStack","justify","className","clsx","default","undefined"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst {\n\t\tparams: { path, layout },\n\t} = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tconst linkInfo = useLink( {\n\t\tpath,\n\t\tlayout,\n\t\tactiveView: isCustom ? customViewId : slug,\n\t\tisCustom: isCustom ? 'true' : 'false',\n\t} );\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\t{ ...linkInfo }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA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 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationItem;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _icons = require("@wordpress/icons");
|
|
@@ -40,7 +40,9 @@ function SidebarNavigationItem({
|
|
|
40
40
|
...props
|
|
41
41
|
}) {
|
|
42
42
|
const history = useHistory();
|
|
43
|
-
const
|
|
43
|
+
const {
|
|
44
|
+
navigate
|
|
45
|
+
} = (0, _element.useContext)(_sidebar.SidebarNavigationContext);
|
|
44
46
|
|
|
45
47
|
// If there is no custom click handler, create one that navigates to `path`.
|
|
46
48
|
function handleClick(e) {
|
|
@@ -56,7 +58,7 @@ function SidebarNavigationItem({
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
return (0, _react.createElement)(_components.__experimentalItem, {
|
|
59
|
-
className: (0,
|
|
61
|
+
className: (0, _clsx.default)('edit-site-sidebar-navigation-item', {
|
|
60
62
|
'with-suffix': !withChevron && suffix
|
|
61
63
|
}, className),
|
|
62
64
|
onClick: handleClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_router","_element","_lockUnlock","_sidebar","useHistory","unlock","routerPrivateApis","SidebarNavigationItem","className","icon","withChevron","suffix","path","onClick","children","props","history","navigate","useContext","SidebarNavigationContext","handleClick","e","preventDefault","push","_react","createElement","__experimentalItem","clsx","id","__experimentalHStack","justify","Icon","style","fill","size","FlexBlock","isRTL","chevronLeftSmall","chevronRightSmall"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tpath,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t// If there is no custom click handler, create one that navigates to `path`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( path ) {\n\t\t\te.preventDefault();\n\t\t\thistory.push( { path } );\n\t\t\tnavigate( 'forward', `[id=\"${ path }\"]` );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ handleClick }\n\t\t\tid={ path }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site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A,CAAA6B,kBAAI;IACJlB,SAAS,EAAG,IAAAmB,aAAI,EACf,mCAAmC,EACnC;MAAE,aAAa,EAAE,CAAEjB,WAAW,IAAIC;IAAO,CAAC,EAC1CH,SACD,CAAG;IACHK,OAAO,EAAGO,WAAa;IACvBQ,EAAE,EAAGhB,IAAM;IAAA,GACNG;EAAK,GAEV,IAAAS,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAgC,oBAAM;IAACC,OAAO,EAAC;EAAY,GACzBrB,IAAI,IACL,IAAAe,MAAA,CAAAC,aAAA,EAAC1B,MAAA,CAAAgC,IAAI;IACJC,KAAK,EAAG;MAAEC,IAAI,EAAE;IAAe,CAAG;IAClCxB,IAAI,EAAGA,IAAM;IACbyB,IAAI,EAAG;EAAI,CACX,CACD,EACD,IAAAV,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAsC,SAAS,QAAGrB,QAAqB,CAAC,EACjCJ,WAAW,IACZ,IAAAc,MAAA,CAAAC,aAAA,EAAC1B,MAAA,CAAAgC,IAAI;IACJtB,IAAI,EAAG,IAAA2B,WAAK,EAAC,CAAC,GAAGC,uBAAgB,GAAGC,wBAAmB;IACvD9B,SAAS,EAAC,wDAAwD;IAClE0B,IAAI,EAAG;EAAI,CACX,CACD,EACC,CAAExB,WAAW,IAAIC,MACZ,CACH,CAAC;AAET","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreen;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _icons = require("@wordpress/icons");
|
|
@@ -35,33 +35,6 @@ const {
|
|
|
35
35
|
useHistory,
|
|
36
36
|
useLocation
|
|
37
37
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
38
|
-
function getBackPath(params) {
|
|
39
|
-
// From a data view path we navigate back to root
|
|
40
|
-
if (params.path) {
|
|
41
|
-
return {};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// From edit screen for a post we navigate back to post-type specific data view
|
|
45
|
-
if (params.postType === 'page') {
|
|
46
|
-
return {
|
|
47
|
-
path: '/page',
|
|
48
|
-
postId: params.postId
|
|
49
|
-
};
|
|
50
|
-
} else if (params.postType === 'wp_template') {
|
|
51
|
-
return {
|
|
52
|
-
path: '/wp_template',
|
|
53
|
-
postId: params.postId
|
|
54
|
-
};
|
|
55
|
-
} else if (params.postType === 'wp_navigation') {
|
|
56
|
-
return {
|
|
57
|
-
path: '/navigation',
|
|
58
|
-
postId: params.postId
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Go back to root by default
|
|
63
|
-
return {};
|
|
64
|
-
}
|
|
65
38
|
function SidebarNavigationScreen({
|
|
66
39
|
isRoot,
|
|
67
40
|
title,
|
|
@@ -91,10 +64,13 @@ function SidebarNavigationScreen({
|
|
|
91
64
|
}, []);
|
|
92
65
|
const location = useLocation();
|
|
93
66
|
const history = useHistory();
|
|
94
|
-
const
|
|
67
|
+
const {
|
|
68
|
+
navigate
|
|
69
|
+
} = (0, _element.useContext)(_sidebar.SidebarNavigationContext);
|
|
70
|
+
const backPath = backPathProp !== null && backPathProp !== void 0 ? backPathProp : location.state?.backPath;
|
|
95
71
|
const icon = (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft;
|
|
96
72
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.__experimentalVStack, {
|
|
97
|
-
className: (0,
|
|
73
|
+
className: (0, _clsx.default)('edit-site-sidebar-navigation-screen__main', {
|
|
98
74
|
'has-footer': !!footer
|
|
99
75
|
}),
|
|
100
76
|
spacing: 0,
|
|
@@ -105,8 +81,6 @@ function SidebarNavigationScreen({
|
|
|
105
81
|
className: "edit-site-sidebar-navigation-screen__title-icon"
|
|
106
82
|
}, !isRoot && (0, _react.createElement)(_sidebarButton.default, {
|
|
107
83
|
onClick: () => {
|
|
108
|
-
var _ref;
|
|
109
|
-
const backPath = (_ref = backPathProp !== null && backPathProp !== void 0 ? backPathProp : location.state?.backPath) !== null && _ref !== void 0 ? _ref : getBackPath(location.params);
|
|
110
84
|
history.push(backPath);
|
|
111
85
|
navigate('back');
|
|
112
86
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","_react","createElement","Fragment","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","default","onClick","push","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AAIA,IAAAY,QAAA,GAAAZ,OAAA;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAUA,MAAM;EAAEa,UAAU;EAAEC;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEhD,SAASC,uBAAuBA,CAAE;EAChDC,MAAM;EACNC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,OAAO;EACPC,MAAM;EACNC,WAAW;EACXC,QAAQ,EAAEC;AACX,CAAC,EAAG;EACH,MAAM;IAAEC,aAAa;IAAEC,iBAAiB;IAAEC;EAAoB,CA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GG,SAAS,EAAC;EAAkD,GAC5DjC,WACA,CACH,EACCF,OACE,CACE,CAAC,EACPC,MAAM,IACP,IAAA8B,MAAA,CAAAC,aAAA;IAAQG,SAAS,EAAC;EAA6C,GAC5DlC,MACK,CAER,CAAC;AAEL","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenDetailsPanelRow;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
/**
|
|
12
12
|
* External dependencies
|
|
@@ -26,7 +26,7 @@ function SidebarNavigationScreenDetailsPanelRow({
|
|
|
26
26
|
key: label,
|
|
27
27
|
spacing: 5,
|
|
28
28
|
alignment: "left",
|
|
29
|
-
className: (0,
|
|
29
|
+
className: (0, _clsx.default)('edit-site-sidebar-navigation-details-screen-panel__row', className),
|
|
30
30
|
...extraProps
|
|
31
31
|
}, children);
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","SidebarNavigationScreenDetailsPanelRow","label","children","className","extraProps","_react","createElement","__experimentalHStack","key","spacing","alignment","clsx"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\n\nexport default function SidebarNavigationScreenDetailsPanelRow( {\n\tlabel,\n\tchildren,\n\tclassName,\n\t...extraProps\n} ) {\n\treturn (\n\t\t<HStack\n\t\t\tkey={ label }\n\t\t\tspacing={ 5 }\n\t\t\talignment=\"left\"\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-details-screen-panel__row',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...extraProps }\n\t\t>\n\t\t\t{ children }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASE,sCAAsCA,CAAE;EAC/DC,KAAK;EACLC,QAAQ;EACRC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACP,WAAA,CAAAQ,oBAAM;IACNC,GAAG,EAAGP,KAAO;IACbQ,OAAO,EAAG,CAAG;IACbC,SAAS,EAAC,MAAM;IAChBP,SAAS,EAAG,IAAAQ,aAAI,EACf,wDAAwD,EACxDR,SACD,CAAG;IAAA,GACEC;EAAU,GAEbF,QACK,CAAC;AAEX","ignoreList":[]}
|
|
@@ -99,7 +99,9 @@ function SidebarNavigationScreenGlobalStylesContent() {
|
|
|
99
99
|
gap: gap
|
|
100
100
|
})));
|
|
101
101
|
}
|
|
102
|
-
function SidebarNavigationScreenGlobalStyles(
|
|
102
|
+
function SidebarNavigationScreenGlobalStyles({
|
|
103
|
+
backPath
|
|
104
|
+
}) {
|
|
103
105
|
const {
|
|
104
106
|
revisions,
|
|
105
107
|
isLoading: isLoadingRevisions
|
|
@@ -167,6 +169,7 @@ function SidebarNavigationScreenGlobalStyles() {
|
|
|
167
169
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_sidebarNavigationScreen.default, {
|
|
168
170
|
title: (0, _i18n.__)('Styles'),
|
|
169
171
|
description: (0, _i18n.__)('Choose a different style combination for the theme styles.'),
|
|
172
|
+
backPath: backPath,
|
|
170
173
|
content: (0, _react.createElement)(SidebarNavigationScreenGlobalStylesContent, null),
|
|
171
174
|
footer: shouldShowGlobalStylesFooter && (0, _react.createElement)(_sidebarNavigationScreenDetailsFooter.default, {
|
|
172
175
|
record: revisions?.[0],
|