@wordpress/edit-site 4.18.0 → 5.0.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 +8 -0
- package/build/components/add-new-template/add-custom-template-modal.js +4 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/index.js +8 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +21 -6
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +12 -8
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +15 -30
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +64 -0
- package/build/components/block-editor/editor-canvas.js.map +1 -0
- package/build/components/block-editor/index.js +61 -59
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +13 -85
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/editor/index.js +80 -127
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +42 -0
- package/build/components/global-styles/block-preview-panel.js.map +1 -0
- package/build/components/global-styles/context-menu.js +6 -2
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +61 -0
- package/build/components/global-styles/custom-css.js.map +1 -0
- package/build/components/global-styles/dimensions-panel.js +42 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +15 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/hooks.js +37 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +9 -2
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +10 -2
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-border.js +43 -0
- package/build/components/global-styles/screen-border.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +1 -1
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +42 -0
- package/build/components/global-styles/screen-css.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +0 -5
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-root.js +14 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +3 -3
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +52 -16
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +50 -4
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +47 -8
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +3 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -8
- package/build/components/global-styles-renderer/index.js.map +1 -0
- package/build/components/header-edit-mode/document-actions/index.js +14 -5
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +31 -17
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +14 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +231 -0
- package/build/components/layout/index.js.map +1 -0
- package/build/components/list/header.js +5 -1
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +4 -22
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +1 -1
- package/build/components/list/table.js.map +1 -1
- package/build/components/list/use-register-shortcuts.js +3 -0
- package/build/components/list/use-register-shortcuts.js.map +1 -1
- package/build/components/navigate-to-link/index.js +1 -3
- package/build/components/navigate-to-link/index.js.map +1 -1
- package/build/components/routes/index.js +1 -1
- package/build/components/routes/index.js.map +1 -1
- package/build/components/save-button/index.js +20 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +42 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +24 -4
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -1
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-card/index.js +4 -2
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +53 -0
- package/build/components/sidebar-navigation-item/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +49 -0
- package/build/components/sidebar-navigation-screen/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-main/index.js +76 -0
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +188 -0
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -0
- package/build/components/site-icon/index.js +70 -0
- package/build/components/site-icon/index.js.map +1 -0
- package/build/components/site-title/index.js +55 -0
- package/build/components/site-title/index.js.map +1 -0
- package/build/components/style-book/index.js +173 -0
- package/build/components/style-book/index.js.map +1 -0
- package/build/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +5 -4
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +53 -0
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
- package/build/components/template-details/index.js +4 -2
- package/build/components/template-details/index.js.map +1 -1
- package/build/index.js +2 -45
- package/build/index.js.map +1 -1
- package/build/store/actions.js +93 -43
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +35 -107
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +69 -78
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +3 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/index.js +7 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +18 -6
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +13 -9
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +15 -28
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +51 -0
- package/build-module/components/block-editor/editor-canvas.js.map +1 -0
- package/build-module/components/block-editor/index.js +61 -60
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +15 -82
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/editor/index.js +81 -124
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +32 -0
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +7 -3
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +51 -0
- package/build-module/components/global-styles/custom-css.js.map +1 -0
- package/build-module/components/global-styles/dimensions-panel.js +43 -3
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +15 -2
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +32 -4
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +10 -4
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +2 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +8 -2
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +27 -0
- package/build-module/components/global-styles/screen-border.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +28 -0
- package/build-module/components/global-styles/screen-css.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +0 -4
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +14 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +2 -2
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +53 -16
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +48 -5
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +48 -9
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +4 -4
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -7
- package/build-module/components/global-styles-renderer/index.js.map +1 -0
- package/build-module/components/header-edit-mode/document-actions/index.js +14 -6
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +27 -16
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +13 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +203 -0
- package/build-module/components/layout/index.js.map +1 -0
- package/build-module/components/list/header.js +5 -1
- package/build-module/components/list/header.js.map +1 -1
- package/build-module/components/list/index.js +4 -19
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +1 -1
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/list/use-register-shortcuts.js +3 -0
- package/build-module/components/list/use-register-shortcuts.js.map +1 -1
- package/build-module/components/navigate-to-link/index.js +1 -3
- package/build-module/components/navigate-to-link/index.js.map +1 -1
- package/build-module/components/routes/index.js +1 -1
- package/build-module/components/routes/index.js.map +1 -1
- package/build-module/components/save-button/index.js +21 -2
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +30 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +27 -7
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +3 -3
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-card/index.js +3 -2
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +40 -0
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +39 -0
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +165 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -0
- package/build-module/components/site-icon/index.js +55 -0
- package/build-module/components/site-icon/index.js.map +1 -0
- package/build-module/components/site-title/index.js +43 -0
- package/build-module/components/site-title/index.js.map +1 -0
- package/build-module/components/style-book/index.js +156 -0
- package/build-module/components/style-book/index.js.map +1 -0
- package/build-module/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +4 -3
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +43 -0
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
- package/build-module/components/template-details/index.js +3 -2
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/index.js +5 -36
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +87 -42
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +35 -102
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +60 -72
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +558 -354
- package/build-style/style.css +558 -354
- package/package.json +33 -31
- package/src/components/add-new-template/add-custom-template-modal.js +6 -1
- package/src/components/add-new-template/index.js +6 -3
- package/src/components/add-new-template/new-template-part.js +15 -3
- package/src/components/add-new-template/new-template.js +14 -7
- package/src/components/add-new-template/style.scss +0 -4
- package/src/components/app/index.js +14 -43
- package/src/components/block-editor/editor-canvas.js +69 -0
- package/src/components/block-editor/index.js +102 -87
- package/src/components/block-editor/resizable-editor.js +12 -112
- package/src/components/block-editor/style.scss +25 -1
- package/src/components/code-editor/style.scss +1 -1
- package/src/components/editor/index.js +170 -236
- package/src/components/editor/style.scss +1 -29
- package/src/components/global-styles/block-preview-panel.js +29 -0
- package/src/components/global-styles/context-menu.js +11 -2
- package/src/components/global-styles/custom-css.js +73 -0
- package/src/components/global-styles/dimensions-panel.js +56 -1
- package/src/components/global-styles/global-styles-provider.js +39 -17
- package/src/components/global-styles/hooks.js +44 -3
- package/src/components/global-styles/palette.js +16 -2
- package/src/components/global-styles/screen-block-list.js +2 -1
- package/src/components/global-styles/screen-block.js +9 -1
- package/src/components/global-styles/screen-border.js +23 -0
- package/src/components/global-styles/screen-colors.js +2 -1
- package/src/components/global-styles/screen-css.js +33 -0
- package/src/components/global-styles/screen-layout.js +0 -3
- package/src/components/global-styles/screen-root.js +30 -1
- package/src/components/global-styles/screen-style-variations.js +5 -2
- package/src/components/global-styles/style.scss +31 -2
- package/src/components/global-styles/test/typography-utils.js +82 -98
- package/src/components/global-styles/test/use-global-styles-output.js +6 -6
- package/src/components/global-styles/typography-panel.js +57 -15
- package/src/components/global-styles/ui.js +47 -4
- package/src/components/global-styles/use-global-styles-output.js +52 -10
- package/src/components/global-styles/utils.js +8 -5
- package/src/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +3 -9
- package/src/components/header-edit-mode/document-actions/index.js +16 -10
- package/src/components/header-edit-mode/document-actions/style.scss +8 -1
- package/src/components/header-edit-mode/index.js +104 -82
- package/src/components/header-edit-mode/style.scss +5 -33
- package/src/components/keyboard-shortcuts/index.js +17 -0
- package/src/components/layout/index.js +278 -0
- package/src/components/layout/style.scss +176 -0
- package/src/components/list/header.js +5 -1
- package/src/components/list/index.js +12 -31
- package/src/components/list/style.scss +10 -4
- package/src/components/list/table.js +1 -1
- package/src/components/list/use-register-shortcuts.js +4 -0
- package/src/components/navigate-to-link/index.js +2 -8
- package/src/components/routes/index.js +1 -1
- package/src/components/save-button/index.js +17 -1
- package/src/components/sidebar/index.js +34 -0
- package/src/components/sidebar/style.scss +8 -0
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -7
- package/src/components/sidebar-edit-mode/index.js +3 -3
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/style.scss +21 -3
- package/src/components/sidebar-edit-mode/settings-header/style.scss +47 -34
- package/src/components/sidebar-edit-mode/style.scss +0 -13
- package/src/components/sidebar-edit-mode/template-card/index.js +3 -2
- package/src/components/sidebar-navigation-item/index.js +51 -0
- package/src/components/sidebar-navigation-item/style.scss +17 -0
- package/src/components/sidebar-navigation-screen/index.js +55 -0
- package/src/components/sidebar-navigation-screen/style.scss +41 -0
- package/src/components/sidebar-navigation-screen-main/index.js +72 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +181 -0
- package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
- package/src/components/site-icon/index.js +56 -0
- package/src/components/site-icon/style.scss +10 -0
- package/src/components/site-title/index.js +39 -0
- package/src/components/style-book/index.js +193 -0
- package/src/components/style-book/style.scss +78 -0
- package/src/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +3 -3
- package/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +36 -0
- package/src/components/template-details/index.js +3 -2
- package/src/components/template-details/style.scss +4 -0
- package/src/index.js +3 -53
- package/src/store/actions.js +93 -48
- package/src/store/reducer.js +29 -91
- package/src/store/selectors.js +61 -101
- package/src/store/test/actions.js +3 -15
- package/src/store/test/reducer.js +8 -192
- package/src/store/test/selectors.js +3 -42
- package/src/style.scss +19 -3
- package/build/components/editor/global-styles-renderer.js.map +0 -1
- package/build/components/navigation-sidebar/index.js +0 -62
- package/build/components/navigation-sidebar/index.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +0 -77
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +0 -152
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +0 -124
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
- package/build/components/url-query-controller/index.js.map +0 -1
- package/build-module/components/editor/global-styles-renderer.js.map +0 -1
- package/build-module/components/navigation-sidebar/index.js +0 -45
- package/build-module/components/navigation-sidebar/index.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +0 -49
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +0 -131
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -66
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +0 -108
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
- package/build-module/components/url-query-controller/index.js.map +0 -1
- package/src/components/navigation-sidebar/index.js +0 -46
- package/src/components/navigation-sidebar/navigation-panel/constants.js +0 -94
- package/src/components/navigation-sidebar/navigation-panel/index.js +0 -142
- package/src/components/navigation-sidebar/navigation-panel/style.scss +0 -159
- package/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
- package/src/components/navigation-sidebar/navigation-toggle/index.js +0 -114
- package/src/components/navigation-sidebar/navigation-toggle/style.scss +0 -71
- package/src/components/navigation-sidebar/navigation-toggle/test/__snapshots__/index.js.snap +0 -41
- package/src/components/navigation-sidebar/navigation-toggle/test/index.js +0 -69
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { get, isEmpty, kebabCase, pickBy,
|
|
4
|
+
import { get, isEmpty, kebabCase, pickBy, set } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -61,8 +61,7 @@ function compileStyleValue( uncompiledValue ) {
|
|
|
61
61
|
* @return {Array<Object>} An array of style declarations.
|
|
62
62
|
*/
|
|
63
63
|
function getPresetsDeclarations( blockPresets = {}, mergedSettings ) {
|
|
64
|
-
return reduce(
|
|
65
|
-
PRESET_METADATA,
|
|
64
|
+
return PRESET_METADATA.reduce(
|
|
66
65
|
( declarations, { path, valueKey, valueFunc, cssVarInfix } ) => {
|
|
67
66
|
const presetByOrigin = get( blockPresets, path, [] );
|
|
68
67
|
[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {
|
|
@@ -102,8 +101,7 @@ function getPresetsDeclarations( blockPresets = {}, mergedSettings ) {
|
|
|
102
101
|
* @return {string} CSS declarations for the preset classes.
|
|
103
102
|
*/
|
|
104
103
|
function getPresetsClasses( blockSelector, blockPresets = {} ) {
|
|
105
|
-
return reduce(
|
|
106
|
-
PRESET_METADATA,
|
|
104
|
+
return PRESET_METADATA.reduce(
|
|
107
105
|
( declarations, { path, cssVarInfix, classes } ) => {
|
|
108
106
|
if ( ! classes ) {
|
|
109
107
|
return declarations;
|
|
@@ -193,9 +191,11 @@ export function getStylesDeclarations(
|
|
|
193
191
|
tree = {}
|
|
194
192
|
) {
|
|
195
193
|
const isRoot = ROOT_BLOCK_SELECTOR === selector;
|
|
196
|
-
const output = reduce(
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
const output = Object.entries( STYLE_PROPERTY ).reduce(
|
|
195
|
+
(
|
|
196
|
+
declarations,
|
|
197
|
+
[ key, { value, properties, useEngine, rootOnly } ]
|
|
198
|
+
) => {
|
|
199
199
|
if ( rootOnly && ! isRoot ) {
|
|
200
200
|
return declarations;
|
|
201
201
|
}
|
|
@@ -453,6 +453,7 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
|
|
|
453
453
|
[
|
|
454
454
|
'border',
|
|
455
455
|
'color',
|
|
456
|
+
'dimensions',
|
|
456
457
|
'spacing',
|
|
457
458
|
'typography',
|
|
458
459
|
'filter',
|
|
@@ -845,8 +846,44 @@ export const getBlockSelectors = ( blockTypes ) => {
|
|
|
845
846
|
return result;
|
|
846
847
|
};
|
|
847
848
|
|
|
849
|
+
/**
|
|
850
|
+
* If there is a separator block whose color is defined in theme.json via background,
|
|
851
|
+
* update the separator color to the same value by using border color.
|
|
852
|
+
*
|
|
853
|
+
* @param {Object} config Theme.json configuration file object.
|
|
854
|
+
* @return {Object} configTheme.json configuration file object updated.
|
|
855
|
+
*/
|
|
856
|
+
function updateConfigWithSeparator( config ) {
|
|
857
|
+
const needsSeparatorStyleUpdate =
|
|
858
|
+
config.styles?.blocks[ 'core/separator' ] &&
|
|
859
|
+
config.styles?.blocks[ 'core/separator' ].color?.background &&
|
|
860
|
+
! config.styles?.blocks[ 'core/separator' ].color?.text &&
|
|
861
|
+
! config.styles?.blocks[ 'core/separator' ].border?.color;
|
|
862
|
+
if ( needsSeparatorStyleUpdate ) {
|
|
863
|
+
return {
|
|
864
|
+
...config,
|
|
865
|
+
styles: {
|
|
866
|
+
...config.styles,
|
|
867
|
+
blocks: {
|
|
868
|
+
...config.styles.blocks,
|
|
869
|
+
'core/separator': {
|
|
870
|
+
...config.styles.blocks[ 'core/separator' ],
|
|
871
|
+
color: {
|
|
872
|
+
...config.styles.blocks[ 'core/separator' ].color,
|
|
873
|
+
text: config.styles?.blocks[ 'core/separator' ]
|
|
874
|
+
.color.background,
|
|
875
|
+
},
|
|
876
|
+
},
|
|
877
|
+
},
|
|
878
|
+
},
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
return config;
|
|
882
|
+
}
|
|
883
|
+
|
|
848
884
|
export function useGlobalStylesOutput() {
|
|
849
|
-
|
|
885
|
+
let { merged: mergedConfig } = useContext( GlobalStylesContext );
|
|
886
|
+
|
|
850
887
|
const [ blockGap ] = useSetting( 'spacing.blockGap' );
|
|
851
888
|
const hasBlockGapSupport = blockGap !== null;
|
|
852
889
|
const hasFallbackGapSupport = ! hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support.
|
|
@@ -859,7 +896,7 @@ export function useGlobalStylesOutput() {
|
|
|
859
896
|
if ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {
|
|
860
897
|
return [];
|
|
861
898
|
}
|
|
862
|
-
|
|
899
|
+
mergedConfig = updateConfigWithSeparator( mergedConfig );
|
|
863
900
|
const blockSelectors = getBlockSelectors( getBlockTypes() );
|
|
864
901
|
const customProperties = toCustomProperties(
|
|
865
902
|
mergedConfig,
|
|
@@ -882,6 +919,11 @@ export function useGlobalStylesOutput() {
|
|
|
882
919
|
css: globalStyles,
|
|
883
920
|
isGlobalStyles: true,
|
|
884
921
|
},
|
|
922
|
+
// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.
|
|
923
|
+
{
|
|
924
|
+
css: mergedConfig.styles.css ?? '',
|
|
925
|
+
isGlobalStyles: true,
|
|
926
|
+
},
|
|
885
927
|
];
|
|
886
928
|
|
|
887
929
|
return [ stylesheets, mergedConfig.settings, filters ];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { get
|
|
4
|
+
import { get } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -120,8 +120,7 @@ function findInPresetsBy(
|
|
|
120
120
|
for ( const origin of origins ) {
|
|
121
121
|
const presets = presetByOrigin[ origin ];
|
|
122
122
|
if ( presets ) {
|
|
123
|
-
const presetObject = find(
|
|
124
|
-
presets,
|
|
123
|
+
const presetObject = presets.find(
|
|
125
124
|
( preset ) =>
|
|
126
125
|
preset[ presetProperty ] === presetValueValue
|
|
127
126
|
);
|
|
@@ -164,7 +163,9 @@ export function getPresetVariableFromValue(
|
|
|
164
163
|
|
|
165
164
|
const cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];
|
|
166
165
|
|
|
167
|
-
const metadata = find(
|
|
166
|
+
const metadata = PRESET_METADATA.find(
|
|
167
|
+
( data ) => data.cssVarInfix === cssVarInfix
|
|
168
|
+
);
|
|
168
169
|
|
|
169
170
|
if ( ! metadata ) {
|
|
170
171
|
// The property doesn't have preset data
|
|
@@ -196,7 +197,9 @@ function getValueFromPresetVariable(
|
|
|
196
197
|
variable,
|
|
197
198
|
[ presetType, slug ]
|
|
198
199
|
) {
|
|
199
|
-
const metadata = find(
|
|
200
|
+
const metadata = PRESET_METADATA.find(
|
|
201
|
+
( data ) => data.cssVarInfix === presetType
|
|
202
|
+
);
|
|
200
203
|
if ( ! metadata ) {
|
|
201
204
|
return variable;
|
|
202
205
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { filter } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -30,10 +25,9 @@ function useGlobalStylesRenderer() {
|
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
const currentStoreSettings = getSettings();
|
|
33
|
-
const nonGlobalStyles =
|
|
34
|
-
currentStoreSettings.styles
|
|
35
|
-
|
|
36
|
-
);
|
|
28
|
+
const nonGlobalStyles = Object.values(
|
|
29
|
+
currentStoreSettings.styles ?? []
|
|
30
|
+
).filter( ( style ) => ! style.isGlobalStyles );
|
|
37
31
|
updateSettings( {
|
|
38
32
|
...currentStoreSettings,
|
|
39
33
|
styles: [ ...nonGlobalStyles, ...styles ],
|
|
@@ -20,10 +20,15 @@ import {
|
|
|
20
20
|
} from '@wordpress/components';
|
|
21
21
|
import { chevronDown } from '@wordpress/icons';
|
|
22
22
|
import { useState, useMemo } from '@wordpress/element';
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
store as blockEditorStore,
|
|
25
|
+
useBlockDisplayInformation,
|
|
26
|
+
BlockIcon,
|
|
27
|
+
} from '@wordpress/block-editor';
|
|
24
28
|
import { store as coreStore } from '@wordpress/core-data';
|
|
25
29
|
import { store as editorStore } from '@wordpress/editor';
|
|
26
30
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
31
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
34
|
* Internal dependencies
|
|
@@ -51,10 +56,13 @@ function useSecondaryText() {
|
|
|
51
56
|
[]
|
|
52
57
|
);
|
|
53
58
|
|
|
59
|
+
const blockInformation = useBlockDisplayInformation( activeEntityBlockId );
|
|
60
|
+
|
|
54
61
|
if ( activeEntityBlockId ) {
|
|
55
62
|
return {
|
|
56
63
|
label: getBlockDisplayText( getBlock( activeEntityBlockId ) ),
|
|
57
64
|
isActive: true,
|
|
65
|
+
icon: blockInformation?.icon,
|
|
58
66
|
};
|
|
59
67
|
}
|
|
60
68
|
|
|
@@ -89,9 +97,10 @@ export default function DocumentActions() {
|
|
|
89
97
|
templateType: postType,
|
|
90
98
|
};
|
|
91
99
|
}, [] );
|
|
100
|
+
|
|
92
101
|
const entityLabel =
|
|
93
102
|
templateType === 'wp_template_part' ? 'template part' : 'template';
|
|
94
|
-
const { label } = useSecondaryText();
|
|
103
|
+
const { label, icon } = useSecondaryText();
|
|
95
104
|
|
|
96
105
|
// Use internal state instead of a ref to make sure that the component
|
|
97
106
|
// re-renders when the popover's anchor updates.
|
|
@@ -147,15 +156,12 @@ export default function DocumentActions() {
|
|
|
147
156
|
entityLabel
|
|
148
157
|
) }
|
|
149
158
|
</VisuallyHidden>
|
|
150
|
-
{ entityTitle }
|
|
151
|
-
</Text>
|
|
152
|
-
|
|
153
|
-
<Text
|
|
154
|
-
size="body"
|
|
155
|
-
className="edit-site-document-actions__secondary-item"
|
|
156
|
-
>
|
|
157
|
-
{ label ?? '' }
|
|
159
|
+
{ decodeEntities( entityTitle ) }
|
|
158
160
|
</Text>
|
|
161
|
+
<div className="edit-site-document-actions__secondary-item">
|
|
162
|
+
<BlockIcon icon={ icon } showColors />
|
|
163
|
+
<Text size="body">{ label ?? '' }</Text>
|
|
164
|
+
</div>
|
|
159
165
|
|
|
160
166
|
<Dropdown
|
|
161
167
|
popoverProps={ popoverProps }
|
|
@@ -41,9 +41,12 @@
|
|
|
41
41
|
white-space: nowrap;
|
|
42
42
|
overflow: hidden;
|
|
43
43
|
text-overflow: ellipsis;
|
|
44
|
+
color: currentColor;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.edit-site-document-actions__secondary-item {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
47
50
|
white-space: nowrap;
|
|
48
51
|
overflow: hidden;
|
|
49
52
|
text-overflow: ellipsis;
|
|
@@ -51,9 +54,13 @@
|
|
|
51
54
|
opacity: 0;
|
|
52
55
|
padding: 0;
|
|
53
56
|
transition: all ease 0.2s;
|
|
54
|
-
background:
|
|
57
|
+
background: rgba(var(--wp-block-synced-color--rgb), 0.04);
|
|
55
58
|
border-radius: 2px;
|
|
56
59
|
@include reduce-motion(transition);
|
|
60
|
+
|
|
61
|
+
.block-editor-block-icon.has-colors {
|
|
62
|
+
color: var(--wp-block-synced-color);
|
|
63
|
+
}
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
&.has-secondary-label {
|
|
@@ -8,6 +8,7 @@ import classnames from 'classnames';
|
|
|
8
8
|
*/
|
|
9
9
|
import { useCallback, useRef } from '@wordpress/element';
|
|
10
10
|
import { useViewportMatch } from '@wordpress/compose';
|
|
11
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
11
12
|
import {
|
|
12
13
|
ToolSelector,
|
|
13
14
|
__experimentalPreviewOptions as PreviewOptions,
|
|
@@ -26,6 +27,7 @@ import {
|
|
|
26
27
|
VisuallyHidden,
|
|
27
28
|
} from '@wordpress/components';
|
|
28
29
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
30
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
33
|
* Internal dependencies
|
|
@@ -36,12 +38,13 @@ import UndoButton from './undo-redo/undo';
|
|
|
36
38
|
import RedoButton from './undo-redo/redo';
|
|
37
39
|
import DocumentActions from './document-actions';
|
|
38
40
|
import { store as editSiteStore } from '../../store';
|
|
41
|
+
import { useHasStyleBook } from '../style-book';
|
|
39
42
|
|
|
40
43
|
const preventDefault = ( event ) => {
|
|
41
44
|
event.preventDefault();
|
|
42
45
|
};
|
|
43
46
|
|
|
44
|
-
export default function
|
|
47
|
+
export default function HeaderEditMode() {
|
|
45
48
|
const inserterButton = useRef();
|
|
46
49
|
const {
|
|
47
50
|
deviceType,
|
|
@@ -50,8 +53,9 @@ export default function Header( { showIconLabels } ) {
|
|
|
50
53
|
isListViewOpen,
|
|
51
54
|
listViewShortcut,
|
|
52
55
|
isVisualMode,
|
|
53
|
-
settings,
|
|
54
56
|
blockEditorMode,
|
|
57
|
+
homeUrl,
|
|
58
|
+
showIconLabels,
|
|
55
59
|
} = useSelect( ( select ) => {
|
|
56
60
|
const {
|
|
57
61
|
__experimentalGetPreviewDeviceType,
|
|
@@ -59,13 +63,16 @@ export default function Header( { showIconLabels } ) {
|
|
|
59
63
|
isInserterOpened,
|
|
60
64
|
isListViewOpened,
|
|
61
65
|
getEditorMode,
|
|
62
|
-
getSettings,
|
|
63
66
|
} = select( editSiteStore );
|
|
64
67
|
const { getShortcutRepresentation } = select( keyboardShortcutsStore );
|
|
65
68
|
const { __unstableGetEditorMode } = select( blockEditorStore );
|
|
66
69
|
|
|
67
70
|
const postType = getEditedPostType();
|
|
68
71
|
|
|
72
|
+
const {
|
|
73
|
+
getUnstableBase, // Site index.
|
|
74
|
+
} = select( coreStore );
|
|
75
|
+
|
|
69
76
|
return {
|
|
70
77
|
deviceType: __experimentalGetPreviewDeviceType(),
|
|
71
78
|
templateType: postType,
|
|
@@ -75,8 +82,12 @@ export default function Header( { showIconLabels } ) {
|
|
|
75
82
|
'core/edit-site/toggle-list-view'
|
|
76
83
|
),
|
|
77
84
|
isVisualMode: getEditorMode() === 'visual',
|
|
78
|
-
settings: getSettings(),
|
|
79
85
|
blockEditorMode: __unstableGetEditorMode(),
|
|
86
|
+
homeUrl: getUnstableBase()?.home,
|
|
87
|
+
showIconLabels: select( preferencesStore ).get(
|
|
88
|
+
'core/edit-site',
|
|
89
|
+
'showIconLabels'
|
|
90
|
+
),
|
|
80
91
|
};
|
|
81
92
|
}, [] );
|
|
82
93
|
|
|
@@ -103,6 +114,8 @@ export default function Header( { showIconLabels } ) {
|
|
|
103
114
|
[ setIsListViewOpened, isListViewOpen ]
|
|
104
115
|
);
|
|
105
116
|
|
|
117
|
+
const hasStyleBook = useHasStyleBook();
|
|
118
|
+
|
|
106
119
|
const isFocusMode = templateType === 'wp_template_part';
|
|
107
120
|
|
|
108
121
|
/* translators: button label text should, if possible, be under 16 characters. */
|
|
@@ -117,93 +130,102 @@ export default function Header( { showIconLabels } ) {
|
|
|
117
130
|
const isZoomedOutView = blockEditorMode === 'zoom-out';
|
|
118
131
|
|
|
119
132
|
return (
|
|
120
|
-
<div
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
isPressed={ isListViewOpen }
|
|
169
|
-
/* translators: button label text should, if possible, be under 16 characters. */
|
|
170
|
-
label={ __( 'List View' ) }
|
|
171
|
-
onClick={ toggleListView }
|
|
172
|
-
shortcut={ listViewShortcut }
|
|
173
|
-
showTooltip={ ! showIconLabels }
|
|
174
|
-
variant={
|
|
175
|
-
showIconLabels ? 'tertiary' : undefined
|
|
176
|
-
}
|
|
177
|
-
/>
|
|
178
|
-
{ isZoomedOutViewExperimentEnabled && (
|
|
133
|
+
<div
|
|
134
|
+
className={ classnames( 'edit-site-header-edit-mode', {
|
|
135
|
+
'show-icon-labels': showIconLabels,
|
|
136
|
+
} ) }
|
|
137
|
+
>
|
|
138
|
+
{ ! hasStyleBook && (
|
|
139
|
+
<NavigableToolbar
|
|
140
|
+
className="edit-site-header-edit-mode__start"
|
|
141
|
+
aria-label={ __( 'Document tools' ) }
|
|
142
|
+
>
|
|
143
|
+
<div className="edit-site-header-edit-mode__toolbar">
|
|
144
|
+
<ToolbarItem
|
|
145
|
+
ref={ inserterButton }
|
|
146
|
+
as={ Button }
|
|
147
|
+
className="edit-site-header-edit-mode__inserter-toggle"
|
|
148
|
+
variant="primary"
|
|
149
|
+
isPressed={ isInserterOpen }
|
|
150
|
+
onMouseDown={ preventDefault }
|
|
151
|
+
onClick={ openInserter }
|
|
152
|
+
disabled={ ! isVisualMode }
|
|
153
|
+
icon={ plus }
|
|
154
|
+
label={ showIconLabels ? shortLabel : longLabel }
|
|
155
|
+
showTooltip={ ! showIconLabels }
|
|
156
|
+
/>
|
|
157
|
+
{ isLargeViewport && (
|
|
158
|
+
<>
|
|
159
|
+
<ToolbarItem
|
|
160
|
+
as={ ToolSelector }
|
|
161
|
+
showTooltip={ ! showIconLabels }
|
|
162
|
+
variant={
|
|
163
|
+
showIconLabels ? 'tertiary' : undefined
|
|
164
|
+
}
|
|
165
|
+
disabled={ ! isVisualMode }
|
|
166
|
+
/>
|
|
167
|
+
<ToolbarItem
|
|
168
|
+
as={ UndoButton }
|
|
169
|
+
showTooltip={ ! showIconLabels }
|
|
170
|
+
variant={
|
|
171
|
+
showIconLabels ? 'tertiary' : undefined
|
|
172
|
+
}
|
|
173
|
+
/>
|
|
174
|
+
<ToolbarItem
|
|
175
|
+
as={ RedoButton }
|
|
176
|
+
showTooltip={ ! showIconLabels }
|
|
177
|
+
variant={
|
|
178
|
+
showIconLabels ? 'tertiary' : undefined
|
|
179
|
+
}
|
|
180
|
+
/>
|
|
179
181
|
<ToolbarItem
|
|
180
182
|
as={ Button }
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
className="edit-site-header-edit-mode__list-view-toggle"
|
|
184
|
+
disabled={
|
|
185
|
+
! isVisualMode || isZoomedOutView
|
|
186
|
+
}
|
|
187
|
+
icon={ listView }
|
|
188
|
+
isPressed={ isListViewOpen }
|
|
183
189
|
/* translators: button label text should, if possible, be under 16 characters. */
|
|
184
|
-
label={ __( '
|
|
185
|
-
onClick={
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
);
|
|
192
|
-
} }
|
|
190
|
+
label={ __( 'List View' ) }
|
|
191
|
+
onClick={ toggleListView }
|
|
192
|
+
shortcut={ listViewShortcut }
|
|
193
|
+
showTooltip={ ! showIconLabels }
|
|
194
|
+
variant={
|
|
195
|
+
showIconLabels ? 'tertiary' : undefined
|
|
196
|
+
}
|
|
193
197
|
/>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
198
|
+
{ isZoomedOutViewExperimentEnabled && (
|
|
199
|
+
<ToolbarItem
|
|
200
|
+
as={ Button }
|
|
201
|
+
className="edit-site-header-edit-mode__zoom-out-view-toggle"
|
|
202
|
+
icon={ chevronUpDown }
|
|
203
|
+
isPressed={ isZoomedOutView }
|
|
204
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
205
|
+
label={ __( 'Zoom-out View' ) }
|
|
206
|
+
onClick={ () => {
|
|
207
|
+
setPreviewDeviceType( 'desktop' );
|
|
208
|
+
__unstableSetEditorMode(
|
|
209
|
+
isZoomedOutView
|
|
210
|
+
? 'edit'
|
|
211
|
+
: 'zoom-out'
|
|
212
|
+
);
|
|
213
|
+
} }
|
|
214
|
+
/>
|
|
215
|
+
) }
|
|
216
|
+
</>
|
|
217
|
+
) }
|
|
218
|
+
</div>
|
|
219
|
+
</NavigableToolbar>
|
|
220
|
+
) }
|
|
199
221
|
|
|
200
222
|
<div className="edit-site-header-edit-mode__center">
|
|
201
|
-
<DocumentActions />
|
|
223
|
+
{ hasStyleBook ? __( 'Style Book' ) : <DocumentActions /> }
|
|
202
224
|
</div>
|
|
203
225
|
|
|
204
226
|
<div className="edit-site-header-edit-mode__end">
|
|
205
227
|
<div className="edit-site-header-edit-mode__actions">
|
|
206
|
-
{ ! isFocusMode && (
|
|
228
|
+
{ ! isFocusMode && ! hasStyleBook && (
|
|
207
229
|
<div
|
|
208
230
|
className={ classnames(
|
|
209
231
|
'edit-site-header-edit-mode__preview-options',
|
|
@@ -218,7 +240,7 @@ export default function Header( { showIconLabels } ) {
|
|
|
218
240
|
>
|
|
219
241
|
<MenuGroup>
|
|
220
242
|
<MenuItem
|
|
221
|
-
href={
|
|
243
|
+
href={ homeUrl }
|
|
222
244
|
target="_blank"
|
|
223
245
|
icon={ external }
|
|
224
246
|
>
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
$header-toolbar-min-width: 335px;
|
|
2
2
|
|
|
3
3
|
.edit-site-header-edit-mode {
|
|
4
|
+
height: $header-height;
|
|
4
5
|
align-items: center;
|
|
5
6
|
background-color: $white;
|
|
7
|
+
color: $gray-900;
|
|
6
8
|
display: flex;
|
|
7
|
-
height: $header-height;
|
|
8
9
|
box-sizing: border-box;
|
|
9
10
|
width: 100%;
|
|
10
11
|
justify-content: space-between;
|
|
11
|
-
|
|
12
|
-
body.is-fullscreen-mode & {
|
|
13
|
-
padding-left: 60px;
|
|
14
|
-
transition: padding-left 20ms linear;
|
|
15
|
-
transition-delay: 80ms;
|
|
16
|
-
@include reduce-motion("transition");
|
|
17
|
-
}
|
|
12
|
+
border-bottom: $border-width solid $gray-200;
|
|
18
13
|
|
|
19
14
|
.edit-site-header-edit-mode__start {
|
|
20
15
|
display: flex;
|
|
@@ -40,29 +35,6 @@ $header-toolbar-min-width: 335px;
|
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
37
|
|
|
43
|
-
// Keeps the document title centered when the sidebar is open
|
|
44
|
-
body.is-navigation-sidebar-open {
|
|
45
|
-
.edit-site-header-edit-mode {
|
|
46
|
-
padding-left: 0;
|
|
47
|
-
transition: padding-left 20ms linear;
|
|
48
|
-
transition-delay: 0ms;
|
|
49
|
-
@include reduce-motion("transition");
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Centred document title on small screens with sidebar open
|
|
54
|
-
@media ( max-width: #{ ($break-large - 1) } ) {
|
|
55
|
-
body.is-navigation-sidebar-open .edit-site-header-edit-mode {
|
|
56
|
-
.edit-site-header-edit-mode__inserter-toggle ~ .components-button,
|
|
57
|
-
.edit-site-header-edit-mode__end .components-button:not(.is-primary) {
|
|
58
|
-
display: none;
|
|
59
|
-
}
|
|
60
|
-
.edit-site-save-button__button {
|
|
61
|
-
margin-right: 0;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
38
|
.edit-site-header-edit-mode__toolbar {
|
|
67
39
|
display: flex;
|
|
68
40
|
align-items: center;
|
|
@@ -177,7 +149,7 @@ body.is-navigation-sidebar-open {
|
|
|
177
149
|
|
|
178
150
|
// Button text label styles
|
|
179
151
|
|
|
180
|
-
.
|
|
152
|
+
.edit-site-header-edit-mode.show-icon-labels {
|
|
181
153
|
.components-button.has-icon {
|
|
182
154
|
width: auto;
|
|
183
155
|
|
|
@@ -218,7 +190,7 @@ body.is-navigation-sidebar-open {
|
|
|
218
190
|
padding: 0 $grid-unit-10;
|
|
219
191
|
}
|
|
220
192
|
|
|
221
|
-
.edit-site-
|
|
193
|
+
.edit-site-header-edit-mode__start .edit-site-header-edit-mode__toolbar > * + * {
|
|
222
194
|
margin-left: $grid-unit-10;
|
|
223
195
|
}
|
|
224
196
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
useShortcut,
|
|
7
7
|
store as keyboardShortcutsStore,
|
|
8
8
|
} from '@wordpress/keyboard-shortcuts';
|
|
9
|
+
import { isAppleOS } from '@wordpress/keycodes';
|
|
9
10
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
11
|
import { __ } from '@wordpress/i18n';
|
|
11
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -119,6 +120,18 @@ function KeyboardShortcutsRegister() {
|
|
|
119
120
|
modifier: 'primaryShift',
|
|
120
121
|
character: 'z',
|
|
121
122
|
},
|
|
123
|
+
// Disable on Apple OS because it conflicts with the browser's
|
|
124
|
+
// history shortcut. It's a fine alias for both Windows and Linux.
|
|
125
|
+
// Since there's no conflict for Ctrl+Shift+Z on both Windows and
|
|
126
|
+
// Linux, we keep it as the default for consistency.
|
|
127
|
+
aliases: isAppleOS()
|
|
128
|
+
? []
|
|
129
|
+
: [
|
|
130
|
+
{
|
|
131
|
+
modifier: 'primary',
|
|
132
|
+
character: 'y',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
122
135
|
} );
|
|
123
136
|
|
|
124
137
|
registerShortcut( {
|
|
@@ -180,6 +193,10 @@ function KeyboardShortcutsRegister() {
|
|
|
180
193
|
modifier: 'access',
|
|
181
194
|
character: 'p',
|
|
182
195
|
},
|
|
196
|
+
{
|
|
197
|
+
modifier: 'ctrlShift',
|
|
198
|
+
character: '~',
|
|
199
|
+
},
|
|
183
200
|
],
|
|
184
201
|
} );
|
|
185
202
|
registerShortcut( {
|