@wordpress/edit-site 5.4.0 → 5.6.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/add-new-template/add-custom-template-modal.js +12 -3
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +8 -7
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +19 -16
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +4 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +2 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/editor/index.js +5 -7
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +20 -159
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +13 -11
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +41 -487
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/duotone-panel.js +78 -0
- package/build/components/global-styles/duotone-panel.js.map +1 -0
- package/build/components/global-styles/filter-utils.js +17 -0
- package/build/components/global-styles/filter-utils.js.map +1 -0
- package/build/components/global-styles/hooks.js +11 -26
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/preview.js +9 -5
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +6 -11
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-border.js +14 -6
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-filters.js +46 -0
- package/build/components/global-styles/screen-filters.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +13 -5
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +2 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-variations.js +1 -1
- package/build/components/global-styles/screen-variations.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +6 -4
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -5
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +7 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +124 -0
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -0
- package/build/components/keyboard-shortcuts/global.js +48 -0
- package/build/components/keyboard-shortcuts/global.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +67 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +153 -0
- package/build/components/keyboard-shortcuts/register.js.map +1 -0
- package/build/components/layout/index.js +12 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +127 -136
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/index.js +2 -1
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +9 -7
- package/build/components/list/table.js.map +1 -1
- package/build/components/routes/link.js +4 -1
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-hub/index.js +82 -0
- package/build/components/save-hub/index.js.map +1 -0
- package/build/components/save-panel/index.js +11 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +27 -17
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +30 -0
- package/build/components/sidebar-button/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +14 -11
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +16 -16
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +22 -26
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +97 -14
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +19 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +77 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
- package/build/components/sidebar-navigation-screen-template/index.js +66 -27
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +30 -17
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +14 -10
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +3 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +151 -21
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +36 -34
- 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-canvas-mode-with-url.js +24 -8
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +67 -18
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-details/index.js +5 -10
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +8 -12
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +2 -2
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +19 -14
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +6 -6
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/index.js +13 -22
- package/build/index.js.map +1 -1
- package/build/store/actions.js +2 -2
- package/build/store/actions.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/history.js +8 -2
- package/build/utils/history.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +13 -4
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +8 -7
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +21 -17
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +3 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +2 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/editor/index.js +5 -6
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +21 -157
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +14 -11
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +43 -480
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/duotone-panel.js +67 -0
- package/build-module/components/global-styles/duotone-panel.js.map +1 -0
- package/build-module/components/global-styles/filter-utils.js +9 -0
- package/build-module/components/global-styles/filter-utils.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +11 -26
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/preview.js +10 -6
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +6 -8
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +12 -3
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-filters.js +33 -0
- package/build-module/components/global-styles/screen-filters.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +11 -2
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +2 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +2 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-variations.js +1 -1
- package/build-module/components/global-styles/screen-variations.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +6 -4
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +2 -5
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +6 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +108 -0
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/global.js +37 -0
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +65 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +141 -0
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -0
- package/build-module/components/layout/index.js +10 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +126 -138
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/index.js +2 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +9 -7
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/routes/link.js +5 -2
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-hub/index.js +68 -0
- package/build-module/components/save-hub/index.js.map +1 -0
- package/build-module/components/save-panel/index.js +8 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +24 -19
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +18 -0
- package/build-module/components/sidebar-button/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +12 -12
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +16 -16
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +24 -30
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +91 -14
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +11 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +66 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js +67 -30
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +28 -18
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +13 -10
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +3 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +152 -25
- 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 +36 -34
- 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-canvas-mode-with-url.js +24 -8
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +65 -18
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-details/index.js +5 -9
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +9 -13
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +3 -3
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +20 -15
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +6 -6
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/index.js +16 -23
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +2 -2
- package/build-module/store/actions.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/history.js +9 -3
- package/build-module/utils/history.js.map +1 -1
- package/build-style/style-rtl.css +203 -143
- package/build-style/style.css +203 -143
- package/package.json +31 -31
- package/src/components/add-new-template/add-custom-template-modal.js +14 -10
- package/src/components/add-new-template/new-template-part.js +7 -9
- package/src/components/add-new-template/new-template.js +60 -38
- package/src/components/add-new-template/style.scss +12 -6
- package/src/components/app/index.js +9 -6
- package/src/components/block-editor/editor-canvas.js +2 -1
- package/src/components/block-editor/style.scss +1 -1
- package/src/components/editor/index.js +62 -65
- package/src/components/editor/style.scss +0 -6
- package/src/components/global-styles/border-panel.js +24 -199
- package/src/components/global-styles/context-menu.js +18 -12
- package/src/components/global-styles/dimensions-panel.js +43 -577
- package/src/components/global-styles/duotone-panel.js +82 -0
- package/src/components/global-styles/filter-utils.js +9 -0
- package/src/components/global-styles/hooks.js +12 -36
- package/src/components/global-styles/preview.js +155 -140
- package/src/components/global-styles/screen-block-list.js +6 -11
- package/src/components/global-styles/screen-border.js +10 -3
- package/src/components/global-styles/screen-filters.js +27 -0
- package/src/components/global-styles/screen-layout.js +9 -2
- package/src/components/global-styles/screen-root.js +1 -1
- package/src/components/global-styles/screen-style-variations.js +5 -1
- package/src/components/global-styles/screen-variations.js +0 -1
- package/src/components/global-styles/shadow-panel.js +4 -3
- package/src/components/global-styles/style.scss +10 -0
- package/src/components/global-styles/typography-panel.js +5 -7
- package/src/components/global-styles/ui.js +6 -1
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -0
- package/src/components/keyboard-shortcuts/edit-mode.js +116 -0
- package/src/components/keyboard-shortcuts/global.js +35 -0
- package/src/components/keyboard-shortcuts/index.js +70 -0
- package/src/components/keyboard-shortcuts/register.js +157 -0
- package/src/components/layout/index.js +19 -0
- package/src/components/layout/style.scss +9 -4
- package/src/components/list/added-by.js +152 -155
- package/src/components/list/index.js +3 -1
- package/src/components/list/style.scss +5 -13
- package/src/components/list/table.js +11 -9
- package/src/components/routes/link.js +9 -2
- package/src/components/save-hub/index.js +78 -0
- package/src/components/save-hub/style.scss +15 -0
- package/src/components/save-panel/index.js +8 -1
- package/src/components/sidebar/index.js +33 -16
- package/src/components/sidebar/style.scss +4 -3
- package/src/components/sidebar-button/index.js +21 -0
- package/src/components/sidebar-button/style.scss +24 -0
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +3 -7
- package/src/components/sidebar-edit-mode/style.scss +16 -0
- package/src/components/sidebar-navigation-item/style.scss +1 -23
- package/src/components/sidebar-navigation-screen/index.js +37 -38
- package/src/components/sidebar-navigation-screen/style.scss +16 -9
- package/src/components/sidebar-navigation-screen-main/index.js +24 -11
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +39 -26
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +99 -12
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +78 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +108 -1
- package/src/components/sidebar-navigation-screen-template/index.js +89 -30
- package/src/components/sidebar-navigation-screen-template/style.scss +25 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +29 -14
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -5
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +12 -6
- package/src/components/site-hub/index.js +5 -1
- package/src/components/site-hub/style.scss +5 -1
- package/src/components/style-book/index.js +234 -55
- package/src/components/style-book/style.scss +1 -45
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +28 -23
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +38 -8
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +77 -17
- package/src/components/template-details/index.js +4 -8
- package/src/components/template-part-converter/convert-to-regular.js +10 -17
- package/src/components/template-part-converter/convert-to-template-part.js +9 -16
- package/src/components/template-part-converter/index.js +28 -12
- package/src/components/use-edited-entity-record/index.js +26 -18
- package/src/index.js +11 -22
- package/src/store/actions.js +2 -2
- package/src/store/test/actions.js +0 -2
- package/src/style.scss +3 -1
- package/src/utils/get-is-list-page.js +1 -1
- package/src/utils/history.js +13 -9
- package/build/components/navigation-inspector/index.js +0 -161
- package/build/components/navigation-inspector/index.js.map +0 -1
- package/build/components/navigation-inspector/navigation-menu.js +0 -62
- package/build/components/navigation-inspector/navigation-menu.js.map +0 -1
- package/build-module/components/navigation-inspector/index.js +0 -146
- package/build-module/components/navigation-inspector/index.js.map +0 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +0 -52
- package/build-module/components/navigation-inspector/navigation-menu.js.map +0 -1
- package/src/components/navigation-inspector/index.js +0 -191
- package/src/components/navigation-inspector/navigation-menu.js +0 -66
- package/src/components/navigation-inspector/style.scss +0 -46
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import {
|
|
6
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
7
|
+
DuotonePicker,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import {
|
|
10
|
+
privateApis as blockEditorPrivateApis,
|
|
11
|
+
useSetting,
|
|
12
|
+
} from '@wordpress/block-editor';
|
|
13
|
+
import { useMemo } from '@wordpress/element';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import { unlock } from '../../private-apis';
|
|
19
|
+
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
20
|
+
|
|
21
|
+
const EMPTY_ARRAY = [];
|
|
22
|
+
|
|
23
|
+
function useMultiOriginPresets( { presetSetting, defaultSetting } ) {
|
|
24
|
+
const disableDefault = ! useSetting( defaultSetting );
|
|
25
|
+
const userPresets =
|
|
26
|
+
useSetting( `${ presetSetting }.custom` ) || EMPTY_ARRAY;
|
|
27
|
+
const themePresets =
|
|
28
|
+
useSetting( `${ presetSetting }.theme` ) || EMPTY_ARRAY;
|
|
29
|
+
const defaultPresets =
|
|
30
|
+
useSetting( `${ presetSetting }.default` ) || EMPTY_ARRAY;
|
|
31
|
+
return useMemo(
|
|
32
|
+
() => [
|
|
33
|
+
...userPresets,
|
|
34
|
+
...themePresets,
|
|
35
|
+
...( disableDefault ? EMPTY_ARRAY : defaultPresets ),
|
|
36
|
+
],
|
|
37
|
+
[ disableDefault, userPresets, themePresets, defaultPresets ]
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function DuotonePanel( { name } ) {
|
|
42
|
+
const [ themeDuotone, setThemeDuotone ] = useGlobalStyle(
|
|
43
|
+
'filter.duotone',
|
|
44
|
+
name
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const duotonePalette = useMultiOriginPresets( {
|
|
48
|
+
presetSetting: 'color.duotone',
|
|
49
|
+
defaultSetting: 'color.defaultDuotone',
|
|
50
|
+
} );
|
|
51
|
+
const colorPalette = useMultiOriginPresets( {
|
|
52
|
+
presetSetting: 'color.palette',
|
|
53
|
+
defaultSetting: 'color.defaultPalette',
|
|
54
|
+
} );
|
|
55
|
+
|
|
56
|
+
if ( duotonePalette?.length === 0 ) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<ToolsPanel label={ __( 'Duotone' ) }>
|
|
62
|
+
<span className="span-columns">
|
|
63
|
+
{ __(
|
|
64
|
+
'Create a two-tone color effect without losing your original image.'
|
|
65
|
+
) }
|
|
66
|
+
</span>
|
|
67
|
+
<div className="span-columns">
|
|
68
|
+
<DuotonePicker
|
|
69
|
+
colorPalette={ colorPalette }
|
|
70
|
+
duotonePalette={ duotonePalette }
|
|
71
|
+
disableCustomColors={ true }
|
|
72
|
+
disableCustomDuotone={ true }
|
|
73
|
+
value={ themeDuotone }
|
|
74
|
+
onChange={ setThemeDuotone }
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
</ToolsPanel>
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default DuotonePanel;
|
|
@@ -18,7 +18,8 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
18
18
|
import { unlock } from '../../private-apis';
|
|
19
19
|
import { useSelect } from '@wordpress/data';
|
|
20
20
|
|
|
21
|
-
const { useGlobalSetting } =
|
|
21
|
+
const { useGlobalSetting, useColorsPerOrigin: useColorsPerOriginFromSettings } =
|
|
22
|
+
unlock( blockEditorPrivateApis );
|
|
22
23
|
|
|
23
24
|
// Enable colord's a11y plugin.
|
|
24
25
|
extend( [ a11yPlugin ] );
|
|
@@ -31,41 +32,16 @@ export function useColorsPerOrigin( name ) {
|
|
|
31
32
|
'color.defaultPalette'
|
|
32
33
|
);
|
|
33
34
|
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
if (
|
|
46
|
-
shouldDisplayDefaultColors &&
|
|
47
|
-
defaultColors &&
|
|
48
|
-
defaultColors.length
|
|
49
|
-
) {
|
|
50
|
-
result.push( {
|
|
51
|
-
name: _x(
|
|
52
|
-
'Default',
|
|
53
|
-
'Indicates this palette comes from WordPress.'
|
|
54
|
-
),
|
|
55
|
-
colors: defaultColors,
|
|
56
|
-
} );
|
|
57
|
-
}
|
|
58
|
-
if ( customColors && customColors.length ) {
|
|
59
|
-
result.push( {
|
|
60
|
-
name: _x(
|
|
61
|
-
'Custom',
|
|
62
|
-
'Indicates this palette is created by the user.'
|
|
63
|
-
),
|
|
64
|
-
colors: customColors,
|
|
65
|
-
} );
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
}, [ customColors, themeColors, defaultColors ] );
|
|
35
|
+
return useColorsPerOriginFromSettings( {
|
|
36
|
+
color: {
|
|
37
|
+
palette: {
|
|
38
|
+
custom: customColors,
|
|
39
|
+
theme: themeColors,
|
|
40
|
+
default: defaultColors,
|
|
41
|
+
},
|
|
42
|
+
defaultPalette: shouldDisplayDefaultColors,
|
|
43
|
+
},
|
|
44
|
+
} );
|
|
69
45
|
}
|
|
70
46
|
|
|
71
47
|
export function useGradientsPerOrigin( name ) {
|
|
@@ -107,163 +107,178 @@ const StylesPreview = ( { label, isFocused, withHoverView } ) => {
|
|
|
107
107
|
|
|
108
108
|
return styles;
|
|
109
109
|
}, [ styles ] );
|
|
110
|
+
const isReady = !! width;
|
|
110
111
|
|
|
111
112
|
return (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
onMouseLeave={ () => setIsHovered( false ) }
|
|
121
|
-
tabIndex={ -1 }
|
|
122
|
-
>
|
|
123
|
-
{ containerResizeListener }
|
|
124
|
-
<motion.div
|
|
125
|
-
style={ {
|
|
126
|
-
height: normalizedHeight * ratio,
|
|
127
|
-
width: '100%',
|
|
128
|
-
background: gradientValue ?? backgroundColor,
|
|
129
|
-
cursor: 'pointer',
|
|
130
|
-
} }
|
|
131
|
-
initial="start"
|
|
132
|
-
animate={
|
|
133
|
-
( isHovered || isFocused ) && ! disableMotion && label
|
|
134
|
-
? 'hover'
|
|
135
|
-
: 'start'
|
|
136
|
-
}
|
|
137
|
-
>
|
|
138
|
-
<motion.div
|
|
139
|
-
variants={ firstFrame }
|
|
113
|
+
<>
|
|
114
|
+
<div style={ { position: 'relative' } }>
|
|
115
|
+
{ containerResizeListener }
|
|
116
|
+
</div>
|
|
117
|
+
{ isReady && (
|
|
118
|
+
<Iframe
|
|
119
|
+
className="edit-site-global-styles-preview__iframe"
|
|
120
|
+
head={ <EditorStyles styles={ editorStyles } /> }
|
|
140
121
|
style={ {
|
|
141
|
-
height:
|
|
142
|
-
overflow: 'hidden',
|
|
122
|
+
height: normalizedHeight * ratio,
|
|
143
123
|
} }
|
|
124
|
+
onMouseEnter={ () => setIsHovered( true ) }
|
|
125
|
+
onMouseLeave={ () => setIsHovered( false ) }
|
|
126
|
+
tabIndex={ -1 }
|
|
144
127
|
>
|
|
145
|
-
<
|
|
146
|
-
spacing={ 10 * ratio }
|
|
147
|
-
justify="center"
|
|
128
|
+
<motion.div
|
|
148
129
|
style={ {
|
|
149
|
-
height:
|
|
150
|
-
|
|
130
|
+
height: normalizedHeight * ratio,
|
|
131
|
+
width: '100%',
|
|
132
|
+
background: gradientValue ?? backgroundColor,
|
|
133
|
+
cursor: 'pointer',
|
|
151
134
|
} }
|
|
135
|
+
initial="start"
|
|
136
|
+
animate={
|
|
137
|
+
( isHovered || isFocused ) &&
|
|
138
|
+
! disableMotion &&
|
|
139
|
+
label
|
|
140
|
+
? 'hover'
|
|
141
|
+
: 'start'
|
|
142
|
+
}
|
|
152
143
|
>
|
|
153
144
|
<motion.div
|
|
145
|
+
variants={ firstFrame }
|
|
154
146
|
style={ {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
color: headingColor,
|
|
158
|
-
fontWeight: headingFontWeight,
|
|
147
|
+
height: '100%',
|
|
148
|
+
overflow: 'hidden',
|
|
159
149
|
} }
|
|
160
|
-
animate={ { scale: 1, opacity: 1 } }
|
|
161
|
-
initial={ { scale: 0.1, opacity: 0 } }
|
|
162
|
-
transition={ { delay: 0.3, type: 'tween' } }
|
|
163
150
|
>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
normalizedColorSwatchSize *
|
|
174
|
-
ratio,
|
|
175
|
-
width:
|
|
176
|
-
normalizedColorSwatchSize *
|
|
177
|
-
ratio,
|
|
178
|
-
background: color,
|
|
179
|
-
borderRadius:
|
|
180
|
-
( normalizedColorSwatchSize *
|
|
181
|
-
ratio ) /
|
|
182
|
-
2,
|
|
183
|
-
} }
|
|
184
|
-
animate={ { scale: 1, opacity: 1 } }
|
|
185
|
-
initial={ { scale: 0.1, opacity: 0 } }
|
|
186
|
-
transition={ {
|
|
187
|
-
delay: index === 1 ? 0.2 : 0.1,
|
|
188
|
-
} }
|
|
189
|
-
/>
|
|
190
|
-
)
|
|
191
|
-
) }
|
|
192
|
-
</VStack>
|
|
193
|
-
</HStack>
|
|
194
|
-
</motion.div>
|
|
195
|
-
<motion.div
|
|
196
|
-
variants={ withHoverView && midFrame }
|
|
197
|
-
style={ {
|
|
198
|
-
height: '100%',
|
|
199
|
-
width: '100%',
|
|
200
|
-
position: 'absolute',
|
|
201
|
-
top: 0,
|
|
202
|
-
overflow: 'hidden',
|
|
203
|
-
filter: 'blur(60px)',
|
|
204
|
-
opacity: 0.1,
|
|
205
|
-
} }
|
|
206
|
-
>
|
|
207
|
-
<HStack
|
|
208
|
-
spacing={ 0 }
|
|
209
|
-
justify="flex-start"
|
|
210
|
-
style={ {
|
|
211
|
-
height: '100%',
|
|
212
|
-
overflow: 'hidden',
|
|
213
|
-
} }
|
|
214
|
-
>
|
|
215
|
-
{ paletteColors
|
|
216
|
-
.slice( 0, 4 )
|
|
217
|
-
.map( ( { color }, index ) => (
|
|
218
|
-
<div
|
|
219
|
-
key={ index }
|
|
151
|
+
<HStack
|
|
152
|
+
spacing={ 10 * ratio }
|
|
153
|
+
justify="center"
|
|
154
|
+
style={ {
|
|
155
|
+
height: '100%',
|
|
156
|
+
overflow: 'hidden',
|
|
157
|
+
} }
|
|
158
|
+
>
|
|
159
|
+
<motion.div
|
|
220
160
|
style={ {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
161
|
+
fontFamily: headingFontFamily,
|
|
162
|
+
fontSize: 65 * ratio,
|
|
163
|
+
color: headingColor,
|
|
164
|
+
fontWeight: headingFontWeight,
|
|
224
165
|
} }
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
166
|
+
animate={ { scale: 1, opacity: 1 } }
|
|
167
|
+
initial={ { scale: 0.1, opacity: 0 } }
|
|
168
|
+
transition={ { delay: 0.3, type: 'tween' } }
|
|
169
|
+
>
|
|
170
|
+
Aa
|
|
171
|
+
</motion.div>
|
|
172
|
+
<VStack spacing={ 4 * ratio }>
|
|
173
|
+
{ highlightedColors.map(
|
|
174
|
+
( { slug, color }, index ) => (
|
|
175
|
+
<motion.div
|
|
176
|
+
key={ slug }
|
|
177
|
+
style={ {
|
|
178
|
+
height:
|
|
179
|
+
normalizedColorSwatchSize *
|
|
180
|
+
ratio,
|
|
181
|
+
width:
|
|
182
|
+
normalizedColorSwatchSize *
|
|
183
|
+
ratio,
|
|
184
|
+
background: color,
|
|
185
|
+
borderRadius:
|
|
186
|
+
( normalizedColorSwatchSize *
|
|
187
|
+
ratio ) /
|
|
188
|
+
2,
|
|
189
|
+
} }
|
|
190
|
+
animate={ {
|
|
191
|
+
scale: 1,
|
|
192
|
+
opacity: 1,
|
|
193
|
+
} }
|
|
194
|
+
initial={ {
|
|
195
|
+
scale: 0.1,
|
|
196
|
+
opacity: 0,
|
|
197
|
+
} }
|
|
198
|
+
transition={ {
|
|
199
|
+
delay:
|
|
200
|
+
index === 1 ? 0.2 : 0.1,
|
|
201
|
+
} }
|
|
202
|
+
/>
|
|
203
|
+
)
|
|
204
|
+
) }
|
|
205
|
+
</VStack>
|
|
206
|
+
</HStack>
|
|
207
|
+
</motion.div>
|
|
208
|
+
<motion.div
|
|
209
|
+
variants={ withHoverView && midFrame }
|
|
210
|
+
style={ {
|
|
211
|
+
height: '100%',
|
|
212
|
+
width: '100%',
|
|
213
|
+
position: 'absolute',
|
|
214
|
+
top: 0,
|
|
215
|
+
overflow: 'hidden',
|
|
216
|
+
filter: 'blur(60px)',
|
|
217
|
+
opacity: 0.1,
|
|
218
|
+
} }
|
|
219
|
+
>
|
|
220
|
+
<HStack
|
|
221
|
+
spacing={ 0 }
|
|
222
|
+
justify="flex-start"
|
|
251
223
|
style={ {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
color: headingColor,
|
|
255
|
-
fontWeight: headingFontWeight,
|
|
256
|
-
lineHeight: '1em',
|
|
257
|
-
textAlign: 'center',
|
|
224
|
+
height: '100%',
|
|
225
|
+
overflow: 'hidden',
|
|
258
226
|
} }
|
|
259
227
|
>
|
|
260
|
-
{
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
228
|
+
{ paletteColors
|
|
229
|
+
.slice( 0, 4 )
|
|
230
|
+
.map( ( { color }, index ) => (
|
|
231
|
+
<div
|
|
232
|
+
key={ index }
|
|
233
|
+
style={ {
|
|
234
|
+
height: '100%',
|
|
235
|
+
background: color,
|
|
236
|
+
flexGrow: 1,
|
|
237
|
+
} }
|
|
238
|
+
/>
|
|
239
|
+
) ) }
|
|
240
|
+
</HStack>
|
|
241
|
+
</motion.div>
|
|
242
|
+
<motion.div
|
|
243
|
+
variants={ secondFrame }
|
|
244
|
+
style={ {
|
|
245
|
+
height: '100%',
|
|
246
|
+
width: '100%',
|
|
247
|
+
overflow: 'hidden',
|
|
248
|
+
position: 'absolute',
|
|
249
|
+
top: 0,
|
|
250
|
+
} }
|
|
251
|
+
>
|
|
252
|
+
<VStack
|
|
253
|
+
spacing={ 3 * ratio }
|
|
254
|
+
justify="center"
|
|
255
|
+
style={ {
|
|
256
|
+
height: '100%',
|
|
257
|
+
overflow: 'hidden',
|
|
258
|
+
padding: 10 * ratio,
|
|
259
|
+
boxSizing: 'border-box',
|
|
260
|
+
} }
|
|
261
|
+
>
|
|
262
|
+
{ label && (
|
|
263
|
+
<div
|
|
264
|
+
style={ {
|
|
265
|
+
fontSize: 40 * ratio,
|
|
266
|
+
fontFamily: headingFontFamily,
|
|
267
|
+
color: headingColor,
|
|
268
|
+
fontWeight: headingFontWeight,
|
|
269
|
+
lineHeight: '1em',
|
|
270
|
+
textAlign: 'center',
|
|
271
|
+
} }
|
|
272
|
+
>
|
|
273
|
+
{ label }
|
|
274
|
+
</div>
|
|
275
|
+
) }
|
|
276
|
+
</VStack>
|
|
277
|
+
</motion.div>
|
|
278
|
+
</motion.div>
|
|
279
|
+
</Iframe>
|
|
280
|
+
) }
|
|
281
|
+
</>
|
|
267
282
|
);
|
|
268
283
|
};
|
|
269
284
|
|
|
@@ -20,19 +20,18 @@ import { speak } from '@wordpress/a11y';
|
|
|
20
20
|
/**
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
|
-
import { useHasBorderPanel } from './border-panel';
|
|
24
23
|
import { useHasColorPanel } from './color-utils';
|
|
25
|
-
import { useHasDimensionsPanel } from './dimensions-panel';
|
|
26
24
|
import { useHasVariationsPanel } from './variations-panel';
|
|
27
25
|
import ScreenHeader from './header';
|
|
28
26
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
29
27
|
import { unlock } from '../../private-apis';
|
|
30
|
-
import { useSupportedStyles } from './hooks';
|
|
31
28
|
|
|
32
29
|
const {
|
|
30
|
+
useHasDimensionsPanel,
|
|
33
31
|
useHasTypographyPanel,
|
|
32
|
+
useHasBorderPanel,
|
|
34
33
|
useGlobalSetting,
|
|
35
|
-
|
|
34
|
+
useSettingsForBlockElement,
|
|
36
35
|
} = unlock( blockEditorPrivateApis );
|
|
37
36
|
|
|
38
37
|
function useSortedBlockTypes() {
|
|
@@ -60,15 +59,11 @@ function useSortedBlockTypes() {
|
|
|
60
59
|
|
|
61
60
|
function BlockMenuItem( { block } ) {
|
|
62
61
|
const [ rawSettings ] = useGlobalSetting( '', block.name );
|
|
63
|
-
const
|
|
64
|
-
const settings = useMemo(
|
|
65
|
-
() => overrideSettingsWithSupports( rawSettings, supports ),
|
|
66
|
-
[ rawSettings, supports ]
|
|
67
|
-
);
|
|
62
|
+
const settings = useSettingsForBlockElement( rawSettings, block.name );
|
|
68
63
|
const hasTypographyPanel = useHasTypographyPanel( settings );
|
|
69
64
|
const hasColorPanel = useHasColorPanel( block.name );
|
|
70
|
-
const hasBorderPanel = useHasBorderPanel(
|
|
71
|
-
const hasDimensionsPanel = useHasDimensionsPanel(
|
|
65
|
+
const hasBorderPanel = useHasBorderPanel( settings );
|
|
66
|
+
const hasDimensionsPanel = useHasDimensionsPanel( settings );
|
|
72
67
|
const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
|
|
73
68
|
const hasVariationsPanel = useHasVariationsPanel( block.name );
|
|
74
69
|
const hasBlockMenuItem =
|
|
@@ -2,21 +2,28 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
10
|
import ScreenHeader from './header';
|
|
10
|
-
import BorderPanel
|
|
11
|
+
import BorderPanel from './border-panel';
|
|
11
12
|
import BlockPreviewPanel from './block-preview-panel';
|
|
12
13
|
import { getVariationClassName } from './utils';
|
|
14
|
+
import { unlock } from '../../private-apis';
|
|
15
|
+
|
|
16
|
+
const { useHasBorderPanel, useGlobalSetting, useSettingsForBlockElement } =
|
|
17
|
+
unlock( blockEditorPrivateApis );
|
|
13
18
|
|
|
14
19
|
function ScreenBorder( { name, variation = '' } ) {
|
|
15
|
-
const
|
|
20
|
+
const [ rawSettings ] = useGlobalSetting( '', name );
|
|
21
|
+
const settings = useSettingsForBlockElement( rawSettings, name );
|
|
22
|
+
const hasBorderPanel = useHasBorderPanel( settings );
|
|
16
23
|
const variationClassName = getVariationClassName( variation );
|
|
17
24
|
return (
|
|
18
25
|
<>
|
|
19
|
-
<ScreenHeader title={ __( 'Border
|
|
26
|
+
<ScreenHeader title={ __( 'Border' ) } />
|
|
20
27
|
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
21
28
|
{ hasBorderPanel && (
|
|
22
29
|
<BorderPanel name={ name } variation={ variation } />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import DuotonePanel from './duotone-panel';
|
|
10
|
+
import BlockPreviewPanel from './block-preview-panel';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import ScreenHeader from './header';
|
|
16
|
+
|
|
17
|
+
function ScreenFilters( { name } ) {
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<ScreenHeader title={ __( 'Filters' ) } />
|
|
21
|
+
<BlockPreviewPanel name={ name } />
|
|
22
|
+
<DuotonePanel name={ name } />
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default ScreenFilters;
|
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
|
-
import DimensionsPanel
|
|
10
|
+
import DimensionsPanel from './dimensions-panel';
|
|
10
11
|
import ScreenHeader from './header';
|
|
11
12
|
import BlockPreviewPanel from './block-preview-panel';
|
|
12
13
|
import { getVariationClassName } from './utils';
|
|
14
|
+
import { unlock } from '../../private-apis';
|
|
15
|
+
|
|
16
|
+
const { useHasDimensionsPanel, useGlobalSetting, useSettingsForBlockElement } =
|
|
17
|
+
unlock( blockEditorPrivateApis );
|
|
13
18
|
|
|
14
19
|
function ScreenLayout( { name, variation = '' } ) {
|
|
15
|
-
const
|
|
20
|
+
const [ rawSettings ] = useGlobalSetting( '', name );
|
|
21
|
+
const settings = useSettingsForBlockElement( rawSettings, name );
|
|
22
|
+
const hasDimensionsPanel = useHasDimensionsPanel( settings );
|
|
16
23
|
const variationClassName = getVariationClassName( variation );
|
|
17
24
|
return (
|
|
18
25
|
<>
|
|
@@ -172,7 +172,11 @@ function ScreenStyleVariations() {
|
|
|
172
172
|
) }
|
|
173
173
|
/>
|
|
174
174
|
|
|
175
|
-
<Card
|
|
175
|
+
<Card
|
|
176
|
+
size="small"
|
|
177
|
+
isBorderless
|
|
178
|
+
className="edit-site-global-styles-screen-style-variations"
|
|
179
|
+
>
|
|
176
180
|
<CardBody>
|
|
177
181
|
<Grid columns={ 2 }>
|
|
178
182
|
{ withEmptyVariation?.map( ( variation, index ) => (
|
|
@@ -24,7 +24,6 @@ export function ScreenVariations( { name, path = '' } ) {
|
|
|
24
24
|
return (
|
|
25
25
|
<div className="edit-site-global-styles-screen-variations">
|
|
26
26
|
<VStack spacing={ 3 }>
|
|
27
|
-
<p>Manage style variations, saved block appearence presets.</p>
|
|
28
27
|
<Subtitle>{ __( 'Style Variations' ) }</Subtitle>
|
|
29
28
|
<VariationsPanel name={ name } />
|
|
30
29
|
</VStack>
|
|
@@ -146,9 +146,9 @@ function ShadowPopoverContainer( { shadow, onShadowChange } ) {
|
|
|
146
146
|
function ShadowPresets( { presets, activeShadow, onSelect } ) {
|
|
147
147
|
return ! presets ? null : (
|
|
148
148
|
<Grid columns={ 6 } gap={ 0 } align="center" justify="center">
|
|
149
|
-
{ presets.map( ( { name, shadow }
|
|
149
|
+
{ presets.map( ( { name, slug, shadow } ) => (
|
|
150
150
|
<ShadowIndicator
|
|
151
|
-
key={
|
|
151
|
+
key={ slug }
|
|
152
152
|
label={ name }
|
|
153
153
|
isActive={ shadow === activeShadow }
|
|
154
154
|
onSelect={ () =>
|
|
@@ -167,8 +167,9 @@ function ShadowIndicator( { label, isActive, onSelect, shadow } ) {
|
|
|
167
167
|
<Button
|
|
168
168
|
className="edit-site-global-styles__shadow-indicator"
|
|
169
169
|
onClick={ onSelect }
|
|
170
|
-
|
|
170
|
+
label={ label }
|
|
171
171
|
style={ { boxShadow: shadow } }
|
|
172
|
+
showTooltip
|
|
172
173
|
>
|
|
173
174
|
{ isActive && <Icon icon={ check } /> }
|
|
174
175
|
</Button>
|
|
@@ -241,3 +241,13 @@
|
|
|
241
241
|
height: 24px;
|
|
242
242
|
width: 24px;
|
|
243
243
|
}
|
|
244
|
+
|
|
245
|
+
.edit-site-global-styles-screen-root.edit-site-global-styles-screen-root,
|
|
246
|
+
.edit-site-global-styles-screen-style-variations.edit-site-global-styles-screen-style-variations {
|
|
247
|
+
background: unset;
|
|
248
|
+
color: inherit;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.edit-site-global-styles-sidebar__panel .block-editor-block-icon svg {
|
|
252
|
+
fill: currentColor;
|
|
253
|
+
}
|