@wordpress/edit-site 5.30.0 → 5.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/block-editor/editor-canvas.js +24 -4
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +15 -4
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +1 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +12 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -2
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +38 -0
- package/build/components/global-styles/background-panel.js.map +1 -0
- package/build/components/global-styles/color-palette-panel.js +0 -9
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +53 -17
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +4 -3
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +3 -2
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +44 -10
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +22 -4
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +50 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +3 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +2 -2
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-iframe.js +0 -1
- package/build/components/global-styles/preview-iframe.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +2 -2
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/root-menu.js +8 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +34 -0
- package/build/components/global-styles/screen-background.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +2 -2
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +5 -10
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +3 -37
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +6 -11
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -2
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +3 -1
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
- package/build/components/global-styles/typography-example.js.map +1 -0
- package/build/components/global-styles/typography-preview.js +3 -1
- package/build/components/global-styles/typography-preview.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/utils.js +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +13 -7
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +34 -37
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/header-edit-mode/index.js +2 -1
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/global.js +17 -3
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/layout/animation.js +129 -0
- package/build/components/layout/animation.js.map +1 -0
- package/build/components/layout/index.js +9 -17
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +22 -22
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-pages/index.js +24 -27
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +6 -1
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/index.js +19 -32
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +16 -58
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +9 -9
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates-template-parts/actions.js +54 -41
- package/build/components/page-templates-template-parts/actions.js.map +1 -1
- package/build/components/page-templates-template-parts/index.js +31 -69
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +12 -1
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/save-button/index.js +45 -16
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +8 -112
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +14 -9
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -8
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/build/components/sidebar-dataviews/custom-dataviews-list.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-dataviews/default-views.js +3 -3
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +5 -4
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +7 -17
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +32 -18
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +18 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +4 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -5
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +5 -1
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/style-book/index.js +1 -1
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +44 -27
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +11 -2
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/store/selectors.js +1 -9
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +5 -3
- 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/math.js +98 -0
- package/build/utils/math.js.map +1 -0
- package/build-module/components/block-editor/editor-canvas.js +24 -4
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +15 -4
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +13 -4
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +31 -0
- package/build-module/components/global-styles/background-panel.js.map +1 -0
- package/build-module/components/global-styles/color-palette-panel.js +0 -8
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +54 -18
- 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 +4 -3
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +4 -3
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +44 -10
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +22 -4
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/header.js +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +48 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +3 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +2 -2
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js +0 -1
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +2 -2
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +9 -3
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +26 -0
- package/build-module/components/global-styles/screen-background.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +2 -2
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +5 -10
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +4 -38
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -11
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +5 -2
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +3 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
- package/build-module/components/global-styles/typography-example.js.map +1 -0
- package/build-module/components/global-styles/typography-preview.js +3 -1
- package/build-module/components/global-styles/typography-preview.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/utils.js +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +13 -7
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +35 -38
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +2 -1
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/global.js +17 -3
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/layout/animation.js +122 -0
- package/build-module/components/layout/animation.js.map +1 -0
- package/build-module/components/layout/index.js +9 -17
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +22 -22
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-pages/index.js +25 -28
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +6 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/index.js +21 -34
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +14 -55
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +9 -9
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates-template-parts/actions.js +54 -40
- package/build-module/components/page-templates-template-parts/actions.js.map +1 -1
- package/build-module/components/page-templates-template-parts/index.js +34 -72
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +12 -1
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/save-button/index.js +46 -17
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +10 -114
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +14 -9
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -8
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.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-dataviews/default-views.js +4 -4
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +5 -4
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -2
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +10 -20
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -2
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +33 -19
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -5
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +5 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/style-book/index.js +1 -1
- 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 +3 -3
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +44 -27
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +11 -2
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/store/selectors.js +1 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +4 -2
- 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/math.js +92 -0
- package/build-module/utils/math.js.map +1 -0
- package/build-style/style-rtl.css +146 -130
- package/build-style/style.css +146 -130
- package/package.json +44 -44
- package/src/components/block-editor/editor-canvas.js +34 -9
- package/src/components/block-editor/site-editor-canvas.js +10 -7
- package/src/components/block-editor/use-site-editor-settings.js +0 -2
- package/src/components/editor/index.js +11 -4
- package/src/components/editor-canvas-container/index.js +0 -1
- package/src/components/global-styles/background-panel.js +34 -0
- package/src/components/global-styles/color-palette-panel.js +0 -11
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +77 -31
- package/src/components/global-styles/font-library-modal/font-collection.js +4 -3
- package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/src/components/global-styles/font-library-modal/style.scss +15 -6
- package/src/components/global-styles/font-library-modal/upload-fonts.js +53 -8
- package/src/components/global-styles/font-library-modal/utils/index.js +21 -8
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +4 -0
- package/src/components/global-styles/header.js +1 -1
- package/src/components/global-styles/hooks.js +68 -1
- package/src/components/global-styles/palette.js +3 -1
- package/src/components/global-styles/preview-colors.js +2 -2
- package/src/components/global-styles/preview-iframe.js +0 -1
- package/src/components/global-styles/preview-styles.js +2 -2
- package/src/components/global-styles/root-menu.js +12 -1
- package/src/components/global-styles/screen-background.js +29 -0
- package/src/components/global-styles/screen-color-palette.js +2 -2
- package/src/components/global-styles/screen-colors.js +4 -15
- package/src/components/global-styles/screen-style-variations.js +4 -36
- package/src/components/global-styles/screen-typography.js +6 -20
- package/src/components/global-styles/style-variations-container.js +2 -1
- package/src/components/global-styles/style.scss +15 -10
- package/src/components/global-styles/typography-elements.js +5 -1
- package/src/components/global-styles/{preview-typography.js → typography-example.js} +3 -1
- package/src/components/global-styles/typography-preview.js +3 -1
- package/src/components/global-styles/ui.js +5 -0
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/global-styles/variations/style.scss +32 -23
- package/src/components/global-styles/variations/variations-color.js +12 -6
- package/src/components/global-styles/variations/variations-typography.js +41 -60
- package/src/components/header-edit-mode/index.js +1 -0
- package/src/components/header-edit-mode/style.scss +28 -17
- package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +4 -0
- package/src/components/keyboard-shortcuts/global.js +16 -4
- package/src/components/layout/animation.js +122 -0
- package/src/components/layout/index.js +12 -27
- package/src/components/layout/router.js +26 -25
- package/src/components/layout/style.scss +2 -0
- package/src/components/page-pages/index.js +33 -54
- package/src/components/page-patterns/delete-category-menu-item.js +7 -0
- package/src/components/page-patterns/index.js +22 -31
- package/src/components/page-patterns/search-items.js +13 -58
- package/src/components/page-patterns/use-patterns.js +17 -10
- package/src/components/page-templates-template-parts/actions.js +106 -91
- package/src/components/page-templates-template-parts/index.js +41 -93
- package/src/components/page-templates-template-parts/style.scss +5 -0
- package/src/components/plugin-template-setting-panel/index.js +14 -1
- package/src/components/save-button/index.js +55 -26
- package/src/components/save-hub/index.js +20 -164
- package/src/components/save-panel/index.js +24 -17
- package/src/components/sidebar/index.js +2 -8
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/src/components/sidebar-dataviews/dataview-item.js +2 -2
- package/src/components/sidebar-dataviews/default-views.js +12 -4
- package/src/components/sidebar-dataviews/index.js +5 -4
- package/src/components/sidebar-edit-mode/index.js +0 -2
- package/src/components/sidebar-edit-mode/page-panels/index.js +31 -62
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
- package/src/components/sidebar-edit-mode/template-panel/index.js +33 -24
- package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
- package/src/components/sidebar-navigation-screen/style.scss +21 -9
- package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +29 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +2 -3
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +11 -9
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -3
- package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
- package/src/components/sidebar-navigation-screen-template/index.js +6 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/src/components/style-book/index.js +1 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +3 -19
- package/src/components/template-actions/index.js +63 -46
- package/src/components/welcome-guide/editor.js +9 -6
- package/src/hooks/index.js +0 -1
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +21 -4
- package/src/store/selectors.js +3 -15
- package/src/style.scss +0 -2
- package/src/utils/constants.js +4 -2
- package/src/utils/get-is-list-page.js +1 -1
- package/src/utils/math.js +93 -0
- package/build/components/actions/index.js +0 -321
- package/build/components/actions/index.js.map +0 -1
- package/build/components/global-styles/preview-typography.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -42
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +0 -50
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
- package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +0 -132
- package/build/components/sidebar-navigation-screen-templates/index.js.map +0 -1
- package/build/hooks/template-part-edit.js +0 -82
- package/build/hooks/template-part-edit.js.map +0 -1
- package/build/store/utils.js +0 -71
- package/build/store/utils.js.map +0 -1
- package/build-module/components/actions/index.js +0 -310
- package/build-module/components/actions/index.js.map +0 -1
- package/build-module/components/global-styles/preview-typography.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +0 -42
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +0 -124
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +0 -1
- package/build-module/hooks/template-part-edit.js +0 -75
- package/build-module/hooks/template-part-edit.js.map +0 -1
- package/build-module/store/utils.js +0 -64
- package/build-module/store/utils.js.map +0 -1
- package/src/components/actions/index.js +0 -411
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -37
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +0 -49
- package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
- package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
- package/src/components/sidebar-navigation-screen-templates/index.js +0 -156
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -9
- package/src/hooks/template-part-edit.js +0 -89
- package/src/store/test/utils.js +0 -191
- package/src/store/utils.js +0 -69
|
@@ -134,9 +134,9 @@ export function unloadFontFaceInBrowser( fontFace, removeFrom = 'all' ) {
|
|
|
134
134
|
const unloadFontFace = ( fonts ) => {
|
|
135
135
|
fonts.forEach( ( f ) => {
|
|
136
136
|
if (
|
|
137
|
-
f.family === formatFontFaceName( fontFace
|
|
138
|
-
f.weight === fontFace
|
|
139
|
-
f.style === fontFace
|
|
137
|
+
f.family === formatFontFaceName( fontFace?.fontFamily ) &&
|
|
138
|
+
f.weight === fontFace?.fontWeight &&
|
|
139
|
+
f.style === fontFace?.fontStyle
|
|
140
140
|
) {
|
|
141
141
|
fonts.delete( f );
|
|
142
142
|
}
|
|
@@ -234,10 +234,23 @@ export function makeFontFacesFormData( font ) {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
export async function batchInstallFontFaces( fontFamilyId, fontFacesData ) {
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
const responses = [];
|
|
238
|
+
|
|
239
|
+
/*
|
|
240
|
+
* Uses the same response format as Promise.allSettled, but executes requests in sequence to work
|
|
241
|
+
* around a race condition that can cause an error when the fonts directory doesn't exist yet.
|
|
242
|
+
*/
|
|
243
|
+
for ( const faceData of fontFacesData ) {
|
|
244
|
+
try {
|
|
245
|
+
const response = await fetchInstallFontFace(
|
|
246
|
+
fontFamilyId,
|
|
247
|
+
faceData
|
|
248
|
+
);
|
|
249
|
+
responses.push( { status: 'fulfilled', value: response } );
|
|
250
|
+
} catch ( error ) {
|
|
251
|
+
responses.push( { status: 'rejected', reason: error } );
|
|
252
|
+
}
|
|
253
|
+
}
|
|
241
254
|
|
|
242
255
|
const results = {
|
|
243
256
|
errors: [],
|
|
@@ -259,7 +272,7 @@ export async function batchInstallFontFaces( fontFamilyId, fontFacesData ) {
|
|
|
259
272
|
// Handle network errors or other fetch-related errors
|
|
260
273
|
results.errors.push( {
|
|
261
274
|
data: fontFacesData[ index ],
|
|
262
|
-
message:
|
|
275
|
+
message: result.reason.message,
|
|
263
276
|
} );
|
|
264
277
|
}
|
|
265
278
|
} );
|
|
@@ -87,6 +87,10 @@ export function formatFontFamily( input ) {
|
|
|
87
87
|
* formatFontFaceName(", 'Open Sans', 'Helvetica Neue', sans-serif") => "Open Sans"
|
|
88
88
|
*/
|
|
89
89
|
export function formatFontFaceName( input ) {
|
|
90
|
+
if ( ! input ) {
|
|
91
|
+
return '';
|
|
92
|
+
}
|
|
93
|
+
|
|
90
94
|
let output = input.trim();
|
|
91
95
|
if ( output.includes( ',' ) ) {
|
|
92
96
|
output = output
|
|
@@ -9,14 +9,21 @@ import a11yPlugin from 'colord/plugins/a11y';
|
|
|
9
9
|
*/
|
|
10
10
|
import { store as blocksStore } from '@wordpress/blocks';
|
|
11
11
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
12
|
+
import { useContext } from '@wordpress/element';
|
|
13
|
+
import { __ } from '@wordpress/i18n';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Internal dependencies
|
|
15
17
|
*/
|
|
18
|
+
import { mergeBaseAndUserConfigs } from './global-styles-provider';
|
|
19
|
+
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
20
|
+
import { getFontFamilies } from './utils';
|
|
16
21
|
import { unlock } from '../../lock-unlock';
|
|
17
22
|
import { useSelect } from '@wordpress/data';
|
|
18
23
|
|
|
19
|
-
const { useGlobalSetting, useGlobalStyle } = unlock(
|
|
24
|
+
const { useGlobalSetting, useGlobalStyle, GlobalStylesContext } = unlock(
|
|
25
|
+
blockEditorPrivateApis
|
|
26
|
+
);
|
|
20
27
|
|
|
21
28
|
// Enable colord's a11y plugin.
|
|
22
29
|
extend( [ a11yPlugin ] );
|
|
@@ -92,3 +99,63 @@ export function useSupportedStyles( name, element ) {
|
|
|
92
99
|
|
|
93
100
|
return supportedPanels;
|
|
94
101
|
}
|
|
102
|
+
|
|
103
|
+
export function useColorVariations() {
|
|
104
|
+
const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {
|
|
105
|
+
property: 'color',
|
|
106
|
+
} );
|
|
107
|
+
/*
|
|
108
|
+
* Filter out variations with no settings or styles.
|
|
109
|
+
*/
|
|
110
|
+
return colorVariations?.length
|
|
111
|
+
? colorVariations.filter( ( variation ) => {
|
|
112
|
+
const { settings, styles, title } = variation;
|
|
113
|
+
return (
|
|
114
|
+
title === __( 'Default' ) || // Always preseve the default variation.
|
|
115
|
+
Object.keys( settings ).length > 0 ||
|
|
116
|
+
Object.keys( styles ).length > 0
|
|
117
|
+
);
|
|
118
|
+
} )
|
|
119
|
+
: [];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function useTypographyVariations() {
|
|
123
|
+
const typographyVariations =
|
|
124
|
+
useCurrentMergeThemeStyleVariationsWithUserConfig( {
|
|
125
|
+
property: 'typography',
|
|
126
|
+
} );
|
|
127
|
+
|
|
128
|
+
const { base } = useContext( GlobalStylesContext );
|
|
129
|
+
/*
|
|
130
|
+
* Filter duplicate variations based on whether the variaitons
|
|
131
|
+
* have different heading and body font families.
|
|
132
|
+
*/
|
|
133
|
+
return typographyVariations?.length
|
|
134
|
+
? Object.values(
|
|
135
|
+
typographyVariations.reduce( ( acc, variation ) => {
|
|
136
|
+
const [ bodyFontFamily, headingFontFamily ] =
|
|
137
|
+
getFontFamilies(
|
|
138
|
+
mergeBaseAndUserConfigs( base, variation )
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
// Always preseve the default variation.
|
|
142
|
+
if ( variation?.title === 'Default' ) {
|
|
143
|
+
acc[
|
|
144
|
+
`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
|
|
145
|
+
] = variation;
|
|
146
|
+
} else if (
|
|
147
|
+
headingFontFamily?.name &&
|
|
148
|
+
bodyFontFamily?.name &&
|
|
149
|
+
! acc[
|
|
150
|
+
`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
|
|
151
|
+
]
|
|
152
|
+
) {
|
|
153
|
+
acc[
|
|
154
|
+
`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
|
|
155
|
+
] = variation;
|
|
156
|
+
}
|
|
157
|
+
return acc;
|
|
158
|
+
}, {} )
|
|
159
|
+
)
|
|
160
|
+
: [];
|
|
161
|
+
}
|
|
@@ -87,7 +87,9 @@ function Palette( { name } ) {
|
|
|
87
87
|
</ColorIndicatorWrapper>
|
|
88
88
|
) ) }
|
|
89
89
|
</ZStack>
|
|
90
|
-
<FlexItem
|
|
90
|
+
<FlexItem className="edit-site-global-styles-screen-colors__palette-count">
|
|
91
|
+
{ paletteButtonText }
|
|
92
|
+
</FlexItem>
|
|
91
93
|
</HStack>
|
|
92
94
|
</NavigationButtonAsItem>
|
|
93
95
|
</ItemGroup>
|
|
@@ -40,7 +40,7 @@ const StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {
|
|
|
40
40
|
} }
|
|
41
41
|
>
|
|
42
42
|
<HStack
|
|
43
|
-
spacing={
|
|
43
|
+
spacing={ 5 * ratio }
|
|
44
44
|
justify="center"
|
|
45
45
|
style={ {
|
|
46
46
|
height: '100%',
|
|
@@ -48,7 +48,7 @@ const StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {
|
|
|
48
48
|
} }
|
|
49
49
|
>
|
|
50
50
|
<HighlightedColors
|
|
51
|
-
normalizedColorSwatchSize={
|
|
51
|
+
normalizedColorSwatchSize={ 56 }
|
|
52
52
|
ratio={ ratio }
|
|
53
53
|
/>
|
|
54
54
|
</HStack>
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
*/
|
|
14
14
|
import { unlock } from '../../lock-unlock';
|
|
15
15
|
import { useStylesPreviewColors } from './hooks';
|
|
16
|
-
import
|
|
16
|
+
import TypographyExample from './typography-example';
|
|
17
17
|
import HighlightedColors from './highlighted-colors';
|
|
18
18
|
import PreviewIframe from './preview-iframe';
|
|
19
19
|
|
|
@@ -89,7 +89,7 @@ const PreviewStyles = ( { label, isFocused, withHoverView, variation } ) => {
|
|
|
89
89
|
overflow: 'hidden',
|
|
90
90
|
} }
|
|
91
91
|
>
|
|
92
|
-
<
|
|
92
|
+
<TypographyExample
|
|
93
93
|
fontSize={ 65 * ratio }
|
|
94
94
|
variation={ variation }
|
|
95
95
|
/>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
5
|
-
import { typography, color, layout } from '@wordpress/icons';
|
|
5
|
+
import { typography, color, layout, image } from '@wordpress/icons';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
8
|
|
|
@@ -18,6 +18,7 @@ const {
|
|
|
18
18
|
useHasColorPanel,
|
|
19
19
|
useGlobalSetting,
|
|
20
20
|
useSettingsForBlockElement,
|
|
21
|
+
useHasBackgroundPanel,
|
|
21
22
|
} = unlock( blockEditorPrivateApis );
|
|
22
23
|
|
|
23
24
|
function RootMenu() {
|
|
@@ -27,6 +28,7 @@ function RootMenu() {
|
|
|
27
28
|
const hasColorPanel = useHasColorPanel( settings );
|
|
28
29
|
const hasDimensionsPanel = useHasDimensionsPanel( settings );
|
|
29
30
|
const hasLayoutPanel = hasDimensionsPanel;
|
|
31
|
+
const hasBackgroundPanel = useHasBackgroundPanel( settings );
|
|
30
32
|
|
|
31
33
|
return (
|
|
32
34
|
<>
|
|
@@ -58,6 +60,15 @@ function RootMenu() {
|
|
|
58
60
|
{ __( 'Layout' ) }
|
|
59
61
|
</NavigationButtonAsItem>
|
|
60
62
|
) }
|
|
63
|
+
{ hasBackgroundPanel && (
|
|
64
|
+
<NavigationButtonAsItem
|
|
65
|
+
icon={ image }
|
|
66
|
+
path="/background"
|
|
67
|
+
aria-label={ __( 'Background styles' ) }
|
|
68
|
+
>
|
|
69
|
+
{ __( 'Background' ) }
|
|
70
|
+
</NavigationButtonAsItem>
|
|
71
|
+
) }
|
|
61
72
|
</ItemGroup>
|
|
62
73
|
</>
|
|
63
74
|
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import BackgroundPanel from './background-panel';
|
|
11
|
+
import ScreenHeader from './header';
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
|
|
14
|
+
const { useHasBackgroundPanel, useGlobalSetting } = unlock(
|
|
15
|
+
blockEditorPrivateApis
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
function ScreenBackground() {
|
|
19
|
+
const [ settings ] = useGlobalSetting( '' );
|
|
20
|
+
const hasBackgroundPanel = useHasBackgroundPanel( settings );
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<ScreenHeader title={ __( 'Background' ) } />
|
|
24
|
+
{ hasBackgroundPanel && <BackgroundPanel /> }
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default ScreenBackground;
|
|
@@ -25,8 +25,8 @@ function ScreenColorPalette( { name } ) {
|
|
|
25
25
|
/>
|
|
26
26
|
<Tabs>
|
|
27
27
|
<Tabs.TabList>
|
|
28
|
-
<Tabs.Tab tabId="solid">Solid</Tabs.Tab>
|
|
29
|
-
<Tabs.Tab tabId="gradient">Gradient</Tabs.Tab>
|
|
28
|
+
<Tabs.Tab tabId="solid">{ __( 'Solid' ) }</Tabs.Tab>
|
|
29
|
+
<Tabs.Tab tabId="gradient">{ __( 'Gradient' ) }</Tabs.Tab>
|
|
30
30
|
</Tabs.TabList>
|
|
31
31
|
<Tabs.TabPanel tabId="solid" focusable={ false }>
|
|
32
32
|
<ColorPalettePanel name={ name } />
|
|
@@ -12,7 +12,6 @@ import ScreenHeader from './header';
|
|
|
12
12
|
import Palette from './palette';
|
|
13
13
|
import { unlock } from '../../lock-unlock';
|
|
14
14
|
import ColorVariations from './variations/variations-color';
|
|
15
|
-
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
16
15
|
|
|
17
16
|
const {
|
|
18
17
|
useGlobalStyle,
|
|
@@ -31,28 +30,18 @@ function ScreenColors() {
|
|
|
31
30
|
const [ rawSettings ] = useGlobalSetting( '' );
|
|
32
31
|
const settings = useSettingsForBlockElement( rawSettings );
|
|
33
32
|
|
|
34
|
-
const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {
|
|
35
|
-
property: 'color',
|
|
36
|
-
filter: ( variation ) =>
|
|
37
|
-
variation?.settings?.color &&
|
|
38
|
-
Object.keys( variation?.settings?.color ).length,
|
|
39
|
-
} );
|
|
40
33
|
return (
|
|
41
34
|
<>
|
|
42
35
|
<ScreenHeader
|
|
43
36
|
title={ __( 'Colors' ) }
|
|
44
37
|
description={ __(
|
|
45
|
-
'
|
|
38
|
+
'Palette colors and the application of those colors on site elements.'
|
|
46
39
|
) }
|
|
47
40
|
/>
|
|
48
|
-
<div className="edit-site-global-styles-screen
|
|
49
|
-
<VStack spacing={
|
|
50
|
-
{
|
|
51
|
-
<ColorVariations variations={ colorVariations } />
|
|
52
|
-
) }
|
|
53
|
-
|
|
41
|
+
<div className="edit-site-global-styles-screen">
|
|
42
|
+
<VStack spacing={ 7 }>
|
|
43
|
+
<ColorVariations title={ __( 'Presets' ) } />
|
|
54
44
|
<Palette />
|
|
55
|
-
|
|
56
45
|
<StylesColorPanel
|
|
57
46
|
inheritedValue={ inheritedStyle }
|
|
58
47
|
value={ style }
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Card, CardBody } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import {
|
|
7
|
-
import { useEffect, useRef } from '@wordpress/element';
|
|
8
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
+
import { useZoomOut } from '@wordpress/block-editor';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Internal dependencies
|
|
@@ -14,43 +12,13 @@ import ScreenHeader from './header';
|
|
|
14
12
|
import StyleVariationsContainer from './style-variations-container';
|
|
15
13
|
|
|
16
14
|
function ScreenStyleVariations() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
}, [] );
|
|
22
|
-
|
|
23
|
-
const shouldRevertInitialMode = useRef( null );
|
|
24
|
-
useEffect( () => {
|
|
25
|
-
// ignore changes to zoom-out mode as we explictily change to it on mount.
|
|
26
|
-
if ( mode !== 'zoom-out' ) {
|
|
27
|
-
shouldRevertInitialMode.current = false;
|
|
28
|
-
}
|
|
29
|
-
}, [ mode ] );
|
|
30
|
-
|
|
31
|
-
// Intentionality left without any dependency.
|
|
32
|
-
// This effect should only run the first time the component is rendered.
|
|
33
|
-
// The effect opens the zoom-out view if it is not open before when applying a style variation.
|
|
34
|
-
useEffect( () => {
|
|
35
|
-
if ( mode !== 'zoom-out' ) {
|
|
36
|
-
__unstableSetEditorMode( 'zoom-out' );
|
|
37
|
-
shouldRevertInitialMode.current = true;
|
|
38
|
-
return () => {
|
|
39
|
-
// if there were not mode changes revert to the initial mode when unmounting.
|
|
40
|
-
if ( shouldRevertInitialMode.current ) {
|
|
41
|
-
__unstableSetEditorMode( mode );
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
-
}, [] );
|
|
47
|
-
|
|
48
|
-
const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
|
|
15
|
+
// Move to zoom out mode when this component is mounted
|
|
16
|
+
// and back to the previous mode when unmounted.
|
|
17
|
+
useZoomOut();
|
|
49
18
|
|
|
50
19
|
return (
|
|
51
20
|
<>
|
|
52
21
|
<ScreenHeader
|
|
53
|
-
back="/"
|
|
54
22
|
title={ __( 'Browse styles' ) }
|
|
55
23
|
description={ __(
|
|
56
24
|
'Choose a variation to change the look of the site.'
|
|
@@ -13,7 +13,6 @@ import TypographyElements from './typography-elements';
|
|
|
13
13
|
import TypographyVariations from './variations/variations-typography';
|
|
14
14
|
import FontFamilies from './font-families';
|
|
15
15
|
import ScreenHeader from './header';
|
|
16
|
-
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
17
16
|
|
|
18
17
|
function ScreenTypography() {
|
|
19
18
|
const fontLibraryEnabled = useSelect(
|
|
@@ -21,33 +20,20 @@ function ScreenTypography() {
|
|
|
21
20
|
select( editorStore ).getEditorSettings().fontLibraryEnabled,
|
|
22
21
|
[]
|
|
23
22
|
);
|
|
24
|
-
const typographyVariations =
|
|
25
|
-
useCurrentMergeThemeStyleVariationsWithUserConfig( {
|
|
26
|
-
property: 'typography',
|
|
27
|
-
filter: ( variation ) =>
|
|
28
|
-
variation?.settings?.typography?.fontFamilies &&
|
|
29
|
-
Object.keys( variation?.settings?.typography?.fontFamilies )
|
|
30
|
-
.length,
|
|
31
|
-
} );
|
|
32
23
|
|
|
33
24
|
return (
|
|
34
25
|
<>
|
|
35
26
|
<ScreenHeader
|
|
36
27
|
title={ __( 'Typography' ) }
|
|
37
28
|
description={ __(
|
|
38
|
-
'
|
|
29
|
+
'Typography styles and the application of those styles on site elements.'
|
|
39
30
|
) }
|
|
40
31
|
/>
|
|
41
|
-
<div className="edit-site-global-styles-screen
|
|
42
|
-
<VStack spacing={
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{ ! window.__experimentalDisableFontLibrary && (
|
|
47
|
-
<VStack spacing={ 3 }>
|
|
48
|
-
{ fontLibraryEnabled && <FontFamilies /> }
|
|
49
|
-
</VStack>
|
|
50
|
-
) }
|
|
32
|
+
<div className="edit-site-global-styles-screen">
|
|
33
|
+
<VStack spacing={ 7 }>
|
|
34
|
+
<TypographyVariations title={ __( 'Presets' ) } />
|
|
35
|
+
{ ! window.__experimentalDisableFontLibrary &&
|
|
36
|
+
fontLibraryEnabled && <FontFamilies /> }
|
|
51
37
|
<TypographyElements />
|
|
52
38
|
</VStack>
|
|
53
39
|
</div>
|
|
@@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
import PreviewStyles from './preview-styles';
|
|
14
14
|
import Variation from './variations/variation';
|
|
15
15
|
|
|
16
|
-
export default function StyleVariationsContainer() {
|
|
16
|
+
export default function StyleVariationsContainer( { gap = 2 } ) {
|
|
17
17
|
const variations = useSelect( ( select ) => {
|
|
18
18
|
return select(
|
|
19
19
|
coreStore
|
|
@@ -39,6 +39,7 @@ export default function StyleVariationsContainer() {
|
|
|
39
39
|
<Grid
|
|
40
40
|
columns={ 2 }
|
|
41
41
|
className="edit-site-global-styles-style-variations-container"
|
|
42
|
+
gap={ gap }
|
|
42
43
|
>
|
|
43
44
|
{ withEmptyVariation.map( ( variation, index ) => (
|
|
44
45
|
<Variation key={ index } variation={ variation }>
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.edit-site-global-styles-preview__iframe {
|
|
10
|
+
border-radius: $radius-block-ui + 1px; // Visually resembles the $radius-block-ui.
|
|
10
11
|
max-width: 100%;
|
|
11
12
|
display: block;
|
|
13
|
+
width: 100%;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
.edit-site-typography-preview {
|
|
@@ -27,9 +29,8 @@
|
|
|
27
29
|
max-width: 100%;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
.edit-site-global-styles-screen
|
|
31
|
-
|
|
32
|
-
margin: $grid-unit-20;
|
|
32
|
+
.edit-site-global-styles-screen {
|
|
33
|
+
margin: $grid-unit-15 $grid-unit-20 $grid-unit-20;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.edit-site-global-styles-screen-typography__indicator {
|
|
@@ -50,14 +51,16 @@
|
|
|
50
51
|
justify-content: center;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
.edit-site-global-styles-screen-
|
|
54
|
-
|
|
54
|
+
.edit-site-global-styles-screen .color-block-support-panel {
|
|
55
|
+
padding-left: 0;
|
|
56
|
+
padding-right: 0;
|
|
57
|
+
padding-top: 0;
|
|
58
|
+
border-top: none;
|
|
59
|
+
row-gap: calc(#{$grid-unit-05} * 3);
|
|
60
|
+
}
|
|
55
61
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
padding-right: 0;
|
|
59
|
-
border-top: none;
|
|
60
|
-
}
|
|
62
|
+
.edit-site-global-styles-screen-colors__palette-count {
|
|
63
|
+
color: $gray-700;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
.edit-site-global-styles-header__description {
|
|
@@ -113,6 +116,7 @@
|
|
|
113
116
|
flex: 1 1 auto;
|
|
114
117
|
display: flex;
|
|
115
118
|
flex-direction: column;
|
|
119
|
+
margin: $grid-unit-20;
|
|
116
120
|
|
|
117
121
|
.components-v-stack {
|
|
118
122
|
flex: 1 1 auto;
|
|
@@ -165,3 +169,4 @@
|
|
|
165
169
|
.edit-site-global-styles-sidebar__panel .block-editor-block-icon svg {
|
|
166
170
|
fill: currentColor;
|
|
167
171
|
}
|
|
172
|
+
|
|
@@ -35,6 +35,7 @@ function ElementItem( { parentMenu, element, label } ) {
|
|
|
35
35
|
prefix + 'typography.letterSpacing'
|
|
36
36
|
);
|
|
37
37
|
const [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );
|
|
38
|
+
const [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );
|
|
38
39
|
const [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );
|
|
39
40
|
const [ color ] = useGlobalStyle( prefix + 'color.text' );
|
|
40
41
|
|
|
@@ -54,7 +55,10 @@ function ElementItem( { parentMenu, element, label } ) {
|
|
|
54
55
|
className="edit-site-global-styles-screen-typography__indicator"
|
|
55
56
|
style={ {
|
|
56
57
|
fontFamily: fontFamily ?? 'serif',
|
|
57
|
-
background:
|
|
58
|
+
background:
|
|
59
|
+
gradientValue ??
|
|
60
|
+
backgroundColor ??
|
|
61
|
+
fallbackBackgroundColor,
|
|
58
62
|
color,
|
|
59
63
|
fontStyle,
|
|
60
64
|
fontWeight,
|
|
@@ -37,7 +37,6 @@ export default function PreviewTypography( { fontSize, variation } ) {
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<motion.div
|
|
40
|
-
className="edit-site-global-styles_preview-typography"
|
|
41
40
|
animate={ {
|
|
42
41
|
scale: 1,
|
|
43
42
|
opacity: 1,
|
|
@@ -50,6 +49,9 @@ export default function PreviewTypography( { fontSize, variation } ) {
|
|
|
50
49
|
delay: 0.3,
|
|
51
50
|
type: 'tween',
|
|
52
51
|
} }
|
|
52
|
+
style={ {
|
|
53
|
+
textAlign: 'center',
|
|
54
|
+
} }
|
|
53
55
|
>
|
|
54
56
|
<span style={ headingPreviewStyle }>
|
|
55
57
|
{ _x( 'A', 'Uppercase letter A' ) }
|
|
@@ -27,6 +27,7 @@ export default function TypographyPreview( { name, element, headingLevel } ) {
|
|
|
27
27
|
prefix + 'color.background',
|
|
28
28
|
name
|
|
29
29
|
);
|
|
30
|
+
const [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );
|
|
30
31
|
const [ color ] = useGlobalStyle( prefix + 'color.text', name );
|
|
31
32
|
const [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );
|
|
32
33
|
const [ fontStyle ] = useGlobalStyle(
|
|
@@ -53,7 +54,8 @@ export default function TypographyPreview( { name, element, headingLevel } ) {
|
|
|
53
54
|
className="edit-site-typography-preview"
|
|
54
55
|
style={ {
|
|
55
56
|
fontFamily: fontFamily ?? 'serif',
|
|
56
|
-
background:
|
|
57
|
+
background:
|
|
58
|
+
gradientValue ?? backgroundColor ?? fallbackBackgroundColor,
|
|
57
59
|
color,
|
|
58
60
|
fontSize,
|
|
59
61
|
fontStyle,
|
|
@@ -40,6 +40,7 @@ import ScreenStyleVariations from './screen-style-variations';
|
|
|
40
40
|
import StyleBook from '../style-book';
|
|
41
41
|
import ScreenCSS from './screen-css';
|
|
42
42
|
import ScreenRevisions from './screen-revisions';
|
|
43
|
+
import ScreenBackground from './screen-background';
|
|
43
44
|
import { unlock } from '../../lock-unlock';
|
|
44
45
|
import { store as editSiteStore } from '../../store';
|
|
45
46
|
|
|
@@ -344,6 +345,10 @@ function GlobalStylesUI() {
|
|
|
344
345
|
<ScreenRevisions />
|
|
345
346
|
</GlobalStylesNavigationScreen>
|
|
346
347
|
|
|
348
|
+
<GlobalStylesNavigationScreen path={ '/background' }>
|
|
349
|
+
<ScreenBackground />
|
|
350
|
+
</GlobalStylesNavigationScreen>
|
|
351
|
+
|
|
347
352
|
{ blocks.map( ( block ) => (
|
|
348
353
|
<GlobalStylesNavigationScreen
|
|
349
354
|
key={ 'menu-block-' + block.name }
|