@wordpress/edit-site 5.2.0 → 5.3.1
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 +6 -0
- package/build/components/add-new-template/add-custom-generic-template-modal.js +8 -10
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal.js +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +9 -32
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +5 -4
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +1 -9
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +2 -7
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +13 -2
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +16 -14
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +237 -0
- package/build/components/block-editor/inserter-media-categories.js.map +1 -0
- package/build/components/canvas-spinner/index.js +20 -0
- package/build/components/canvas-spinner/index.js.map +1 -0
- package/build/components/create-template-part-modal/index.js +4 -2
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +9 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -12
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +5 -28
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +2 -2
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +17 -9
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +13 -7
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +39 -4
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +65 -14
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +49 -31
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +13 -3
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +17 -11
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +21 -142
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +0 -28
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/palette.js +11 -4
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +18 -15
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +27 -13
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-border.js +10 -4
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +16 -9
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +43 -34
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -8
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +23 -16
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +3 -3
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +18 -11
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +25 -9
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +8 -4
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +14 -7
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +18 -12
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +196 -0
- package/build/components/global-styles/shadow-panel.js.map +1 -0
- package/build/components/global-styles/typography-panel.js +43 -29
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +19 -9
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +104 -34
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +5 -334
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +7 -5
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +2 -2
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/layout/index.js +11 -11
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +8 -11
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
- package/build/components/navigation-inspector/index.js.map +1 -0
- package/build/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -14
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -0
- package/build/components/sidebar/index.js +3 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +3 -18
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -14
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +3 -2
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +23 -1
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +52 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +3 -8
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/site-hub/index.js +11 -10
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +1 -1
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/style-book/index.js +7 -4
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +6 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +5 -9
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/experiments.js +19 -0
- package/build/experiments.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +65 -6
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/index.js +53 -60
- package/build/index.js.map +1 -1
- package/build/store/actions.js +1 -27
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +8 -0
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +40 -0
- package/build/store/private-actions.js.map +1 -0
- package/build/store/private-selectors.js +18 -0
- package/build/store/private-selectors.js.map +1 -0
- package/build/store/selectors.js +7 -40
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +77 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/template-part-create.js +71 -0
- package/build/utils/template-part-create.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js +9 -11
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +0 -1
- 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 -31
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +4 -4
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +0 -5
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +2 -7
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +13 -3
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +17 -15
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +225 -0
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -0
- package/build-module/components/canvas-spinner/index.js +12 -0
- package/build-module/components/canvas-spinner/index.js.map +1 -0
- package/build-module/components/create-template-part-modal/index.js +5 -3
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +7 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -12
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +5 -28
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +2 -2
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +17 -11
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +11 -7
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +40 -8
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +61 -15
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +49 -32
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +7 -2
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +15 -11
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +23 -134
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +0 -2
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/palette.js +10 -5
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +18 -14
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +26 -15
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +10 -5
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +16 -11
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +43 -37
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +21 -9
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +23 -18
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -4
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +18 -13
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +23 -9
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +5 -2
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +14 -9
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +16 -12
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +177 -0
- package/build-module/components/global-styles/shadow-panel.js.map +1 -0
- package/build-module/components/global-styles/typography-panel.js +43 -31
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +17 -9
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +98 -35
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +4 -319
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +5 -5
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +2 -2
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +10 -11
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +9 -12
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
- package/build-module/components/navigation-inspector/index.js.map +1 -0
- package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -15
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -0
- package/build-module/components/sidebar/index.js +2 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +6 -21
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -13
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +22 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +40 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +4 -9
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +10 -10
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +1 -1
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/style-book/index.js +8 -5
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -4
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +5 -9
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/experiments.js +9 -0
- package/build-module/experiments.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +62 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/index.js +52 -60
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +0 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +5 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +29 -0
- package/build-module/store/private-actions.js.map +1 -0
- package/build-module/store/private-selectors.js +11 -0
- package/build-module/store/private-selectors.js.map +1 -0
- package/build-module/store/selectors.js +6 -37
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +66 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/template-part-create.js +53 -0
- package/build-module/utils/template-part-create.js.map +1 -0
- package/build-style/style-rtl.css +314 -216
- package/build-style/style.css +314 -216
- package/package.json +32 -30
- package/src/components/add-new-template/add-custom-generic-template-modal.js +20 -28
- package/src/components/add-new-template/add-custom-template-modal.js +0 -1
- package/src/components/add-new-template/new-template-part.js +14 -34
- package/src/components/add-new-template/new-template.js +5 -3
- package/src/components/add-new-template/style.scss +0 -4
- package/src/components/add-new-template/utils.js +0 -14
- package/src/components/app/index.js +2 -2
- package/src/components/block-editor/editor-canvas.js +12 -2
- package/src/components/block-editor/index.js +16 -28
- package/src/components/block-editor/inserter-media-categories.js +247 -0
- package/src/components/block-editor/style.scss +20 -7
- package/src/components/canvas-spinner/index.js +12 -0
- package/src/components/canvas-spinner/style.scss +7 -0
- package/src/components/create-template-part-modal/index.js +75 -67
- package/src/components/create-template-part-modal/style.scss +0 -10
- package/src/components/editor/index.js +8 -5
- package/src/components/error-boundary/index.js +2 -10
- package/src/components/error-boundary/warning.js +6 -35
- package/src/components/global-styles/README.md +1 -75
- package/src/components/global-styles/block-preview-panel.js +2 -2
- package/src/components/global-styles/border-panel.js +19 -17
- package/src/components/global-styles/color-palette-panel.js +10 -7
- package/src/components/global-styles/context-menu.js +114 -44
- package/src/components/global-styles/custom-css.js +76 -19
- package/src/components/global-styles/dimensions-panel.js +46 -36
- package/src/components/global-styles/global-styles-provider.js +6 -2
- package/src/components/global-styles/gradients-palette-panel.js +17 -11
- package/src/components/global-styles/hooks.js +31 -155
- package/src/components/global-styles/index.js +0 -2
- package/src/components/global-styles/palette.js +9 -5
- package/src/components/global-styles/preview.js +19 -13
- package/src/components/global-styles/screen-background-color.js +37 -21
- package/src/components/global-styles/screen-border.js +10 -5
- package/src/components/global-styles/screen-button-color.js +21 -19
- package/src/components/global-styles/screen-colors.js +48 -65
- package/src/components/global-styles/screen-css.js +30 -14
- package/src/components/global-styles/screen-heading-color.js +32 -27
- package/src/components/global-styles/screen-layout.js +4 -7
- package/src/components/global-styles/screen-link-color.js +26 -26
- package/src/components/global-styles/screen-root.js +24 -9
- package/src/components/global-styles/screen-style-variations.js +7 -2
- package/src/components/global-styles/screen-text-color.js +15 -19
- package/src/components/global-styles/screen-typography.js +27 -12
- package/src/components/global-styles/shadow-panel.js +174 -0
- package/src/components/global-styles/style.scss +85 -1
- package/src/components/global-styles/typography-panel.js +60 -48
- package/src/components/global-styles/typography-preview.js +28 -9
- package/src/components/global-styles/ui.js +97 -53
- package/src/components/global-styles/utils.js +4 -371
- package/src/components/global-styles-renderer/index.js +3 -4
- package/src/components/header-edit-mode/document-actions/index.js +1 -1
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/src/components/layout/index.js +12 -4
- package/src/components/layout/style.scss +4 -5
- package/src/components/list/actions/rename-menu-item.js +14 -23
- package/src/components/list/style.scss +0 -4
- package/src/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +2 -2
- package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +10 -12
- package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/style.scss +0 -17
- package/src/components/sidebar/index.js +2 -0
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +8 -32
- package/src/components/sidebar-edit-mode/index.js +0 -11
- package/src/components/sidebar-edit-mode/settings-header/style.scss +8 -0
- package/src/components/sidebar-navigation-item/style.scss +28 -3
- package/src/components/sidebar-navigation-screen/index.js +4 -3
- package/src/components/sidebar-navigation-screen/style.scss +2 -0
- package/src/components/sidebar-navigation-screen-main/index.js +23 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +45 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +12 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +12 -19
- package/src/components/site-hub/index.js +8 -10
- package/src/components/site-hub/style.scss +7 -1
- package/src/components/site-icon/index.js +1 -1
- package/src/components/site-icon/style.scss +2 -2
- package/src/components/style-book/index.js +10 -5
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -3
- package/src/components/template-part-converter/convert-to-template-part.js +12 -10
- package/src/experiments.js +10 -0
- package/src/hooks/push-changes-to-global-styles/index.js +63 -5
- package/src/index.js +51 -59
- package/src/store/actions.js +0 -24
- package/src/store/index.js +5 -0
- package/src/store/private-actions.js +29 -0
- package/src/store/private-selectors.js +10 -0
- package/src/store/selectors.js +6 -37
- package/src/store/test/utils.js +181 -0
- package/src/store/utils.js +69 -0
- package/src/style.scss +4 -2
- package/src/utils/template-part-create.js +62 -0
- package/src/utils/test/template-part-create.js +63 -0
- package/build/components/global-styles/context.js +0 -22
- package/build/components/global-styles/context.js.map +0 -1
- package/build/components/global-styles/typography-utils.js +0 -92
- package/build/components/global-styles/typography-utils.js.map +0 -1
- package/build/components/global-styles/use-global-styles-output.js +0 -943
- package/build/components/global-styles/use-global-styles-output.js.map +0 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -42
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
- package/build-module/components/global-styles/context.js +0 -12
- package/build-module/components/global-styles/context.js.map +0 -1
- package/build-module/components/global-styles/typography-utils.js +0 -84
- package/build-module/components/global-styles/typography-utils.js.map +0 -1
- package/build-module/components/global-styles/use-global-styles-output.js +0 -901
- package/build-module/components/global-styles/use-global-styles-output.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -28
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
- package/src/components/global-styles/context.js +0 -15
- package/src/components/global-styles/test/typography-utils.js +0 -393
- package/src/components/global-styles/test/use-global-styles-output.js +0 -814
- package/src/components/global-styles/test/utils.js +0 -206
- package/src/components/global-styles/typography-utils.js +0 -87
- package/src/components/global-styles/use-global-styles-output.js +0 -1059
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -37
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
__experimentalColorGradientControl as ColorGradientControl,
|
|
12
|
+
experiments as blockEditorExperiments,
|
|
13
|
+
} from '@wordpress/block-editor';
|
|
6
14
|
|
|
7
15
|
/**
|
|
8
16
|
* Internal dependencies
|
|
@@ -12,47 +20,49 @@ import {
|
|
|
12
20
|
getSupportedGlobalStylesPanels,
|
|
13
21
|
useColorsPerOrigin,
|
|
14
22
|
useGradientsPerOrigin,
|
|
15
|
-
useSetting,
|
|
16
|
-
useStyle,
|
|
17
23
|
} from './hooks';
|
|
24
|
+
import { unlock } from '../../experiments';
|
|
25
|
+
|
|
26
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
|
|
18
27
|
|
|
19
|
-
function ScreenBackgroundColor( { name,
|
|
28
|
+
function ScreenBackgroundColor( { name, variation = '' } ) {
|
|
29
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
20
30
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
21
|
-
const [
|
|
22
|
-
const [
|
|
23
|
-
const [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );
|
|
24
|
-
const [ areCustomGradientsEnabled ] = useSetting(
|
|
31
|
+
const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
|
|
32
|
+
const [ areCustomGradientsEnabled ] = useGlobalSetting(
|
|
25
33
|
'color.customGradient',
|
|
26
34
|
name
|
|
27
35
|
);
|
|
28
|
-
|
|
29
36
|
const colorsPerOrigin = useColorsPerOrigin( name );
|
|
30
37
|
const gradientsPerOrigin = useGradientsPerOrigin( name );
|
|
31
38
|
|
|
32
|
-
const [ isBackgroundEnabled ] =
|
|
39
|
+
const [ isBackgroundEnabled ] = useGlobalSetting(
|
|
40
|
+
'color.background',
|
|
41
|
+
name
|
|
42
|
+
);
|
|
33
43
|
|
|
34
44
|
const hasBackgroundColor =
|
|
35
45
|
supports.includes( 'backgroundColor' ) &&
|
|
36
46
|
isBackgroundEnabled &&
|
|
37
|
-
(
|
|
47
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
38
48
|
const hasGradientColor =
|
|
39
49
|
supports.includes( 'background' ) &&
|
|
40
|
-
(
|
|
41
|
-
const [ backgroundColor, setBackgroundColor ] =
|
|
42
|
-
|
|
50
|
+
( gradientsPerOrigin.length > 0 || areCustomGradientsEnabled );
|
|
51
|
+
const [ backgroundColor, setBackgroundColor ] = useGlobalStyle(
|
|
52
|
+
prefix + 'color.background',
|
|
43
53
|
name
|
|
44
54
|
);
|
|
45
|
-
const [ userBackgroundColor ] =
|
|
46
|
-
|
|
55
|
+
const [ userBackgroundColor ] = useGlobalStyle(
|
|
56
|
+
prefix + 'color.background',
|
|
47
57
|
name,
|
|
48
58
|
'user'
|
|
49
59
|
);
|
|
50
|
-
const [ gradient, setGradient ] =
|
|
51
|
-
|
|
60
|
+
const [ gradient, setGradient ] = useGlobalStyle(
|
|
61
|
+
prefix + 'color.gradient',
|
|
52
62
|
name
|
|
53
63
|
);
|
|
54
|
-
const [ userGradient ] =
|
|
55
|
-
|
|
64
|
+
const [ userGradient ] = useGlobalStyle(
|
|
65
|
+
prefix + 'color.gradient',
|
|
56
66
|
name,
|
|
57
67
|
'user'
|
|
58
68
|
);
|
|
@@ -98,7 +108,13 @@ function ScreenBackgroundColor( { name, variationPath = '' } ) {
|
|
|
98
108
|
) }
|
|
99
109
|
/>
|
|
100
110
|
<ColorGradientControl
|
|
101
|
-
className=
|
|
111
|
+
className={ classnames(
|
|
112
|
+
'edit-site-screen-background-color__control',
|
|
113
|
+
{
|
|
114
|
+
'has-no-tabs':
|
|
115
|
+
! hasBackgroundColor || ! hasGradientColor,
|
|
116
|
+
}
|
|
117
|
+
) }
|
|
102
118
|
colors={ colorsPerOrigin }
|
|
103
119
|
gradients={ gradientsPerOrigin }
|
|
104
120
|
disableCustomColors={ ! areCustomSolidsEnabled }
|
|
@@ -9,17 +9,22 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
import ScreenHeader from './header';
|
|
10
10
|
import BorderPanel, { useHasBorderPanel } from './border-panel';
|
|
11
11
|
import BlockPreviewPanel from './block-preview-panel';
|
|
12
|
-
import {
|
|
12
|
+
import { getVariationClassName } from './utils';
|
|
13
|
+
import ShadowPanel, { useHasShadowControl } from './shadow-panel';
|
|
13
14
|
|
|
14
|
-
function ScreenBorder( { name,
|
|
15
|
+
function ScreenBorder( { name, variation = '' } ) {
|
|
15
16
|
const hasBorderPanel = useHasBorderPanel( name );
|
|
16
|
-
const variationClassName =
|
|
17
|
+
const variationClassName = getVariationClassName( variation );
|
|
18
|
+
const hasShadowPanel = useHasShadowControl( name );
|
|
17
19
|
return (
|
|
18
20
|
<>
|
|
19
|
-
<ScreenHeader title={ __( 'Border' ) } />
|
|
21
|
+
<ScreenHeader title={ __( 'Border & Shadow' ) } />
|
|
20
22
|
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
21
23
|
{ hasBorderPanel && (
|
|
22
|
-
<BorderPanel name={ name }
|
|
24
|
+
<BorderPanel name={ name } variation={ variation } />
|
|
25
|
+
) }
|
|
26
|
+
{ hasShadowPanel && (
|
|
27
|
+
<ShadowPanel name={ name } variation={ variation } />
|
|
23
28
|
) }
|
|
24
29
|
</>
|
|
25
30
|
);
|
|
@@ -2,48 +2,50 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
__experimentalColorGradientControl as ColorGradientControl,
|
|
7
|
+
experiments as blockEditorExperiments,
|
|
8
|
+
} from '@wordpress/block-editor';
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* Internal dependencies
|
|
9
12
|
*/
|
|
10
13
|
import ScreenHeader from './header';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
useSetting,
|
|
14
|
-
useStyle,
|
|
15
|
-
useColorsPerOrigin,
|
|
16
|
-
} from './hooks';
|
|
14
|
+
import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
|
|
15
|
+
import { unlock } from '../../experiments';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
const supports = getSupportedGlobalStylesPanels( name );
|
|
20
|
-
const [ solids ] = useSetting( 'color.palette', name );
|
|
21
|
-
const [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );
|
|
17
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
|
|
22
18
|
|
|
19
|
+
function ScreenButtonColor( { name, variation = '' } ) {
|
|
20
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
21
|
+
const supports = getSupportedGlobalStylesPanels( name );
|
|
23
22
|
const colorsPerOrigin = useColorsPerOrigin( name );
|
|
24
|
-
|
|
25
|
-
const [ isBackgroundEnabled ] =
|
|
23
|
+
const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
|
|
24
|
+
const [ isBackgroundEnabled ] = useGlobalSetting(
|
|
25
|
+
'color.background',
|
|
26
|
+
name
|
|
27
|
+
);
|
|
26
28
|
|
|
27
29
|
const hasButtonColor =
|
|
28
30
|
supports.includes( 'buttonColor' ) &&
|
|
29
31
|
isBackgroundEnabled &&
|
|
30
|
-
(
|
|
32
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
31
33
|
|
|
32
|
-
const [ buttonTextColor, setButtonTextColor ] =
|
|
33
|
-
|
|
34
|
+
const [ buttonTextColor, setButtonTextColor ] = useGlobalStyle(
|
|
35
|
+
prefix + 'elements.button.color.text',
|
|
34
36
|
name
|
|
35
37
|
);
|
|
36
|
-
const [ userButtonTextColor ] =
|
|
38
|
+
const [ userButtonTextColor ] = useGlobalStyle(
|
|
37
39
|
'elements.button.color.text',
|
|
38
40
|
name,
|
|
39
41
|
'user'
|
|
40
42
|
);
|
|
41
43
|
|
|
42
|
-
const [ buttonBgColor, setButtonBgColor ] =
|
|
44
|
+
const [ buttonBgColor, setButtonBgColor ] = useGlobalStyle(
|
|
43
45
|
'elements.button.color.background',
|
|
44
46
|
name
|
|
45
47
|
);
|
|
46
|
-
const [ userButtonBgColor ] =
|
|
48
|
+
const [ userButtonBgColor ] = useGlobalStyle(
|
|
47
49
|
'elements.button.color.background',
|
|
48
50
|
name,
|
|
49
51
|
'user'
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
FlexItem,
|
|
11
11
|
ColorIndicator,
|
|
12
12
|
} from '@wordpress/components';
|
|
13
|
+
import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Internal dependencies
|
|
@@ -17,33 +18,27 @@ import {
|
|
|
17
18
|
import ScreenHeader from './header';
|
|
18
19
|
import Palette from './palette';
|
|
19
20
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
20
|
-
import { getSupportedGlobalStylesPanels
|
|
21
|
+
import { getSupportedGlobalStylesPanels } from './hooks';
|
|
21
22
|
import Subtitle from './subtitle';
|
|
22
23
|
import ColorIndicatorWrapper from './color-indicator-wrapper';
|
|
23
24
|
import BlockPreviewPanel from './block-preview-panel';
|
|
24
|
-
import {
|
|
25
|
+
import { getVariationClassName } from './utils';
|
|
26
|
+
import { unlock } from '../../experiments';
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
if ( ! variationPath ) {
|
|
28
|
-
return '';
|
|
29
|
-
}
|
|
30
|
-
// Replace the dots with slashes, add slash at the beginning and remove the last slash.
|
|
31
|
-
return '/' + variationPath.replace( /\./g, '/' ).slice( 0, -1 );
|
|
32
|
-
}
|
|
28
|
+
const { useGlobalStyle } = unlock( blockEditorExperiments );
|
|
33
29
|
|
|
34
|
-
function BackgroundColorItem( { name, parentMenu,
|
|
30
|
+
function BackgroundColorItem( { name, parentMenu, variation = '' } ) {
|
|
31
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
32
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
35
33
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
36
34
|
const hasSupport =
|
|
37
35
|
supports.includes( 'backgroundColor' ) ||
|
|
38
36
|
supports.includes( 'background' );
|
|
39
|
-
const [ backgroundColor ] =
|
|
40
|
-
|
|
41
|
-
name
|
|
42
|
-
);
|
|
43
|
-
const [ gradientValue ] = useStyle(
|
|
44
|
-
variationPath + 'color.gradient',
|
|
37
|
+
const [ backgroundColor ] = useGlobalStyle(
|
|
38
|
+
prefix + 'color.background',
|
|
45
39
|
name
|
|
46
40
|
);
|
|
41
|
+
const [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );
|
|
47
42
|
|
|
48
43
|
if ( ! hasSupport ) {
|
|
49
44
|
return null;
|
|
@@ -51,11 +46,7 @@ function BackgroundColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
51
46
|
|
|
52
47
|
return (
|
|
53
48
|
<NavigationButtonAsItem
|
|
54
|
-
path={
|
|
55
|
-
parentMenu +
|
|
56
|
-
variationPathToURL( variationPath ) +
|
|
57
|
-
'/colors/background'
|
|
58
|
-
}
|
|
49
|
+
path={ parentMenu + urlPrefix + '/colors/background' }
|
|
59
50
|
aria-label={ __( 'Colors background styles' ) }
|
|
60
51
|
>
|
|
61
52
|
<HStack justify="flex-start">
|
|
@@ -73,10 +64,12 @@ function BackgroundColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
73
64
|
);
|
|
74
65
|
}
|
|
75
66
|
|
|
76
|
-
function TextColorItem( { name, parentMenu,
|
|
67
|
+
function TextColorItem( { name, parentMenu, variation = '' } ) {
|
|
68
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
69
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
77
70
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
78
71
|
const hasSupport = supports.includes( 'color' );
|
|
79
|
-
const [ color ] =
|
|
72
|
+
const [ color ] = useGlobalStyle( prefix + 'color.text', name );
|
|
80
73
|
|
|
81
74
|
if ( ! hasSupport ) {
|
|
82
75
|
return null;
|
|
@@ -84,11 +77,7 @@ function TextColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
84
77
|
|
|
85
78
|
return (
|
|
86
79
|
<NavigationButtonAsItem
|
|
87
|
-
path={
|
|
88
|
-
parentMenu +
|
|
89
|
-
variationPathToURL( variationPath ) +
|
|
90
|
-
'/colors/text'
|
|
91
|
-
}
|
|
80
|
+
path={ parentMenu + urlPrefix + '/colors/text' }
|
|
92
81
|
aria-label={ __( 'Colors text styles' ) }
|
|
93
82
|
>
|
|
94
83
|
<HStack justify="flex-start">
|
|
@@ -106,15 +95,17 @@ function TextColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
106
95
|
);
|
|
107
96
|
}
|
|
108
97
|
|
|
109
|
-
function LinkColorItem( { name, parentMenu,
|
|
98
|
+
function LinkColorItem( { name, parentMenu, variation = '' } ) {
|
|
99
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
100
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
110
101
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
111
102
|
const hasSupport = supports.includes( 'linkColor' );
|
|
112
|
-
const [ color ] =
|
|
113
|
-
|
|
103
|
+
const [ color ] = useGlobalStyle(
|
|
104
|
+
prefix + 'elements.link.color.text',
|
|
114
105
|
name
|
|
115
106
|
);
|
|
116
|
-
const [ colorHover ] =
|
|
117
|
-
|
|
107
|
+
const [ colorHover ] = useGlobalStyle(
|
|
108
|
+
prefix + 'elements.link.:hover.color.text',
|
|
118
109
|
name
|
|
119
110
|
);
|
|
120
111
|
|
|
@@ -124,11 +115,7 @@ function LinkColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
124
115
|
|
|
125
116
|
return (
|
|
126
117
|
<NavigationButtonAsItem
|
|
127
|
-
path={
|
|
128
|
-
parentMenu +
|
|
129
|
-
variationPathToURL( variationPath ) +
|
|
130
|
-
'/colors/link'
|
|
131
|
-
}
|
|
118
|
+
path={ parentMenu + urlPrefix + '/colors/link' }
|
|
132
119
|
aria-label={ __( 'Colors link styles' ) }
|
|
133
120
|
>
|
|
134
121
|
<HStack justify="flex-start">
|
|
@@ -148,15 +135,17 @@ function LinkColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
148
135
|
);
|
|
149
136
|
}
|
|
150
137
|
|
|
151
|
-
function HeadingColorItem( { name, parentMenu,
|
|
138
|
+
function HeadingColorItem( { name, parentMenu, variation = '' } ) {
|
|
139
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
140
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
152
141
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
153
142
|
const hasSupport = supports.includes( 'color' );
|
|
154
|
-
const [ color ] =
|
|
155
|
-
|
|
143
|
+
const [ color ] = useGlobalStyle(
|
|
144
|
+
prefix + 'elements.heading.color.text',
|
|
156
145
|
name
|
|
157
146
|
);
|
|
158
|
-
const [ bgColor ] =
|
|
159
|
-
|
|
147
|
+
const [ bgColor ] = useGlobalStyle(
|
|
148
|
+
prefix + 'elements.heading.color.background',
|
|
160
149
|
name
|
|
161
150
|
);
|
|
162
151
|
|
|
@@ -166,11 +155,7 @@ function HeadingColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
166
155
|
|
|
167
156
|
return (
|
|
168
157
|
<NavigationButtonAsItem
|
|
169
|
-
path={
|
|
170
|
-
parentMenu +
|
|
171
|
-
variationPathToURL( variationPath ) +
|
|
172
|
-
'/colors/heading'
|
|
173
|
-
}
|
|
158
|
+
path={ parentMenu + urlPrefix + '/colors/heading' }
|
|
174
159
|
aria-label={ __( 'Colors heading styles' ) }
|
|
175
160
|
>
|
|
176
161
|
<HStack justify="flex-start">
|
|
@@ -188,15 +173,17 @@ function HeadingColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
188
173
|
);
|
|
189
174
|
}
|
|
190
175
|
|
|
191
|
-
function ButtonColorItem( { name, parentMenu,
|
|
176
|
+
function ButtonColorItem( { name, parentMenu, variation = '' } ) {
|
|
177
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
178
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
192
179
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
193
180
|
const hasSupport = supports.includes( 'buttonColor' );
|
|
194
|
-
const [ color ] =
|
|
195
|
-
|
|
181
|
+
const [ color ] = useGlobalStyle(
|
|
182
|
+
prefix + 'elements.button.color.text',
|
|
196
183
|
name
|
|
197
184
|
);
|
|
198
|
-
const [ bgColor ] =
|
|
199
|
-
|
|
185
|
+
const [ bgColor ] = useGlobalStyle(
|
|
186
|
+
prefix + 'elements.button.color.background',
|
|
200
187
|
name
|
|
201
188
|
);
|
|
202
189
|
|
|
@@ -206,11 +193,7 @@ function ButtonColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
206
193
|
|
|
207
194
|
return (
|
|
208
195
|
<NavigationButtonAsItem
|
|
209
|
-
path={
|
|
210
|
-
parentMenu +
|
|
211
|
-
variationPathToURL( variationPath ) +
|
|
212
|
-
'/colors/button'
|
|
213
|
-
}
|
|
196
|
+
path={ parentMenu + urlPrefix + '/colors/button' }
|
|
214
197
|
>
|
|
215
198
|
<HStack justify="flex-start">
|
|
216
199
|
<ZStack isLayered={ false } offset={ -8 }>
|
|
@@ -229,10 +212,10 @@ function ButtonColorItem( { name, parentMenu, variationPath = '' } ) {
|
|
|
229
212
|
);
|
|
230
213
|
}
|
|
231
214
|
|
|
232
|
-
function ScreenColors( { name,
|
|
215
|
+
function ScreenColors( { name, variation = '' } ) {
|
|
233
216
|
const parentMenu =
|
|
234
217
|
name === undefined ? '' : '/blocks/' + encodeURIComponent( name );
|
|
235
|
-
const variationClassName =
|
|
218
|
+
const variationClassName = getVariationClassName( variation );
|
|
236
219
|
|
|
237
220
|
return (
|
|
238
221
|
<>
|
|
@@ -255,27 +238,27 @@ function ScreenColors( { name, variationPath = '' } ) {
|
|
|
255
238
|
<BackgroundColorItem
|
|
256
239
|
name={ name }
|
|
257
240
|
parentMenu={ parentMenu }
|
|
258
|
-
|
|
241
|
+
variation={ variation }
|
|
259
242
|
/>
|
|
260
243
|
<TextColorItem
|
|
261
244
|
name={ name }
|
|
262
245
|
parentMenu={ parentMenu }
|
|
263
|
-
|
|
246
|
+
variation={ variation }
|
|
264
247
|
/>
|
|
265
248
|
<LinkColorItem
|
|
266
249
|
name={ name }
|
|
267
250
|
parentMenu={ parentMenu }
|
|
268
|
-
|
|
251
|
+
variation={ variation }
|
|
269
252
|
/>
|
|
270
253
|
<HeadingColorItem
|
|
271
254
|
name={ name }
|
|
272
255
|
parentMenu={ parentMenu }
|
|
273
|
-
|
|
256
|
+
variation={ variation }
|
|
274
257
|
/>
|
|
275
258
|
<ButtonColorItem
|
|
276
259
|
name={ name }
|
|
277
260
|
parentMenu={ parentMenu }
|
|
278
|
-
|
|
261
|
+
variation={ variation }
|
|
279
262
|
/>
|
|
280
263
|
</ItemGroup>
|
|
281
264
|
</VStack>
|
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
4
|
+
import { sprintf, __ } from '@wordpress/i18n';
|
|
5
|
+
import { ExternalLink } from '@wordpress/components';
|
|
6
|
+
import { getBlockType } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
9
10
|
*/
|
|
10
11
|
import ScreenHeader from './header';
|
|
11
|
-
import Subtitle from './subtitle';
|
|
12
12
|
import CustomCSSControl from './custom-css';
|
|
13
13
|
|
|
14
|
-
function ScreenCSS() {
|
|
14
|
+
function ScreenCSS( { name } ) {
|
|
15
|
+
// If name is defined, we are customizing CSS at the block level.
|
|
16
|
+
// Display the block title in the description.
|
|
17
|
+
const blockType = getBlockType( name );
|
|
18
|
+
const title = blockType?.title;
|
|
19
|
+
|
|
20
|
+
const description =
|
|
21
|
+
title !== undefined
|
|
22
|
+
? sprintf(
|
|
23
|
+
// translators: %s: is the name of a block e.g., 'Image' or 'Table'.
|
|
24
|
+
__(
|
|
25
|
+
'Add your own CSS to customize the appearance of the %s block.'
|
|
26
|
+
),
|
|
27
|
+
title
|
|
28
|
+
)
|
|
29
|
+
: __(
|
|
30
|
+
'Add your own CSS to customize the appearance and layout of your site.'
|
|
31
|
+
);
|
|
32
|
+
|
|
15
33
|
return (
|
|
16
34
|
<>
|
|
17
|
-
<ScreenHeader
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
<ScreenHeader title={ __( 'CSS' ) } description={ description } />
|
|
36
|
+
<ExternalLink
|
|
37
|
+
href="https://wordpress.org/support/article/css/"
|
|
38
|
+
className="edit-site-global-styles-screen-css-help-link"
|
|
39
|
+
>
|
|
40
|
+
{ __( 'Learn more about CSS' ) }
|
|
41
|
+
</ExternalLink>
|
|
23
42
|
<div className="edit-site-global-styles-screen-css">
|
|
24
|
-
<
|
|
25
|
-
<Subtitle>{ __( 'ADDITIONAL CSS' ) }</Subtitle>
|
|
26
|
-
<CustomCSSControl />
|
|
27
|
-
</VStack>
|
|
43
|
+
<CustomCSSControl blockName={ name } />
|
|
28
44
|
</div>
|
|
29
45
|
</>
|
|
30
46
|
);
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
7
7
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
__experimentalColorGradientControl as ColorGradientControl,
|
|
11
|
+
experiments as blockEditorExperiments,
|
|
12
|
+
} from '@wordpress/block-editor';
|
|
10
13
|
import { useState } from '@wordpress/element';
|
|
11
14
|
|
|
12
15
|
/**
|
|
@@ -15,67 +18,68 @@ import { useState } from '@wordpress/element';
|
|
|
15
18
|
import ScreenHeader from './header';
|
|
16
19
|
import {
|
|
17
20
|
getSupportedGlobalStylesPanels,
|
|
18
|
-
useSetting,
|
|
19
|
-
useStyle,
|
|
20
21
|
useColorsPerOrigin,
|
|
21
22
|
useGradientsPerOrigin,
|
|
22
23
|
} from './hooks';
|
|
24
|
+
import { unlock } from '../../experiments';
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
const [ selectedLevel, setCurrentTab ] = useState( 'heading' );
|
|
26
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
|
|
26
27
|
|
|
28
|
+
function ScreenHeadingColor( { name, variation = '' } ) {
|
|
29
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
30
|
+
const [ selectedLevel, setCurrentTab ] = useState( 'heading' );
|
|
27
31
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
28
|
-
const [
|
|
29
|
-
const [
|
|
30
|
-
const [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );
|
|
31
|
-
const [ areCustomGradientsEnabled ] = useSetting(
|
|
32
|
+
const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
|
|
33
|
+
const [ areCustomGradientsEnabled ] = useGlobalSetting(
|
|
32
34
|
'color.customGradient',
|
|
33
35
|
name
|
|
34
36
|
);
|
|
35
|
-
const [ isTextEnabled ] =
|
|
36
|
-
const [ isBackgroundEnabled ] =
|
|
37
|
-
|
|
37
|
+
const [ isTextEnabled ] = useGlobalSetting( 'color.text', name );
|
|
38
|
+
const [ isBackgroundEnabled ] = useGlobalSetting(
|
|
39
|
+
'color.background',
|
|
40
|
+
name
|
|
41
|
+
);
|
|
38
42
|
const colorsPerOrigin = useColorsPerOrigin( name );
|
|
39
43
|
const gradientsPerOrigin = useGradientsPerOrigin( name );
|
|
40
44
|
|
|
41
45
|
const hasTextColor =
|
|
42
46
|
supports.includes( 'color' ) &&
|
|
43
47
|
isTextEnabled &&
|
|
44
|
-
(
|
|
48
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
45
49
|
|
|
46
50
|
const hasBackgroundColor =
|
|
47
51
|
supports.includes( 'backgroundColor' ) &&
|
|
48
52
|
isBackgroundEnabled &&
|
|
49
|
-
(
|
|
53
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
50
54
|
const hasGradientColor =
|
|
51
55
|
supports.includes( 'background' ) &&
|
|
52
|
-
(
|
|
56
|
+
( gradientsPerOrigin.length > 0 || areCustomGradientsEnabled );
|
|
53
57
|
|
|
54
|
-
const [ color, setColor ] =
|
|
55
|
-
|
|
58
|
+
const [ color, setColor ] = useGlobalStyle(
|
|
59
|
+
prefix + 'elements.' + selectedLevel + '.color.text',
|
|
56
60
|
name
|
|
57
61
|
);
|
|
58
|
-
const [ userColor ] =
|
|
59
|
-
|
|
62
|
+
const [ userColor ] = useGlobalStyle(
|
|
63
|
+
prefix + 'elements.' + selectedLevel + '.color.text',
|
|
60
64
|
name,
|
|
61
65
|
'user'
|
|
62
66
|
);
|
|
63
67
|
|
|
64
|
-
const [ backgroundColor, setBackgroundColor ] =
|
|
65
|
-
|
|
68
|
+
const [ backgroundColor, setBackgroundColor ] = useGlobalStyle(
|
|
69
|
+
prefix + 'elements.' + selectedLevel + '.color.background',
|
|
66
70
|
name
|
|
67
71
|
);
|
|
68
|
-
const [ userBackgroundColor ] =
|
|
69
|
-
|
|
72
|
+
const [ userBackgroundColor ] = useGlobalStyle(
|
|
73
|
+
prefix + 'elements.' + selectedLevel + '.color.background',
|
|
70
74
|
name,
|
|
71
75
|
'user'
|
|
72
76
|
);
|
|
73
|
-
const [ gradient, setGradient ] =
|
|
74
|
-
|
|
77
|
+
const [ gradient, setGradient ] = useGlobalStyle(
|
|
78
|
+
prefix + 'elements.' + selectedLevel + '.color.gradient',
|
|
75
79
|
name
|
|
76
80
|
);
|
|
77
|
-
const [ userGradient ] =
|
|
78
|
-
|
|
81
|
+
const [ userGradient ] = useGlobalStyle(
|
|
82
|
+
prefix + 'elements.' + selectedLevel + '.color.gradient',
|
|
79
83
|
name,
|
|
80
84
|
'user'
|
|
81
85
|
);
|
|
@@ -124,6 +128,7 @@ function ScreenHeadingColor( { name, variationPath = '' } ) {
|
|
|
124
128
|
<h4>{ __( 'Select heading level' ) }</h4>
|
|
125
129
|
|
|
126
130
|
<ToggleGroupControl
|
|
131
|
+
__nextHasNoMarginBottom
|
|
127
132
|
label={ __( 'Select heading level' ) }
|
|
128
133
|
hideLabelFromVision={ true }
|
|
129
134
|
value={ selectedLevel }
|
|
@@ -9,20 +9,17 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
import DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';
|
|
10
10
|
import ScreenHeader from './header';
|
|
11
11
|
import BlockPreviewPanel from './block-preview-panel';
|
|
12
|
-
import {
|
|
12
|
+
import { getVariationClassName } from './utils';
|
|
13
13
|
|
|
14
|
-
function ScreenLayout( { name,
|
|
14
|
+
function ScreenLayout( { name, variation = '' } ) {
|
|
15
15
|
const hasDimensionsPanel = useHasDimensionsPanel( name );
|
|
16
|
-
const variationClassName =
|
|
16
|
+
const variationClassName = getVariationClassName( variation );
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
19
19
|
<ScreenHeader title={ __( 'Layout' ) } />
|
|
20
20
|
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
21
21
|
{ hasDimensionsPanel && (
|
|
22
|
-
<DimensionsPanel
|
|
23
|
-
name={ name }
|
|
24
|
-
variationPath={ variationPath }
|
|
25
|
-
/>
|
|
22
|
+
<DimensionsPanel name={ name } variation={ variation } />
|
|
26
23
|
) }
|
|
27
24
|
</>
|
|
28
25
|
);
|