@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
|
@@ -5,40 +5,49 @@
|
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
|
|
7
7
|
.edit-site-global-styles-variations_item-preview {
|
|
8
|
-
padding: $border-width * 2;
|
|
9
8
|
border-radius: $radius-block-ui;
|
|
10
|
-
box-shadow: 0 0 0 $border-width $gray-200;
|
|
11
9
|
// Shown in Windows 10 high contrast mode.
|
|
12
10
|
outline: 1px solid transparent;
|
|
11
|
+
position: relative;
|
|
12
|
+
// Add the same transition that block style variations and other buttons have.
|
|
13
|
+
transition: box-shadow 0.1s linear;
|
|
14
|
+
@include reduce-motion("transition");
|
|
15
|
+
|
|
16
|
+
&::after {
|
|
17
|
+
content: "";
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: -$border-width;
|
|
20
|
+
left: -$border-width;
|
|
21
|
+
bottom: -$border-width;
|
|
22
|
+
right: -$border-width;
|
|
23
|
+
// Visually resembles the $radius-block-ui.
|
|
24
|
+
border-radius: $radius-block-ui + $border-width;
|
|
25
|
+
box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
|
|
26
|
+
// Show a thin outline in Windows high contrast mode, otherwise the button is invisible.
|
|
27
|
+
border: $border-width solid transparent;
|
|
28
|
+
box-sizing: inherit;
|
|
29
|
+
// Add the same transition that block style variations and other buttons have.
|
|
30
|
+
transition: box-shadow 0.1s linear;
|
|
31
|
+
@include reduce-motion("transition");
|
|
32
|
+
}
|
|
13
33
|
|
|
14
34
|
.edit-site-global-styles-color-variations & {
|
|
15
35
|
padding: $grid-unit-10;
|
|
16
36
|
}
|
|
17
37
|
}
|
|
18
38
|
|
|
19
|
-
|
|
20
|
-
box-shadow: 0 0 0 $border-width
|
|
21
|
-
// Shown in Windows 10 high contrast mode.
|
|
22
|
-
outline-width: 3px;
|
|
39
|
+
&:not(.is-active):hover .edit-site-global-styles-variations_item-preview::after {
|
|
40
|
+
box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.4);
|
|
23
41
|
}
|
|
24
42
|
|
|
25
|
-
|
|
26
|
-
|
|
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 {
|
|
43
|
+
&.is-active .edit-site-global-styles-variations_item-preview,
|
|
44
|
+
&:focus-visible .edit-site-global-styles-variations_item-preview {
|
|
45
|
+
box-shadow: inset 0 0 0 $border-width $white, 0 0 0 var(--wp-admin-border-width-focus) $gray-900;
|
|
34
46
|
// Shown in Windows 10 high contrast mode.
|
|
35
|
-
outline: 3px
|
|
36
|
-
outline-offset: 0;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
47
|
+
outline-width: 3px;
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
&::after {
|
|
50
|
+
box-shadow: inset 0 0 0 1px $white;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
44
53
|
}
|
|
@@ -5,21 +5,27 @@ import {
|
|
|
5
5
|
__experimentalGrid as Grid,
|
|
6
6
|
__experimentalVStack as VStack,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Internal dependencies
|
|
12
11
|
*/
|
|
13
|
-
import Subtitle from '../subtitle';
|
|
14
12
|
import Variation from './variation';
|
|
15
13
|
import StylesPreviewColors from '../preview-colors';
|
|
14
|
+
import { useColorVariations } from '../hooks';
|
|
15
|
+
import Subtitle from '../subtitle';
|
|
16
|
+
|
|
17
|
+
export default function ColorVariations( { title, gap = 2 } ) {
|
|
18
|
+
const colorVariations = useColorVariations();
|
|
19
|
+
|
|
20
|
+
if ( ! colorVariations?.length ) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
16
23
|
|
|
17
|
-
export default function ColorVariations( { variations } ) {
|
|
18
24
|
return (
|
|
19
25
|
<VStack spacing={ 3 }>
|
|
20
|
-
<Subtitle level={ 3 }>{
|
|
21
|
-
<Grid columns={ 3 }>
|
|
22
|
-
{
|
|
26
|
+
{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }
|
|
27
|
+
<Grid columns={ 3 } gap={ gap }>
|
|
28
|
+
{ colorVariations.map( ( variation, index ) => (
|
|
23
29
|
<Variation key={ index } variation={ variation }>
|
|
24
30
|
{ () => <StylesPreviewColors /> }
|
|
25
31
|
</Variation>
|
|
@@ -1,84 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useContext } from '@wordpress/element';
|
|
5
4
|
import {
|
|
6
5
|
__experimentalGrid as Grid,
|
|
6
|
+
__experimentalVStack as HStack,
|
|
7
7
|
__experimentalVStack as VStack,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* Internal dependencies
|
|
14
12
|
*/
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import PreviewTypography from '../preview-typography';
|
|
19
|
-
import Subtitle from '../subtitle';
|
|
20
|
-
import { getFontFamilies } from '../utils';
|
|
13
|
+
import { useTypographyVariations } from '../hooks';
|
|
14
|
+
import TypographyExample from '../typography-example';
|
|
15
|
+
import PreviewIframe from '../preview-iframe';
|
|
21
16
|
import Variation from './variation';
|
|
17
|
+
import Subtitle from '../subtitle';
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export default function TypographyVariations() {
|
|
26
|
-
const typographyVariations =
|
|
27
|
-
useCurrentMergeThemeStyleVariationsWithUserConfig( {
|
|
28
|
-
property: 'typography',
|
|
29
|
-
filter: ( variation ) =>
|
|
30
|
-
variation?.settings?.typography?.fontFamilies &&
|
|
31
|
-
Object.keys( variation?.settings?.typography?.fontFamilies )
|
|
32
|
-
.length,
|
|
33
|
-
} );
|
|
34
|
-
|
|
35
|
-
const { base } = useContext( GlobalStylesContext );
|
|
36
|
-
|
|
37
|
-
/*
|
|
38
|
-
* Filter duplicate variations based on the font families used in the variation.
|
|
39
|
-
*/
|
|
40
|
-
const uniqueTypographyVariations = typographyVariations?.length
|
|
41
|
-
? Object.values(
|
|
42
|
-
typographyVariations.reduce( ( acc, variation ) => {
|
|
43
|
-
const [ bodyFontFamily, headingFontFamily ] =
|
|
44
|
-
getFontFamilies(
|
|
45
|
-
mergeBaseAndUserConfigs( base, variation )
|
|
46
|
-
);
|
|
47
|
-
if (
|
|
48
|
-
headingFontFamily?.name &&
|
|
49
|
-
bodyFontFamily?.name &&
|
|
50
|
-
! acc[
|
|
51
|
-
`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
|
|
52
|
-
]
|
|
53
|
-
) {
|
|
54
|
-
acc[
|
|
55
|
-
`${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
|
|
56
|
-
] = variation;
|
|
57
|
-
}
|
|
19
|
+
export default function TypographyVariations( { title, gap = 2 } ) {
|
|
20
|
+
const typographyVariations = useTypographyVariations();
|
|
58
21
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
: [];
|
|
22
|
+
if ( ! typographyVariations?.length ) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
63
25
|
|
|
64
26
|
return (
|
|
65
27
|
<VStack spacing={ 3 }>
|
|
66
|
-
<Subtitle level={ 3 }>{
|
|
28
|
+
{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }
|
|
67
29
|
<Grid
|
|
68
30
|
columns={ 3 }
|
|
31
|
+
gap={ gap }
|
|
69
32
|
className="edit-site-global-styles-style-variations-container"
|
|
70
33
|
>
|
|
71
|
-
{ typographyVariations &&
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
34
|
+
{ typographyVariations &&
|
|
35
|
+
typographyVariations.length &&
|
|
36
|
+
typographyVariations.map( ( variation, index ) => (
|
|
37
|
+
<Variation key={ index } variation={ variation }>
|
|
38
|
+
{ ( isFocused ) => (
|
|
39
|
+
<PreviewIframe
|
|
40
|
+
label={ variation?.title }
|
|
41
|
+
isFocused={ isFocused }
|
|
42
|
+
>
|
|
43
|
+
{ ( { ratio, key } ) => (
|
|
44
|
+
<HStack
|
|
45
|
+
key={ key }
|
|
46
|
+
spacing={ 10 * ratio }
|
|
47
|
+
justify="center"
|
|
48
|
+
style={ {
|
|
49
|
+
height: '100%',
|
|
50
|
+
overflow: 'hidden',
|
|
51
|
+
} }
|
|
52
|
+
>
|
|
53
|
+
<TypographyExample
|
|
54
|
+
variation={ variation }
|
|
55
|
+
fontSize={ 85 * ratio }
|
|
56
|
+
/>
|
|
57
|
+
</HStack>
|
|
58
|
+
) }
|
|
59
|
+
</PreviewIframe>
|
|
60
|
+
) }
|
|
61
|
+
</Variation>
|
|
62
|
+
) ) }
|
|
82
63
|
</Grid>
|
|
83
64
|
</VStack>
|
|
84
65
|
);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
$header-toolbar-min-width: 335px;
|
|
2
|
-
|
|
3
1
|
.edit-site-header-edit-mode {
|
|
4
2
|
height: $header-height;
|
|
5
3
|
align-items: center;
|
|
@@ -16,46 +14,62 @@ $header-toolbar-min-width: 335px;
|
|
|
16
14
|
display: flex;
|
|
17
15
|
border: none;
|
|
18
16
|
align-items: center;
|
|
17
|
+
flex-grow: 1;
|
|
19
18
|
flex-shrink: 2;
|
|
20
|
-
// We need this to be overflow hidden so the block toolbar can
|
|
21
|
-
// overflow scroll. If the overflow is visible, flexbox allows
|
|
22
|
-
// the toolbar to grow outside of the allowed container space.
|
|
23
|
-
overflow: hidden;
|
|
24
19
|
// Take up the full height of the header so the border focus
|
|
25
20
|
// is visible on toolbar buttons.
|
|
26
21
|
height: 100%;
|
|
27
22
|
// Allow focus ring to be fully visible on furthest right button.
|
|
28
23
|
@include break-medium() {
|
|
24
|
+
// Account for the site hub, which is 60x60px.
|
|
25
|
+
flex-basis: calc(37.5% - 60px);
|
|
29
26
|
padding-right: 2px;
|
|
27
|
+
// We need this to be overflow hidden so the block toolbar can
|
|
28
|
+
// overflow scroll. If the overflow is visible, flexbox allows
|
|
29
|
+
// the toolbar to grow outside of the allowed container space.
|
|
30
|
+
overflow: hidden;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
.edit-site-header-edit-mode__end {
|
|
34
35
|
display: flex;
|
|
35
36
|
justify-content: flex-end;
|
|
37
|
+
height: 100%;
|
|
38
|
+
flex-grow: 1;
|
|
39
|
+
flex-shrink: 1;
|
|
40
|
+
|
|
41
|
+
@include break-medium() {
|
|
42
|
+
flex-basis: 37.5%;
|
|
43
|
+
}
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
.edit-site-header-edit-mode__center {
|
|
39
|
-
display: flex;
|
|
40
47
|
align-items: center;
|
|
41
|
-
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-basis: 100%;
|
|
42
50
|
flex-grow: 1;
|
|
43
|
-
|
|
51
|
+
flex-shrink: 2;
|
|
52
|
+
height: 100%;
|
|
44
53
|
justify-content: center;
|
|
54
|
+
|
|
45
55
|
// Flex items will, by default, refuse to shrink below a minimum
|
|
46
56
|
// intrinsic width. In order to shrink this flexbox item, and
|
|
47
57
|
// subsequently truncate child text, we set an explicit min-width.
|
|
48
58
|
// See https://dev.w3.org/csswg/css-flexbox/#min-size-auto
|
|
49
59
|
min-width: 0;
|
|
60
|
+
|
|
61
|
+
@include break-medium() {
|
|
62
|
+
flex-basis: 25%;
|
|
63
|
+
}
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
}
|
|
53
67
|
|
|
54
68
|
.edit-site-header-edit-mode__toolbar {
|
|
55
|
-
display: flex;
|
|
56
69
|
align-items: center;
|
|
57
|
-
|
|
70
|
+
display: flex;
|
|
58
71
|
gap: $grid-unit-10;
|
|
72
|
+
padding-left: $grid-unit-20;
|
|
59
73
|
|
|
60
74
|
@include break-medium() {
|
|
61
75
|
padding-left: $grid-unit-50 * 0.5;
|
|
@@ -87,12 +101,9 @@ $header-toolbar-min-width: 335px;
|
|
|
87
101
|
display: inline-flex;
|
|
88
102
|
align-items: center;
|
|
89
103
|
flex-wrap: nowrap;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
padding-right: $grid-unit-10;
|
|
94
|
-
}
|
|
95
|
-
|
|
104
|
+
// Ensure actions do not press against .edit-site-header-edit-mode__center.
|
|
105
|
+
padding-left: $grid-unit-10;
|
|
106
|
+
padding-right: $grid-unit-10;
|
|
96
107
|
gap: $grid-unit-10;
|
|
97
108
|
}
|
|
98
109
|
|
|
@@ -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
|
];
|
|
@@ -142,6 +142,10 @@ export default function KeyboardShortcutHelpModal() {
|
|
|
142
142
|
title={ __( 'Text formatting' ) }
|
|
143
143
|
shortcuts={ textFormattingShortcuts }
|
|
144
144
|
/>
|
|
145
|
+
<ShortcutCategorySection
|
|
146
|
+
title={ __( 'List View shortcuts' ) }
|
|
147
|
+
categoryName="list-view"
|
|
148
|
+
/>
|
|
145
149
|
</Modal>
|
|
146
150
|
);
|
|
147
151
|
}
|
|
@@ -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;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Controller } from '@react-spring/web';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useLayoutEffect, useMemo, useRef } from '@wordpress/element';
|
|
10
|
+
|
|
11
|
+
function getAbsolutePosition( element ) {
|
|
12
|
+
return {
|
|
13
|
+
top: element.offsetTop,
|
|
14
|
+
left: element.offsetLeft,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const ANIMATION_DURATION = 300;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Hook used to compute the styles required to move a div into a new position.
|
|
22
|
+
*
|
|
23
|
+
* The way this animation works is the following:
|
|
24
|
+
* - It first renders the element as if there was no animation.
|
|
25
|
+
* - It takes a snapshot of the position of the block to use it
|
|
26
|
+
* as a destination point for the animation.
|
|
27
|
+
* - It restores the element to the previous position using a CSS transform
|
|
28
|
+
* - It uses the "resetAnimation" flag to reset the animation
|
|
29
|
+
* from the beginning in order to animate to the new destination point.
|
|
30
|
+
*
|
|
31
|
+
* @param {Object} $1 Options
|
|
32
|
+
* @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes.
|
|
33
|
+
*/
|
|
34
|
+
function useMovingAnimation( { triggerAnimationOnChange } ) {
|
|
35
|
+
const ref = useRef();
|
|
36
|
+
|
|
37
|
+
// Whenever the trigger changes, we need to take a snapshot of the current
|
|
38
|
+
// position of the block to use it as a destination point for the animation.
|
|
39
|
+
const { previous, prevRect } = useMemo(
|
|
40
|
+
() => ( {
|
|
41
|
+
previous: ref.current && getAbsolutePosition( ref.current ),
|
|
42
|
+
prevRect: ref.current && ref.current.getBoundingClientRect(),
|
|
43
|
+
} ),
|
|
44
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
+
[ triggerAnimationOnChange ]
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
useLayoutEffect( () => {
|
|
49
|
+
if ( ! previous || ! ref.current ) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// We disable the animation if the user has a preference for reduced
|
|
54
|
+
// motion.
|
|
55
|
+
const disableAnimation = window.matchMedia(
|
|
56
|
+
'(prefers-reduced-motion: reduce)'
|
|
57
|
+
).matches;
|
|
58
|
+
|
|
59
|
+
if ( disableAnimation ) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const controller = new Controller( {
|
|
64
|
+
x: 0,
|
|
65
|
+
y: 0,
|
|
66
|
+
width: prevRect.width,
|
|
67
|
+
height: prevRect.height,
|
|
68
|
+
config: { duration: ANIMATION_DURATION },
|
|
69
|
+
onChange( { value } ) {
|
|
70
|
+
if ( ! ref.current ) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let { x, y, width, height } = value;
|
|
74
|
+
x = Math.round( x );
|
|
75
|
+
y = Math.round( y );
|
|
76
|
+
width = Math.round( width );
|
|
77
|
+
height = Math.round( height );
|
|
78
|
+
const finishedMoving = x === 0 && y === 0;
|
|
79
|
+
ref.current.style.transformOrigin = 'center center';
|
|
80
|
+
ref.current.style.transform = finishedMoving
|
|
81
|
+
? null // Set to `null` to explicitly remove the transform.
|
|
82
|
+
: `translate3d(${ x }px,${ y }px,0)`;
|
|
83
|
+
ref.current.style.width = finishedMoving
|
|
84
|
+
? null
|
|
85
|
+
: `${ width }px`;
|
|
86
|
+
ref.current.style.height = finishedMoving
|
|
87
|
+
? null
|
|
88
|
+
: `${ height }px`;
|
|
89
|
+
},
|
|
90
|
+
} );
|
|
91
|
+
|
|
92
|
+
ref.current.style.transform = undefined;
|
|
93
|
+
const destination = ref.current.getBoundingClientRect();
|
|
94
|
+
|
|
95
|
+
const x = Math.round( prevRect.left - destination.left );
|
|
96
|
+
const y = Math.round( prevRect.top - destination.top );
|
|
97
|
+
const width = destination.width;
|
|
98
|
+
const height = destination.height;
|
|
99
|
+
|
|
100
|
+
controller.start( {
|
|
101
|
+
x: 0,
|
|
102
|
+
y: 0,
|
|
103
|
+
width,
|
|
104
|
+
height,
|
|
105
|
+
from: { x, y, width: prevRect.width, height: prevRect.height },
|
|
106
|
+
} );
|
|
107
|
+
|
|
108
|
+
return () => {
|
|
109
|
+
controller.stop();
|
|
110
|
+
controller.set( {
|
|
111
|
+
x: 0,
|
|
112
|
+
y: 0,
|
|
113
|
+
width: prevRect.width,
|
|
114
|
+
height: prevRect.height,
|
|
115
|
+
} );
|
|
116
|
+
};
|
|
117
|
+
}, [ previous, prevRect ] );
|
|
118
|
+
|
|
119
|
+
return ref;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export default useMovingAnimation;
|
|
@@ -51,12 +51,13 @@ import { useCommonCommands } from '../../hooks/commands/use-common-commands';
|
|
|
51
51
|
import { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';
|
|
52
52
|
import { useIsSiteEditorLoading } from './hooks';
|
|
53
53
|
import useLayoutAreas from './router';
|
|
54
|
+
import useMovingAnimation from './animation';
|
|
54
55
|
|
|
55
56
|
const { useCommands } = unlock( coreCommandsPrivateApis );
|
|
56
57
|
const { useCommandContext } = unlock( commandsPrivateApis );
|
|
57
58
|
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
58
59
|
|
|
59
|
-
const ANIMATION_DURATION = 0.
|
|
60
|
+
const ANIMATION_DURATION = 0.3;
|
|
60
61
|
|
|
61
62
|
export default function Layout() {
|
|
62
63
|
// This ensures the edited entity id and type are initialized properly.
|
|
@@ -114,7 +115,10 @@ export default function Layout() {
|
|
|
114
115
|
const isEditorLoading = useIsSiteEditorLoading();
|
|
115
116
|
const [ isResizableFrameOversized, setIsResizableFrameOversized ] =
|
|
116
117
|
useState( false );
|
|
117
|
-
const { areas, widths } = useLayoutAreas();
|
|
118
|
+
const { key: routeKey, areas, widths } = useLayoutAreas();
|
|
119
|
+
const animationRef = useMovingAnimation( {
|
|
120
|
+
triggerAnimationOnChange: canvasMode + '__' + routeKey,
|
|
121
|
+
} );
|
|
118
122
|
|
|
119
123
|
// This determines which animation variant should apply to the header.
|
|
120
124
|
// There is also a `isDistractionFreeHovering` state that gets priority
|
|
@@ -239,7 +243,9 @@ export default function Layout() {
|
|
|
239
243
|
} }
|
|
240
244
|
transition={ {
|
|
241
245
|
type: 'tween',
|
|
242
|
-
duration: disableMotion
|
|
246
|
+
duration: disableMotion
|
|
247
|
+
? 0
|
|
248
|
+
: ANIMATION_DURATION,
|
|
243
249
|
ease: 'easeOut',
|
|
244
250
|
} }
|
|
245
251
|
>
|
|
@@ -315,22 +321,7 @@ export default function Layout() {
|
|
|
315
321
|
<div className="edit-site-layout__canvas-container">
|
|
316
322
|
{ canvasResizer }
|
|
317
323
|
{ !! canvasSize.width && (
|
|
318
|
-
<
|
|
319
|
-
whileHover={
|
|
320
|
-
canvasMode === 'view'
|
|
321
|
-
? {
|
|
322
|
-
scale: 1.005,
|
|
323
|
-
transition: {
|
|
324
|
-
duration: disableMotion
|
|
325
|
-
? 0
|
|
326
|
-
: 0.5,
|
|
327
|
-
ease: 'easeOut',
|
|
328
|
-
},
|
|
329
|
-
}
|
|
330
|
-
: {}
|
|
331
|
-
}
|
|
332
|
-
initial={ false }
|
|
333
|
-
layout="position"
|
|
324
|
+
<div
|
|
334
325
|
className={ classnames(
|
|
335
326
|
'edit-site-layout__canvas',
|
|
336
327
|
{
|
|
@@ -338,13 +329,7 @@ export default function Layout() {
|
|
|
338
329
|
isResizableFrameOversized,
|
|
339
330
|
}
|
|
340
331
|
) }
|
|
341
|
-
|
|
342
|
-
type: 'tween',
|
|
343
|
-
duration: disableMotion
|
|
344
|
-
? 0
|
|
345
|
-
: ANIMATION_DURATION,
|
|
346
|
-
ease: 'easeOut',
|
|
347
|
-
} }
|
|
332
|
+
ref={ animationRef }
|
|
348
333
|
>
|
|
349
334
|
<ErrorBoundary>
|
|
350
335
|
<ResizableFrame
|
|
@@ -373,7 +358,7 @@ export default function Layout() {
|
|
|
373
358
|
{ areas.preview }
|
|
374
359
|
</ResizableFrame>
|
|
375
360
|
</ErrorBoundary>
|
|
376
|
-
</
|
|
361
|
+
</div>
|
|
377
362
|
) }
|
|
378
363
|
</div>
|
|
379
364
|
) }
|