@wordpress/edit-site 5.29.0 → 5.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/actions/index.js +3 -5
- package/build/components/actions/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +18 -6
- package/build/components/block-editor/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 +1 -15
- package/build/components/editor/index.js.map +1 -1
- 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/collection-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +70 -59
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +10 -15
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +121 -78
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +29 -8
- package/build/components/global-styles/font-library-modal/font-demo.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/index.js +19 -6
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +151 -79
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +51 -23
- 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 +39 -5
- 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 +4 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +2 -2
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +50 -0
- package/build/components/global-styles/highlighted-colors.js.map +1 -0
- package/build/components/global-styles/hooks.js +50 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +62 -0
- package/build/components/global-styles/preview-colors.js.map +1 -0
- package/build/components/global-styles/preview-iframe.js +130 -0
- package/build/components/global-styles/preview-iframe.js.map +1 -0
- package/build/components/global-styles/preview-styles.js +163 -0
- package/build/components/global-styles/preview-styles.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +3 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +2 -2
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +12 -84
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/{typogrphy-elements.js → typography-elements.js} +4 -2
- package/build/components/global-styles/typography-elements.js.map +1 -0
- package/build/components/global-styles/typography-example.js +67 -0
- 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 +27 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +22 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +90 -0
- package/build/components/global-styles/variations/variation.js.map +1 -0
- package/build/components/global-styles/variations/variations-color.js +35 -0
- package/build/components/global-styles/variations/variations-color.js.map +1 -0
- package/build/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build/components/global-styles/variations/variations-typography.js +54 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build/components/header-edit-mode/index.js +14 -12
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -2
- package/build/components/header-edit-mode/more-menu/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-shortcuts/global.js +17 -3
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/layout/index.js +4 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +2 -5
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-pages/index.js +6 -11
- 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 +15 -18
- package/build/components/page-patterns/index.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/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -61
- package/build/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build/components/page-templates-template-parts/index.js +25 -22
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +2 -1
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +31 -11
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -4
- 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 +4 -2
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +12 -6
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +23 -3
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +13 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build/components/sidebar-navigation-screen-main/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/single-navigation-menu.js +0 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-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-pattern/template-part-navigation-menu.js.map +1 -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 +2 -2
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +7 -3
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +6 -6
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- 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/use-theme-style-variations/use-theme-style-variations-by-property.js +78 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.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/actions/index.js +4 -6
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +18 -6
- package/build-module/components/block-editor/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 +2 -16
- package/build-module/components/editor/index.js.map +1 -1
- 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/collection-font-variant.js +4 -4
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +72 -61
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +11 -16
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +124 -81
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +30 -9
- package/build-module/components/global-styles/font-library-modal/font-demo.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/index.js +19 -6
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +151 -79
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +4 -4
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +52 -24
- 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 +38 -5
- 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 +4 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -2
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +43 -0
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -0
- 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/preview-colors.js +54 -0
- package/build-module/components/global-styles/preview-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-iframe.js +123 -0
- package/build-module/components/global-styles/preview-iframe.js.map +1 -0
- package/build-module/components/global-styles/preview-styles.js +155 -0
- package/build-module/components/global-styles/preview-styles.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +3 -2
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +2 -2
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +2 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +13 -85
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/{typogrphy-elements.js → typography-elements.js} +4 -2
- package/build-module/components/global-styles/typography-elements.js.map +1 -0
- package/build-module/components/global-styles/typography-example.js +60 -0
- 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 +27 -2
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +21 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +82 -0
- package/build-module/components/global-styles/variations/variation.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-color.js +27 -0
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -0
- package/build-module/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js +46 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +15 -13
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +13 -5
- package/build-module/components/header-edit-mode/more-menu/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-shortcuts/global.js +17 -3
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/layout/index.js +4 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +2 -5
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-pages/index.js +7 -12
- 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 +16 -19
- package/build-module/components/page-patterns/index.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/{list/added-by.js → page-templates-template-parts/hooks.js} +2 -59
- package/build-module/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build-module/components/page-templates-template-parts/index.js +25 -22
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +2 -1
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +31 -11
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -4
- 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 +6 -4
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +4 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +3 -3
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -2
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +13 -7
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +24 -4
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +14 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-main/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/single-navigation-menu.js +0 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-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-pattern/template-part-navigation-menu.js.map +1 -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-template/index.js +6 -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 +5 -5
- 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 +7 -5
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- 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/use-theme-style-variations/use-theme-style-variations-by-property.js +76 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.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 +196 -315
- package/build-style/style.css +196 -315
- package/package.json +42 -42
- package/src/components/actions/index.js +4 -6
- package/src/components/block-editor/editor-canvas.js +20 -6
- package/src/components/block-editor/style.scss +0 -3
- package/src/components/block-editor/use-site-editor-settings.js +0 -2
- package/src/components/editor/index.js +0 -20
- package/src/components/global-styles/color-palette-panel.js +0 -1
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +5 -5
- package/src/components/global-styles/font-library-modal/context.js +136 -107
- package/src/components/global-styles/font-library-modal/font-card.js +11 -26
- package/src/components/global-styles/font-library-modal/font-collection.js +298 -218
- package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
- package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -2
- package/src/components/global-styles/font-library-modal/index.js +23 -16
- package/src/components/global-styles/font-library-modal/installed-fonts.js +243 -114
- package/src/components/global-styles/font-library-modal/library-font-variant.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +27 -11
- package/src/components/global-styles/font-library-modal/upload-fonts.js +70 -27
- package/src/components/global-styles/font-library-modal/utils/index.js +45 -5
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +6 -1
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +7 -18
- package/src/components/global-styles/gradients-palette-panel.js +2 -2
- package/src/components/global-styles/header.js +2 -2
- package/src/components/global-styles/highlighted-colors.js +39 -0
- package/src/components/global-styles/hooks.js +68 -1
- package/src/components/global-styles/preview-colors.js +61 -0
- package/src/components/global-styles/preview-iframe.js +152 -0
- package/src/components/global-styles/preview-styles.js +185 -0
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-block.js +4 -1
- package/src/components/global-styles/screen-colors.js +3 -2
- package/src/components/global-styles/screen-revisions/index.js +5 -2
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography.js +8 -2
- package/src/components/global-styles/style-variations-container.js +14 -92
- package/src/components/global-styles/style.scss +4 -35
- package/src/components/global-styles/{typogrphy-elements.js → typography-elements.js} +5 -1
- package/src/components/global-styles/typography-example.js +64 -0
- package/src/components/global-styles/typography-preview.js +3 -1
- package/src/components/global-styles/ui.js +26 -2
- package/src/components/global-styles/utils.js +37 -0
- package/src/components/global-styles/variations/style.scss +38 -0
- package/src/components/global-styles/variations/variation.js +93 -0
- package/src/components/global-styles/variations/variations-color.js +34 -0
- package/src/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/src/components/global-styles/variations/variations-typography.js +63 -0
- package/src/components/header-edit-mode/index.js +21 -27
- package/src/components/header-edit-mode/more-menu/index.js +17 -8
- package/src/components/header-edit-mode/style.scss +4 -0
- package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/src/components/keyboard-shortcuts/global.js +16 -4
- package/src/components/layout/index.js +5 -0
- package/src/components/layout/router.js +2 -7
- package/src/components/page-pages/index.js +8 -13
- package/src/components/page-patterns/delete-category-menu-item.js +7 -0
- package/src/components/page-patterns/index.js +23 -24
- package/src/components/page-patterns/use-patterns.js +17 -10
- package/src/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -66
- package/src/components/page-templates-template-parts/index.js +34 -25
- package/src/components/page-templates-template-parts/style.scss +48 -0
- package/src/components/resizable-frame/index.js +1 -0
- package/src/components/revisions/index.js +1 -1
- package/src/components/save-panel/index.js +56 -27
- package/src/components/sidebar/index.js +3 -4
- 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 +14 -4
- package/src/components/sidebar-dataviews/index.js +4 -3
- package/src/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +30 -11
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +10 -11
- package/src/components/sidebar-edit-mode/template-panel/index.js +25 -6
- package/src/components/sidebar-navigation-screen/style.scss +10 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +35 -2
- package/src/components/sidebar-navigation-screen-main/index.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +11 -9
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -3
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-template/index.js +7 -2
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +5 -5
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +5 -3
- package/src/components/start-template-options/index.js +1 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- 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/use-theme-style-variations/test/use-theme-style-variations-by-property.js +173 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +85 -1
- package/src/style.scss +2 -3
- 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/global-styles/font-library-modal/collection-font-details.js +0 -50
- package/build/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -30
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js +0 -39
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js +0 -67
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/build/components/global-styles/preview.js +0 -271
- package/build/components/global-styles/preview.js.map +0 -1
- package/build/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build/components/global-styles/variations-panel.js.map +0 -1
- package/build/components/list/added-by.js.map +0 -1
- package/build/components/list/header.js +0 -55
- package/build/components/list/header.js.map +0 -1
- package/build/components/list/index.js +0 -80
- package/build/components/list/index.js.map +0 -1
- package/build/components/list/table.js +0 -94
- package/build/components/list/table.js.map +0 -1
- package/build/components/list/use-register-shortcuts.js +0 -51
- package/build/components/list/use-register-shortcuts.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-navigation-screen-main/template-part-hint.js +0 -36
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.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-module/components/global-styles/font-library-modal/collection-font-details.js +0 -42
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -23
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/library-font-card.js +0 -31
- package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +0 -60
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/build-module/components/global-styles/preview.js +0 -264
- package/build-module/components/global-styles/preview.js.map +0 -1
- package/build-module/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build-module/components/global-styles/variations-panel.js.map +0 -1
- package/build-module/components/list/added-by.js.map +0 -1
- package/build-module/components/list/header.js +0 -47
- package/build-module/components/list/header.js.map +0 -1
- package/build-module/components/list/index.js +0 -72
- package/build-module/components/list/index.js.map +0 -1
- package/build-module/components/list/table.js +0 -86
- package/build-module/components/list/table.js.map +0 -1
- package/build-module/components/list/use-register-shortcuts.js +0 -45
- package/build-module/components/list/use-register-shortcuts.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-navigation-screen-main/template-part-hint.js +0 -29
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.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-navigation-menu/edit-button.js +0 -27
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.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/src/components/global-styles/font-library-modal/collection-font-details.js +0 -56
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -33
- package/src/components/global-styles/font-library-modal/library-font-card.js +0 -34
- package/src/components/global-styles/font-library-modal/tab-panel-layout.js +0 -85
- package/src/components/global-styles/preview.js +0 -327
- package/src/components/list/header.js +0 -48
- package/src/components/list/index.js +0 -87
- package/src/components/list/style.scss +0 -188
- package/src/components/list/table.js +0 -140
- package/src/components/list/use-register-shortcuts.js +0 -49
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +0 -49
- package/src/components/sidebar-navigation-screen-main/template-part-hint.js +0 -34
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -22
- package/src/components/sidebar-navigation-screen-templates/index.js +0 -156
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -9
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useContext } from '@wordpress/element';
|
|
5
|
+
import { __unstableMotion as motion } from '@wordpress/components';
|
|
6
|
+
import { _x } from '@wordpress/i18n';
|
|
7
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { mergeBaseAndUserConfigs } from './global-styles-provider';
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
import { getFamilyPreviewStyle } from './font-library-modal/utils/preview-styles';
|
|
15
|
+
import { getFontFamilies } from './utils';
|
|
16
|
+
|
|
17
|
+
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
|
18
|
+
|
|
19
|
+
export default function PreviewTypography( { fontSize, variation } ) {
|
|
20
|
+
const { base } = useContext( GlobalStylesContext );
|
|
21
|
+
let config = base;
|
|
22
|
+
if ( variation ) {
|
|
23
|
+
config = mergeBaseAndUserConfigs( base, variation );
|
|
24
|
+
}
|
|
25
|
+
const [ bodyFontFamilies, headingFontFamilies ] = getFontFamilies( config );
|
|
26
|
+
const bodyPreviewStyle = bodyFontFamilies
|
|
27
|
+
? getFamilyPreviewStyle( bodyFontFamilies )
|
|
28
|
+
: {};
|
|
29
|
+
const headingPreviewStyle = headingFontFamilies
|
|
30
|
+
? getFamilyPreviewStyle( headingFontFamilies )
|
|
31
|
+
: {};
|
|
32
|
+
|
|
33
|
+
if ( fontSize ) {
|
|
34
|
+
bodyPreviewStyle.fontSize = fontSize;
|
|
35
|
+
headingPreviewStyle.fontSize = fontSize;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<motion.div
|
|
40
|
+
animate={ {
|
|
41
|
+
scale: 1,
|
|
42
|
+
opacity: 1,
|
|
43
|
+
} }
|
|
44
|
+
initial={ {
|
|
45
|
+
scale: 0.1,
|
|
46
|
+
opacity: 0,
|
|
47
|
+
} }
|
|
48
|
+
transition={ {
|
|
49
|
+
delay: 0.3,
|
|
50
|
+
type: 'tween',
|
|
51
|
+
} }
|
|
52
|
+
style={ {
|
|
53
|
+
textAlign: 'center',
|
|
54
|
+
} }
|
|
55
|
+
>
|
|
56
|
+
<span style={ headingPreviewStyle }>
|
|
57
|
+
{ _x( 'A', 'Uppercase letter A' ) }
|
|
58
|
+
</span>
|
|
59
|
+
<span style={ bodyPreviewStyle }>
|
|
60
|
+
{ _x( 'a', 'Lowercase letter A' ) }
|
|
61
|
+
</span>
|
|
62
|
+
</motion.div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -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,
|
|
@@ -230,12 +230,14 @@ function GlobalStylesBlockLink() {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
function GlobalStylesEditorCanvasContainerLink() {
|
|
233
|
-
const { goTo } = useNavigator();
|
|
233
|
+
const { goTo, location } = useNavigator();
|
|
234
234
|
const editorCanvasContainerView = useSelect(
|
|
235
235
|
( select ) =>
|
|
236
236
|
unlock( select( editSiteStore ) ).getEditorCanvasContainerView(),
|
|
237
237
|
[]
|
|
238
238
|
);
|
|
239
|
+
const path = location?.path;
|
|
240
|
+
const isRevisionsOpen = path === '/revisions';
|
|
239
241
|
|
|
240
242
|
// If the user switches the editor canvas container view, redirect
|
|
241
243
|
// to the appropriate screen. This effectively allows deep linking to the
|
|
@@ -249,11 +251,33 @@ function GlobalStylesEditorCanvasContainerLink() {
|
|
|
249
251
|
case 'global-styles-css':
|
|
250
252
|
goTo( '/css' );
|
|
251
253
|
break;
|
|
254
|
+
case 'style-book':
|
|
255
|
+
/*
|
|
256
|
+
* The stand-alone style book is open
|
|
257
|
+
* and the revisions panel is open,
|
|
258
|
+
* close the revisions panel.
|
|
259
|
+
* Otherwise keep the style book open while
|
|
260
|
+
* browsing global styles panel.
|
|
261
|
+
*/
|
|
262
|
+
if ( isRevisionsOpen ) {
|
|
263
|
+
goTo( '/' );
|
|
264
|
+
}
|
|
265
|
+
break;
|
|
252
266
|
default:
|
|
267
|
+
/*
|
|
268
|
+
* Example: the user has navigated to "Browse styles" or elsewhere
|
|
269
|
+
* and changes the editorCanvasContainerView, e.g., closes the style book.
|
|
270
|
+
* The panel should not be affected.
|
|
271
|
+
* Exclude revisions panel from this behavior,
|
|
272
|
+
* as it should close when the editorCanvasContainerView doesn't correspond.
|
|
273
|
+
*/
|
|
274
|
+
if ( path !== '/' && ! isRevisionsOpen ) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
253
277
|
goTo( '/' );
|
|
254
278
|
break;
|
|
255
279
|
}
|
|
256
|
-
}, [ editorCanvasContainerView, goTo ] );
|
|
280
|
+
}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );
|
|
257
281
|
}
|
|
258
282
|
|
|
259
283
|
function GlobalStylesUI() {
|
|
@@ -10,3 +10,40 @@ export function getVariationClassName( variation ) {
|
|
|
10
10
|
}
|
|
11
11
|
return `is-style-${ variation }`;
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
function getFontFamilyFromSetting( fontFamilies, setting ) {
|
|
15
|
+
if ( ! Array.isArray( fontFamilies ) || ! setting ) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const fontFamilyVariable = setting.replace( 'var(', '' ).replace( ')', '' );
|
|
20
|
+
const fontFamilySlug = fontFamilyVariable?.split( '--' ).slice( -1 )[ 0 ];
|
|
21
|
+
|
|
22
|
+
return fontFamilies.find(
|
|
23
|
+
( fontFamily ) => fontFamily.slug === fontFamilySlug
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getFontFamilies( themeJson ) {
|
|
28
|
+
const fontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme; // TODO this could not be under theme.
|
|
29
|
+
const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;
|
|
30
|
+
const bodyFontFamily = getFontFamilyFromSetting(
|
|
31
|
+
fontFamilies,
|
|
32
|
+
bodyFontFamilySetting
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const headingFontFamilySetting =
|
|
36
|
+
themeJson?.styles?.elements?.heading?.typography?.fontFamily;
|
|
37
|
+
|
|
38
|
+
let headingFontFamily;
|
|
39
|
+
if ( ! headingFontFamilySetting ) {
|
|
40
|
+
headingFontFamily = bodyFontFamily;
|
|
41
|
+
} else {
|
|
42
|
+
headingFontFamily = getFontFamilyFromSetting(
|
|
43
|
+
fontFamilies,
|
|
44
|
+
themeJson?.styles?.elements?.heading?.typography?.fontFamily
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return [ bodyFontFamily, headingFontFamily ];
|
|
49
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.edit-site-global-styles-variations_item {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
// To round the outline in Windows 10 high contrast mode.
|
|
4
|
+
border-radius: $radius-block-ui;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
|
|
7
|
+
.edit-site-global-styles-variations_item-preview {
|
|
8
|
+
padding: $border-width * 2;
|
|
9
|
+
border-radius: $radius-block-ui;
|
|
10
|
+
box-shadow: 0 0 0 $border-width $gray-200;
|
|
11
|
+
// Shown in Windows 10 high contrast mode.
|
|
12
|
+
outline: 1px solid transparent;
|
|
13
|
+
|
|
14
|
+
.edit-site-global-styles-color-variations & {
|
|
15
|
+
padding: $grid-unit-10;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.is-active .edit-site-global-styles-variations_item-preview {
|
|
20
|
+
box-shadow: 0 0 0 $border-width $gray-900;
|
|
21
|
+
// Shown in Windows 10 high contrast mode.
|
|
22
|
+
outline-width: 3px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:hover .edit-site-global-styles-variations_item-preview {
|
|
26
|
+
box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:focus .edit-site-global-styles-variations_item-preview {
|
|
30
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:focus-visible {
|
|
34
|
+
// Shown in Windows 10 high contrast mode.
|
|
35
|
+
outline: 3px solid transparent;
|
|
36
|
+
outline-offset: 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useMemo, useContext, useState } from '@wordpress/element';
|
|
10
|
+
import { ENTER } from '@wordpress/keycodes';
|
|
11
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
12
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
import { mergeBaseAndUserConfigs } from '../global-styles-provider';
|
|
18
|
+
import { unlock } from '../../../lock-unlock';
|
|
19
|
+
|
|
20
|
+
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
|
|
21
|
+
blockEditorPrivateApis
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default function Variation( { variation, children } ) {
|
|
25
|
+
const [ isFocused, setIsFocused ] = useState( false );
|
|
26
|
+
const { base, user, setUserConfig } = useContext( GlobalStylesContext );
|
|
27
|
+
const context = useMemo(
|
|
28
|
+
() => ( {
|
|
29
|
+
user: {
|
|
30
|
+
settings: variation.settings ?? {},
|
|
31
|
+
styles: variation.styles ?? {},
|
|
32
|
+
},
|
|
33
|
+
base,
|
|
34
|
+
merged: mergeBaseAndUserConfigs( base, variation ),
|
|
35
|
+
setUserConfig: () => {},
|
|
36
|
+
} ),
|
|
37
|
+
[ variation, base ]
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const selectVariation = () => {
|
|
41
|
+
setUserConfig( () => ( {
|
|
42
|
+
settings: variation.settings,
|
|
43
|
+
styles: variation.styles,
|
|
44
|
+
} ) );
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const selectOnEnter = ( event ) => {
|
|
48
|
+
if ( event.keyCode === ENTER ) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
selectVariation();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const isActive = useMemo(
|
|
55
|
+
() => areGlobalStyleConfigsEqual( user, variation ),
|
|
56
|
+
[ user, variation ]
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
let label = variation?.title;
|
|
60
|
+
if ( variation?.description ) {
|
|
61
|
+
label = sprintf(
|
|
62
|
+
/* translators: %1$s: variation title. %2$s variation description. */
|
|
63
|
+
__( '%1$s (%2$s)' ),
|
|
64
|
+
variation?.title,
|
|
65
|
+
variation?.description
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<GlobalStylesContext.Provider value={ context }>
|
|
71
|
+
<div
|
|
72
|
+
className={ classnames(
|
|
73
|
+
'edit-site-global-styles-variations_item',
|
|
74
|
+
{
|
|
75
|
+
'is-active': isActive,
|
|
76
|
+
}
|
|
77
|
+
) }
|
|
78
|
+
role="button"
|
|
79
|
+
onClick={ selectVariation }
|
|
80
|
+
onKeyDown={ selectOnEnter }
|
|
81
|
+
tabIndex="0"
|
|
82
|
+
aria-label={ label }
|
|
83
|
+
aria-current={ isActive }
|
|
84
|
+
onFocus={ () => setIsFocused( true ) }
|
|
85
|
+
onBlur={ () => setIsFocused( false ) }
|
|
86
|
+
>
|
|
87
|
+
<div className="edit-site-global-styles-variations_item-preview">
|
|
88
|
+
{ children( isFocused ) }
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</GlobalStylesContext.Provider>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
__experimentalGrid as Grid,
|
|
6
|
+
__experimentalVStack as VStack,
|
|
7
|
+
} from '@wordpress/components';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import Variation from './variation';
|
|
13
|
+
import StylesPreviewColors from '../preview-colors';
|
|
14
|
+
import { useColorVariations } from '../hooks';
|
|
15
|
+
|
|
16
|
+
export default function ColorVariations() {
|
|
17
|
+
const colorVariations = useColorVariations();
|
|
18
|
+
|
|
19
|
+
if ( ! colorVariations?.length ) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<VStack spacing={ 3 }>
|
|
25
|
+
<Grid columns={ 3 }>
|
|
26
|
+
{ colorVariations.map( ( variation, index ) => (
|
|
27
|
+
<Variation key={ index } variation={ variation }>
|
|
28
|
+
{ () => <StylesPreviewColors /> }
|
|
29
|
+
</Variation>
|
|
30
|
+
) ) }
|
|
31
|
+
</Grid>
|
|
32
|
+
</VStack>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -8,7 +8,7 @@ import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { NavigationButtonAsItem } from '
|
|
11
|
+
import { NavigationButtonAsItem } from '../navigation-button';
|
|
12
12
|
|
|
13
13
|
function getCoreBlockStyles( blockStyles ) {
|
|
14
14
|
return blockStyles?.filter( ( style ) => style.source === 'block' );
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
__experimentalGrid as Grid,
|
|
6
|
+
__experimentalVStack as HStack,
|
|
7
|
+
__experimentalVStack as VStack,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { useTypographyVariations } from '../hooks';
|
|
14
|
+
import TypographyExample from '../typography-example';
|
|
15
|
+
import PreviewIframe from '../preview-iframe';
|
|
16
|
+
import Variation from './variation';
|
|
17
|
+
|
|
18
|
+
export default function TypographyVariations() {
|
|
19
|
+
const typographyVariations = useTypographyVariations();
|
|
20
|
+
|
|
21
|
+
if ( ! typographyVariations?.length ) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<VStack spacing={ 3 }>
|
|
27
|
+
<Grid
|
|
28
|
+
columns={ 3 }
|
|
29
|
+
className="edit-site-global-styles-style-variations-container"
|
|
30
|
+
>
|
|
31
|
+
{ typographyVariations &&
|
|
32
|
+
typographyVariations.length &&
|
|
33
|
+
typographyVariations.map( ( variation, index ) => (
|
|
34
|
+
<Variation key={ index } variation={ variation }>
|
|
35
|
+
{ ( isFocused ) => (
|
|
36
|
+
<PreviewIframe
|
|
37
|
+
label={ variation?.title }
|
|
38
|
+
isFocused={ isFocused }
|
|
39
|
+
>
|
|
40
|
+
{ ( { ratio, key } ) => (
|
|
41
|
+
<HStack
|
|
42
|
+
key={ key }
|
|
43
|
+
spacing={ 10 * ratio }
|
|
44
|
+
justify="center"
|
|
45
|
+
style={ {
|
|
46
|
+
height: '100%',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
} }
|
|
49
|
+
>
|
|
50
|
+
<TypographyExample
|
|
51
|
+
variation={ variation }
|
|
52
|
+
fontSize={ 85 * ratio }
|
|
53
|
+
/>
|
|
54
|
+
</HStack>
|
|
55
|
+
) }
|
|
56
|
+
</PreviewIframe>
|
|
57
|
+
) }
|
|
58
|
+
</Variation>
|
|
59
|
+
) ) }
|
|
60
|
+
</Grid>
|
|
61
|
+
</VStack>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -9,6 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
import { useViewportMatch, useReducedMotion } from '@wordpress/compose';
|
|
10
10
|
import {
|
|
11
11
|
BlockToolbar,
|
|
12
|
+
privateApis as blockEditorPrivateApis,
|
|
12
13
|
store as blockEditorStore,
|
|
13
14
|
} from '@wordpress/block-editor';
|
|
14
15
|
import { useSelect } from '@wordpress/data';
|
|
@@ -42,6 +43,7 @@ import {
|
|
|
42
43
|
import { unlock } from '../../lock-unlock';
|
|
43
44
|
import { FOCUSABLE_ENTITIES } from '../../utils/constants';
|
|
44
45
|
|
|
46
|
+
const { useShowBlockTools } = unlock( blockEditorPrivateApis );
|
|
45
47
|
const { PostViewLink, PreviewDropdown } = unlock( editorPrivateApis );
|
|
46
48
|
|
|
47
49
|
export default function HeaderEditMode() {
|
|
@@ -52,8 +54,6 @@ export default function HeaderEditMode() {
|
|
|
52
54
|
blockSelectionStart,
|
|
53
55
|
showIconLabels,
|
|
54
56
|
editorCanvasView,
|
|
55
|
-
hasFixedToolbar,
|
|
56
|
-
isZoomOutMode,
|
|
57
57
|
} = useSelect( ( select ) => {
|
|
58
58
|
const { getEditedPostType } = select( editSiteStore );
|
|
59
59
|
const { getBlockSelectionStart, __unstableGetEditorMode } =
|
|
@@ -70,14 +70,13 @@ export default function HeaderEditMode() {
|
|
|
70
70
|
editorCanvasView: unlock(
|
|
71
71
|
select( editSiteStore )
|
|
72
72
|
).getEditorCanvasContainerView(),
|
|
73
|
-
hasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),
|
|
74
73
|
isDistractionFree: getPreference( 'core', 'distractionFree' ),
|
|
75
|
-
isZoomOutMode: __unstableGetEditorMode() === 'zoom-out',
|
|
76
74
|
};
|
|
77
75
|
}, [] );
|
|
78
76
|
|
|
79
77
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
80
|
-
const
|
|
78
|
+
const { showFixedToolbar } = useShowBlockTools();
|
|
79
|
+
const showTopToolbar = isLargeViewport && showFixedToolbar;
|
|
81
80
|
const blockToolbarRef = useRef();
|
|
82
81
|
const disableMotion = useReducedMotion();
|
|
83
82
|
|
|
@@ -90,8 +89,6 @@ export default function HeaderEditMode() {
|
|
|
90
89
|
const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =
|
|
91
90
|
useState( true );
|
|
92
91
|
|
|
93
|
-
const hasBlockSelected = !! blockSelectionStart;
|
|
94
|
-
|
|
95
92
|
useEffect( () => {
|
|
96
93
|
// If we have a new block selection, show the block tools
|
|
97
94
|
if ( blockSelectionStart ) {
|
|
@@ -128,7 +125,7 @@ export default function HeaderEditMode() {
|
|
|
128
125
|
blockEditorMode={ blockEditorMode }
|
|
129
126
|
isDistractionFree={ isDistractionFree }
|
|
130
127
|
/>
|
|
131
|
-
{
|
|
128
|
+
{ showTopToolbar && (
|
|
132
129
|
<>
|
|
133
130
|
<div
|
|
134
131
|
className={ classnames(
|
|
@@ -144,24 +141,21 @@ export default function HeaderEditMode() {
|
|
|
144
141
|
ref={ blockToolbarRef }
|
|
145
142
|
name="block-toolbar"
|
|
146
143
|
/>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
/>
|
|
164
|
-
) }
|
|
144
|
+
<Button
|
|
145
|
+
className="edit-site-header-edit-mode__block-tools-toggle"
|
|
146
|
+
icon={ isBlockToolsCollapsed ? next : previous }
|
|
147
|
+
onClick={ () => {
|
|
148
|
+
setIsBlockToolsCollapsed(
|
|
149
|
+
( collapsed ) => ! collapsed
|
|
150
|
+
);
|
|
151
|
+
} }
|
|
152
|
+
label={
|
|
153
|
+
isBlockToolsCollapsed
|
|
154
|
+
? __( 'Show block tools' )
|
|
155
|
+
: __( 'Hide block tools' )
|
|
156
|
+
}
|
|
157
|
+
size="compact"
|
|
158
|
+
/>
|
|
165
159
|
</>
|
|
166
160
|
) }
|
|
167
161
|
</motion.div>
|
|
@@ -173,7 +167,7 @@ export default function HeaderEditMode() {
|
|
|
173
167
|
'edit-site-header-edit-mode__center',
|
|
174
168
|
{
|
|
175
169
|
'is-collapsed':
|
|
176
|
-
! isBlockToolsCollapsed &&
|
|
170
|
+
! isBlockToolsCollapsed && showTopToolbar,
|
|
177
171
|
}
|
|
178
172
|
) }
|
|
179
173
|
>
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
import { __, _x } from '@wordpress/i18n';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
6
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
7
|
-
import { external } from '@wordpress/icons';
|
|
8
|
-
import { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';
|
|
7
|
+
import { external, moreVertical } from '@wordpress/icons';
|
|
9
8
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
MenuGroup,
|
|
10
|
+
MenuItem,
|
|
11
|
+
VisuallyHidden,
|
|
12
|
+
DropdownMenu,
|
|
13
|
+
} from '@wordpress/components';
|
|
14
|
+
import { ActionItem, store as interfaceStore } from '@wordpress/interface';
|
|
14
15
|
import {
|
|
15
16
|
PreferenceToggleMenuItem,
|
|
16
17
|
store as preferencesStore,
|
|
@@ -55,10 +56,18 @@ export default function MoreMenu( { showIconLabels } ) {
|
|
|
55
56
|
|
|
56
57
|
return (
|
|
57
58
|
<>
|
|
58
|
-
<
|
|
59
|
+
<DropdownMenu
|
|
60
|
+
icon={ moreVertical }
|
|
61
|
+
label={ __( 'Options' ) }
|
|
62
|
+
popoverProps={ {
|
|
63
|
+
placement: 'bottom-end',
|
|
64
|
+
className: 'more-menu-dropdown__content',
|
|
65
|
+
} }
|
|
59
66
|
toggleProps={ {
|
|
60
67
|
showTooltip: ! showIconLabels,
|
|
61
68
|
...( showIconLabels && { variant: 'tertiary' } ),
|
|
69
|
+
tooltipPosition: 'bottom',
|
|
70
|
+
size: 'compact',
|
|
62
71
|
} }
|
|
63
72
|
>
|
|
64
73
|
{ ( { onClose } ) => (
|
|
@@ -162,7 +171,7 @@ export default function MoreMenu( { showIconLabels } ) {
|
|
|
162
171
|
</MenuGroup>
|
|
163
172
|
</>
|
|
164
173
|
) }
|
|
165
|
-
</
|
|
174
|
+
</DropdownMenu>
|
|
166
175
|
<KeyboardShortcutHelpModal />
|
|
167
176
|
<EditSitePreferencesModal />
|
|
168
177
|
</>
|
|
@@ -256,3 +256,7 @@ $header-toolbar-min-width: 335px;
|
|
|
256
256
|
.edit-site-header-edit-mode__block-tools-toggle {
|
|
257
257
|
margin-left: 2px; // Allow focus ring to be fully visible
|
|
258
258
|
}
|
|
259
|
+
|
|
260
|
+
.components-popover.more-menu-dropdown__content {
|
|
261
|
+
z-index: z-index(".components-popover.more-menu__content");
|
|
262
|
+
}
|
|
@@ -46,4 +46,8 @@ export const textFormattingShortcuts = [
|
|
|
46
46
|
'Convert the current paragraph or heading to a heading of level 1 to 6.'
|
|
47
47
|
),
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
keyCombination: { modifier: 'primaryShift', character: 'SPACE' },
|
|
51
|
+
description: __( 'Add non breaking space.' ),
|
|
52
|
+
},
|
|
49
53
|
];
|
|
@@ -4,29 +4,41 @@
|
|
|
4
4
|
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
5
5
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
10
11
|
*/
|
|
11
12
|
import { store as editSiteStore } from '../../store';
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
12
14
|
|
|
13
15
|
function KeyboardShortcutsGlobal() {
|
|
14
16
|
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =
|
|
15
17
|
useSelect( coreStore );
|
|
18
|
+
const { hasNonPostEntityChanges } = useSelect( editorStore );
|
|
19
|
+
const { getCanvasMode } = unlock( useSelect( editSiteStore ) );
|
|
16
20
|
const { setIsSaveViewOpened } = useDispatch( editSiteStore );
|
|
17
21
|
|
|
18
22
|
useShortcut( 'core/edit-site/save', ( event ) => {
|
|
19
23
|
event.preventDefault();
|
|
20
24
|
|
|
21
25
|
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
22
|
-
const
|
|
26
|
+
const hasDirtyEntities = !! dirtyEntityRecords.length;
|
|
23
27
|
const isSaving = dirtyEntityRecords.some( ( record ) =>
|
|
24
28
|
isSavingEntityRecord( record.kind, record.name, record.key )
|
|
25
29
|
);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
const _hasNonPostEntityChanges = hasNonPostEntityChanges();
|
|
31
|
+
const isViewMode = getCanvasMode() === 'view';
|
|
32
|
+
if (
|
|
33
|
+
( ! hasDirtyEntities || ! _hasNonPostEntityChanges || isSaving ) &&
|
|
34
|
+
! isViewMode
|
|
35
|
+
) {
|
|
36
|
+
return;
|
|
29
37
|
}
|
|
38
|
+
// At this point, we know that there are dirty entities, other than
|
|
39
|
+
// the edited post, and we're not in the process of saving, so open
|
|
40
|
+
// save view.
|
|
41
|
+
setIsSaveViewOpened( true );
|
|
30
42
|
} );
|
|
31
43
|
|
|
32
44
|
return null;
|
|
@@ -70,6 +70,7 @@ export default function Layout() {
|
|
|
70
70
|
|
|
71
71
|
const {
|
|
72
72
|
isDistractionFree,
|
|
73
|
+
isZoomOutMode,
|
|
73
74
|
hasFixedToolbar,
|
|
74
75
|
hasBlockSelected,
|
|
75
76
|
canvasMode,
|
|
@@ -96,6 +97,9 @@ export default function Layout() {
|
|
|
96
97
|
'core',
|
|
97
98
|
'distractionFree'
|
|
98
99
|
),
|
|
100
|
+
isZoomOutMode:
|
|
101
|
+
select( blockEditorStore ).__unstableGetEditorMode() ===
|
|
102
|
+
'zoom-out',
|
|
99
103
|
hasBlockSelected:
|
|
100
104
|
select( blockEditorStore ).getBlockSelectionStart(),
|
|
101
105
|
};
|
|
@@ -172,6 +176,7 @@ export default function Layout() {
|
|
|
172
176
|
'is-full-canvas': canvasMode === 'edit',
|
|
173
177
|
'has-fixed-toolbar': hasFixedToolbar,
|
|
174
178
|
'is-block-toolbar-visible': hasBlockSelected,
|
|
179
|
+
'is-zoom-out': isZoomOutMode,
|
|
175
180
|
}
|
|
176
181
|
) }
|
|
177
182
|
>
|
|
@@ -45,12 +45,7 @@ export default function useLayoutAreas() {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
// Extracted it here out of the conditionals so it doesn't unintentionally becomes stable.
|
|
50
|
-
const isListLayout =
|
|
51
|
-
isCustom !== 'true' &&
|
|
52
|
-
layout === 'list' &&
|
|
53
|
-
window?.__experimentalAdminViews;
|
|
48
|
+
const isListLayout = isCustom !== 'true' && layout === 'list';
|
|
54
49
|
|
|
55
50
|
if ( path === '/pages' ) {
|
|
56
51
|
return {
|
|
@@ -80,7 +75,7 @@ export default function useLayoutAreas() {
|
|
|
80
75
|
}
|
|
81
76
|
|
|
82
77
|
// Templates
|
|
83
|
-
if ( path === '/wp_template
|
|
78
|
+
if ( path === '/wp_template' ) {
|
|
84
79
|
return {
|
|
85
80
|
areas: {
|
|
86
81
|
content: (
|