@wordpress/block-editor 15.22.1-next.v.202606191442.0 → 15.23.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 +3 -1
- package/README.md +2 -2
- package/build/components/block-editing-mode/index.cjs +13 -7
- package/build/components/block-editing-mode/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +50 -51
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-rename/modal.cjs +0 -1
- package/build/components/block-rename/modal.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +14 -6
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +25 -14
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/colors-gradients/dropdown.cjs +4 -1
- package/build/components/colors-gradients/dropdown.cjs.map +3 -3
- package/build/components/contrast-checker/index.cjs +22 -4
- package/build/components/contrast-checker/index.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs +0 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +153 -25
- package/build/components/global-styles/background-panel.cjs.map +3 -3
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +227 -0
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +7 -0
- package/build/components/global-styles/color-panel.cjs +98 -375
- package/build/components/global-styles/color-panel.cjs.map +3 -3
- package/build/components/global-styles/dimensions-panel.cjs +0 -3
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +34 -0
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +82 -10
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/inspector-controls/groups.cjs +2 -0
- package/build/components/inspector-controls/groups.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.cjs +75 -31
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/link-control/index.cjs +1 -2
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +1 -10
- package/build/components/list-view/block-select-button.cjs.map +3 -3
- package/build/components/provider/use-block-sync.cjs +3 -1
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/url-popover/image-url-input-ui.cjs +0 -2
- package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +10 -3
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/use-resize-canvas/index.cjs +16 -53
- package/build/components/use-resize-canvas/index.cjs.map +3 -3
- package/build/hooks/anchor.cjs +0 -1
- package/build/hooks/anchor.cjs.map +2 -2
- package/build/hooks/background.cjs +124 -75
- package/build/hooks/background.cjs.map +3 -3
- package/build/hooks/color.cjs +0 -162
- package/build/hooks/color.cjs.map +3 -3
- package/build/hooks/contrast-checker.cjs +31 -28
- package/build/hooks/contrast-checker.cjs.map +3 -3
- package/build/hooks/custom-class-name.cjs +0 -1
- package/build/hooks/custom-class-name.cjs.map +2 -2
- package/build/hooks/elements.cjs +142 -0
- package/build/hooks/elements.cjs.map +7 -0
- package/build/hooks/grid-visualizer.cjs +21 -11
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +38 -8
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/layout.cjs +6 -3
- package/build/hooks/layout.cjs.map +2 -2
- package/build/hooks/states.cjs +15 -23
- package/build/hooks/states.cjs.map +2 -2
- package/build/hooks/style.cjs +8 -4
- package/build/hooks/style.cjs.map +2 -2
- package/build/hooks/typography.cjs +62 -10
- package/build/hooks/typography.cjs.map +3 -3
- package/build/layouts/flex.cjs +99 -6
- package/build/layouts/flex.cjs.map +2 -2
- package/build/private-apis.cjs +0 -1
- package/build/private-apis.cjs.map +2 -2
- package/build/store/private-actions.cjs +16 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-keys.cjs +0 -3
- package/build/store/private-keys.cjs.map +2 -2
- package/build/store/private-selectors.cjs +24 -6
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +19 -3
- package/build/store/reducer.cjs.map +2 -2
- package/build/utils/block-bindings.cjs +9 -9
- package/build/utils/block-bindings.cjs.map +3 -3
- package/build/utils/color-values.cjs +10 -1
- package/build/utils/color-values.cjs.map +3 -3
- package/build/utils/dom.cjs +2 -5
- package/build/utils/dom.cjs.map +3 -3
- package/build/utils/fit-text-frontend.cjs +6 -2
- package/build/utils/fit-text-frontend.cjs.map +3 -3
- package/build/utils/fit-text-utils.cjs +1 -1
- package/build/utils/fit-text-utils.cjs.map +3 -3
- package/build/utils/format-font-style.cjs +1 -1
- package/build/utils/format-font-style.cjs.map +3 -3
- package/build/utils/format-font-weight.cjs +1 -1
- package/build/utils/format-font-weight.cjs.map +3 -3
- package/build/utils/get-editor-region.cjs +4 -2
- package/build/utils/get-editor-region.cjs.map +3 -3
- package/build/utils/get-font-styles-and-weights.cjs +8 -12
- package/build/utils/get-font-styles-and-weights.cjs.map +3 -3
- package/build/utils/get-px-from-css-unit.cjs +1 -1
- package/build/utils/get-px-from-css-unit.cjs.map +1 -1
- package/build/utils/index.cjs +1 -1
- package/build/utils/index.cjs.map +1 -1
- package/build/utils/math.cjs +1 -1
- package/build/utils/math.cjs.map +3 -3
- package/build/utils/object.cjs +8 -8
- package/build/utils/object.cjs.map +3 -3
- package/build/utils/order-inserter-block-items.cjs +1 -1
- package/build/utils/order-inserter-block-items.cjs.map +3 -3
- package/build/utils/pasting.cjs +4 -2
- package/build/utils/pasting.cjs.map +3 -3
- package/build/utils/selection.cjs +2 -1
- package/build/utils/selection.cjs.map +3 -3
- package/build/utils/sorting.cjs +9 -3
- package/build/utils/sorting.cjs.map +3 -3
- package/build/utils/transform-styles/index.cjs +3 -2
- package/build/utils/transform-styles/index.cjs.map +3 -3
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs +2 -0
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs.map +7 -0
- package/build/utils/transform-styles/types.cjs +19 -0
- package/build/utils/transform-styles/types.cjs.map +7 -0
- package/build/utils/types.cjs +19 -0
- package/build/utils/types.cjs.map +7 -0
- package/build-module/components/block-editing-mode/index.mjs +14 -8
- package/build-module/components/block-editing-mode/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +50 -51
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-rename/modal.mjs +0 -1
- package/build-module/components/block-rename/modal.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +14 -6
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +27 -15
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/colors-gradients/dropdown.mjs +4 -1
- package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
- package/build-module/components/contrast-checker/index.mjs +18 -4
- package/build-module/components/contrast-checker/index.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs +0 -1
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +155 -27
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +207 -0
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +7 -0
- package/build-module/components/global-styles/color-panel.mjs +106 -387
- package/build-module/components/global-styles/color-panel.mjs.map +3 -3
- package/build-module/components/global-styles/dimensions-panel.mjs +0 -3
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +33 -0
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +84 -10
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/inspector-controls/groups.mjs +2 -0
- package/build-module/components/inspector-controls/groups.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +75 -31
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/link-control/index.mjs +1 -2
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +2 -17
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs +3 -1
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs +0 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +10 -3
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/use-resize-canvas/index.mjs +6 -53
- package/build-module/components/use-resize-canvas/index.mjs.map +2 -2
- package/build-module/hooks/anchor.mjs +0 -1
- package/build-module/hooks/anchor.mjs.map +2 -2
- package/build-module/hooks/background.mjs +123 -75
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/color.mjs +2 -175
- package/build-module/hooks/color.mjs.map +2 -2
- package/build-module/hooks/contrast-checker.mjs +32 -19
- package/build-module/hooks/contrast-checker.mjs.map +2 -2
- package/build-module/hooks/custom-class-name.mjs +0 -1
- package/build-module/hooks/custom-class-name.mjs.map +2 -2
- package/build-module/hooks/elements.mjs +115 -0
- package/build-module/hooks/elements.mjs.map +7 -0
- package/build-module/hooks/grid-visualizer.mjs +21 -11
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +41 -8
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +6 -3
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/states.mjs +15 -23
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +9 -5
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +62 -10
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +105 -7
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/private-apis.mjs +0 -2
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +14 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +0 -2
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +22 -6
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +17 -3
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/utils/block-bindings.mjs +9 -9
- package/build-module/utils/block-bindings.mjs.map +3 -3
- package/build-module/utils/color-values.mjs +9 -1
- package/build-module/utils/color-values.mjs.map +3 -3
- package/build-module/utils/dom.mjs +2 -5
- package/build-module/utils/dom.mjs.map +3 -3
- package/build-module/utils/fit-text-frontend.mjs +6 -2
- package/build-module/utils/fit-text-frontend.mjs.map +3 -3
- package/build-module/utils/fit-text-utils.mjs +1 -1
- package/build-module/utils/fit-text-utils.mjs.map +3 -3
- package/build-module/utils/format-font-style.mjs +1 -1
- package/build-module/utils/format-font-style.mjs.map +3 -3
- package/build-module/utils/format-font-weight.mjs +1 -1
- package/build-module/utils/format-font-weight.mjs.map +3 -3
- package/build-module/utils/get-editor-region.mjs +4 -2
- package/build-module/utils/get-editor-region.mjs.map +3 -3
- package/build-module/utils/get-font-styles-and-weights.mjs +8 -12
- package/build-module/utils/get-font-styles-and-weights.mjs.map +3 -3
- package/build-module/utils/get-px-from-css-unit.mjs +1 -1
- package/build-module/utils/get-px-from-css-unit.mjs.map +1 -1
- package/build-module/utils/index.mjs +1 -1
- package/build-module/utils/index.mjs.map +1 -1
- package/build-module/utils/math.mjs +1 -1
- package/build-module/utils/math.mjs.map +3 -3
- package/build-module/utils/object.mjs +8 -8
- package/build-module/utils/object.mjs.map +3 -3
- package/build-module/utils/order-inserter-block-items.mjs +1 -1
- package/build-module/utils/order-inserter-block-items.mjs.map +3 -3
- package/build-module/utils/pasting.mjs +4 -2
- package/build-module/utils/pasting.mjs.map +3 -3
- package/build-module/utils/selection.mjs +2 -1
- package/build-module/utils/selection.mjs.map +3 -3
- package/build-module/utils/sorting.mjs +9 -3
- package/build-module/utils/sorting.mjs.map +3 -3
- package/build-module/utils/transform-styles/index.mjs +3 -2
- package/build-module/utils/transform-styles/index.mjs.map +3 -3
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs +1 -0
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs.map +7 -0
- package/build-module/utils/transform-styles/types.mjs +1 -0
- package/build-module/utils/transform-styles/types.mjs.map +7 -0
- package/build-module/utils/types.mjs +1 -0
- package/build-module/utils/types.mjs.map +7 -0
- package/build-style/content-rtl.css +2 -0
- package/build-style/content.css +2 -0
- package/build-style/style-rtl.css +34 -41
- package/build-style/style.css +34 -41
- package/build-types/utils/block-bindings.d.ts +27 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -0
- package/build-types/utils/color-values.d.ts +40 -0
- package/build-types/utils/color-values.d.ts.map +1 -0
- package/build-types/utils/dom.d.ts +19 -19
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/fit-text-frontend.d.ts +7 -0
- package/build-types/utils/fit-text-frontend.d.ts.map +1 -0
- package/build-types/utils/fit-text-utils.d.ts +15 -0
- package/build-types/utils/fit-text-utils.d.ts.map +1 -0
- package/build-types/utils/format-font-style.d.ts +12 -0
- package/build-types/utils/format-font-style.d.ts.map +1 -0
- package/build-types/utils/format-font-weight.d.ts +12 -0
- package/build-types/utils/format-font-weight.d.ts.map +1 -0
- package/build-types/utils/get-editor-region.d.ts +9 -0
- package/build-types/utils/get-editor-region.d.ts.map +1 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts +16 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts.map +1 -0
- package/build-types/utils/get-px-from-css-unit.d.ts +10 -0
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -0
- package/build-types/utils/index.d.ts +3 -0
- package/build-types/utils/index.d.ts.map +1 -0
- package/build-types/utils/math.d.ts +61 -0
- package/build-types/utils/math.d.ts.map +1 -0
- package/build-types/utils/object.d.ts +39 -0
- package/build-types/utils/object.d.ts.map +1 -0
- package/build-types/utils/order-inserter-block-items.d.ts +13 -0
- package/build-types/utils/order-inserter-block-items.d.ts.map +1 -0
- package/build-types/utils/pasting.d.ts +28 -0
- package/build-types/utils/pasting.d.ts.map +1 -0
- package/build-types/utils/selection.d.ts +21 -0
- package/build-types/utils/selection.d.ts.map +1 -0
- package/build-types/utils/sorting.d.ts +17 -0
- package/build-types/utils/sorting.d.ts.map +1 -0
- package/build-types/utils/transform-styles/index.d.ts +15 -0
- package/build-types/utils/transform-styles/index.d.ts.map +1 -0
- package/build-types/utils/transform-styles/types.d.ts +13 -0
- package/build-types/utils/transform-styles/types.d.ts.map +1 -0
- package/build-types/utils/types.d.ts +28 -0
- package/build-types/utils/types.d.ts.map +1 -0
- package/package.json +40 -39
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -0
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -0
- package/src/components/block-editing-mode/index.js +17 -9
- package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -0
- package/src/components/block-inspector/index.js +43 -53
- package/src/components/block-rename/modal.js +0 -1
- package/src/components/block-toolbar/block-toolbar-icon.js +22 -6
- package/src/components/block-toolbar/test/block-toolbar-icon.js +99 -0
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +4 -0
- package/src/components/colors-gradients/control.js +29 -12
- package/src/components/colors-gradients/dropdown.js +4 -1
- package/src/components/colors-gradients/style.scss +39 -2
- package/src/components/contrast-checker/README.md +9 -0
- package/src/components/contrast-checker/index.js +42 -3
- package/src/components/date-format-picker/index.js +0 -1
- package/src/components/default-block-appender/content.scss +3 -0
- package/src/components/global-styles/background-panel.js +201 -34
- package/src/components/global-styles/color-gradient-dropdown-item.js +258 -0
- package/src/components/global-styles/color-panel.js +125 -487
- package/src/components/global-styles/dimensions-panel.js +0 -3
- package/src/components/global-styles/hooks.js +45 -0
- package/src/components/global-styles/test/background-panel.js +56 -0
- package/src/components/global-styles/test/color-panel.js +172 -118
- package/src/components/global-styles/test/typography-panel.js +167 -0
- package/src/components/global-styles/typography-panel.js +100 -11
- package/src/components/inspector-controls/README.md +0 -2
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +74 -28
- package/src/components/link-control/index.js +0 -1
- package/src/components/link-control/test/index.js +2 -3
- package/src/components/list-view/block-select-button.js +2 -17
- package/src/components/provider/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +2 -0
- package/src/components/url-popover/image-url-input-ui.js +0 -2
- package/src/components/use-block-display-information/index.js +15 -2
- package/src/components/use-block-display-information/test/index.js +140 -0
- package/src/components/use-resize-canvas/index.js +10 -71
- package/src/hooks/anchor.js +0 -1
- package/src/hooks/background.js +210 -133
- package/src/hooks/background.scss +0 -35
- package/src/hooks/color.js +2 -205
- package/src/hooks/color.scss +3 -9
- package/src/hooks/contrast-checker.js +60 -17
- package/src/hooks/custom-class-name.js +0 -1
- package/src/hooks/elements.js +140 -0
- package/src/hooks/elements.scss +8 -0
- package/src/hooks/grid-visualizer.js +59 -45
- package/src/hooks/layout-child.js +51 -12
- package/src/hooks/layout.js +6 -3
- package/src/hooks/states.js +32 -28
- package/src/hooks/style.js +11 -7
- package/src/hooks/test/background.js +59 -0
- package/src/hooks/test/block-style-state.js +14 -14
- package/src/hooks/test/layout.js +6 -6
- package/src/hooks/test/style.js +8 -8
- package/src/hooks/typography.js +70 -6
- package/src/layouts/flex.js +118 -15
- package/src/private-apis.js +0 -2
- package/src/store/private-actions.js +31 -0
- package/src/store/private-keys.js +0 -1
- package/src/store/private-selectors.js +43 -7
- package/src/store/reducer.js +37 -2
- package/src/store/test/private-selectors.js +39 -14
- package/src/store/test/reducer.js +91 -12
- package/src/style.scss +1 -0
- package/src/utils/block-bindings.ts +51 -0
- package/src/utils/color-values.ts +63 -0
- package/src/utils/{dom.js → dom.ts} +27 -27
- package/src/utils/{fit-text-frontend.js → fit-text-frontend.ts} +12 -4
- package/src/utils/{fit-text-utils.js → fit-text-utils.ts} +15 -7
- package/src/utils/{format-font-style.js → format-font-style.ts} +10 -3
- package/src/utils/{format-font-weight.js → format-font-weight.ts} +10 -3
- package/src/utils/{get-editor-region.js → get-editor-region.ts} +10 -6
- package/src/utils/{get-font-styles-and-weights.js → get-font-styles-and-weights.ts} +21 -17
- package/src/utils/{math.js → math.ts} +37 -30
- package/src/utils/object.ts +89 -0
- package/src/utils/{order-inserter-block-items.js → order-inserter-block-items.ts} +8 -5
- package/src/utils/{pasting.js → pasting.ts} +18 -11
- package/src/utils/{selection.js → selection.ts} +11 -4
- package/src/utils/sorting.ts +81 -0
- package/src/utils/test/color-values.js +44 -1
- package/src/utils/transform-styles/{index.js → index.ts} +25 -25
- package/src/utils/transform-styles/postcss-urlrebase.d.ts +15 -0
- package/src/utils/transform-styles/types.ts +13 -0
- package/src/utils/types.ts +29 -0
- package/src/components/use-resize-canvas/README.md +0 -37
- package/src/utils/block-bindings.js +0 -46
- package/src/utils/color-values.js +0 -28
- package/src/utils/object.js +0 -67
- package/src/utils/sorting.js +0 -54
- /package/src/utils/{get-px-from-css-unit.js → get-px-from-css-unit.ts} +0 -0
- /package/src/utils/{index.js → index.ts} +0 -0
|
@@ -68,14 +68,23 @@ $swatch-gap: 12px;
|
|
|
68
68
|
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
// Space the in-popover contrast notice away from the color palette below it.
|
|
72
|
+
.block-editor-panel-color-gradient-settings__contrast-notice {
|
|
73
|
+
margin-bottom: $grid-unit-20;
|
|
74
|
+
}
|
|
75
|
+
|
|
71
76
|
/**
|
|
72
77
|
* The following styles replicate the separated border of the
|
|
73
78
|
* `ItemGroup` component but allows for hidden items. This is because
|
|
74
79
|
* to maintain the order of `ToolsPanel` controls, each `ToolsPanelItem`
|
|
75
80
|
* must at least render a placeholder which would otherwise interfere
|
|
76
81
|
* with the `:last-child` styles.
|
|
82
|
+
*
|
|
83
|
+
* Applied via the shared `block-editor-color-gradient-item` class on
|
|
84
|
+
* color/gradient dropdown items across the Color, Background, and
|
|
85
|
+
* Typography panels.
|
|
77
86
|
*/
|
|
78
|
-
.block-editor-
|
|
87
|
+
.block-editor-color-gradient-item {
|
|
79
88
|
padding: 0;
|
|
80
89
|
max-width: 100%;
|
|
81
90
|
position: relative;
|
|
@@ -87,7 +96,6 @@ $swatch-gap: 12px;
|
|
|
87
96
|
|
|
88
97
|
// Identify the first visible instance as placeholder items will not have this class.
|
|
89
98
|
&:nth-child(1 of &) {
|
|
90
|
-
margin-top: $grid-unit-30;
|
|
91
99
|
border-top-left-radius: $radius-small;
|
|
92
100
|
border-top-right-radius: $radius-small;
|
|
93
101
|
border-top: 1px solid $gray-300;
|
|
@@ -127,6 +135,12 @@ $swatch-gap: 12px;
|
|
|
127
135
|
text-overflow: ellipsis;
|
|
128
136
|
max-width: calc(100% - ($button-size-next-default-40px + $grid-unit-05));
|
|
129
137
|
}
|
|
138
|
+
|
|
139
|
+
// Reserve extra space for the always-visible contrast warning icon,
|
|
140
|
+
// which sits alongside the hover-revealed reset button.
|
|
141
|
+
> button.has-contrast-warning .block-editor-panel-color-gradient-settings__color-name {
|
|
142
|
+
max-width: calc(100% - ($button-size-next-default-40px + $button-size-small + $grid-unit));
|
|
143
|
+
}
|
|
130
144
|
}
|
|
131
145
|
|
|
132
146
|
.block-editor-panel-color-gradient-settings__dropdown {
|
|
@@ -161,4 +175,27 @@ $swatch-gap: 12px;
|
|
|
161
175
|
// Show reset button on devices that do not support hover.
|
|
162
176
|
opacity: 1;
|
|
163
177
|
}
|
|
178
|
+
|
|
179
|
+
// While a contrast warning is in effect the warning icon occupies the
|
|
180
|
+
// far-right slot, so the reset button shifts left to sit beside it.
|
|
181
|
+
.block-editor-panel-color-gradient-settings__dropdown.has-contrast-warning + & {
|
|
182
|
+
right: $button-size-small + $grid-unit-05;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Icon-only "Low contrast" warning shown to the right of the color
|
|
187
|
+
// control toggle whenever the selection has insufficient contrast.
|
|
188
|
+
// Unlike the reset button it stays visible without hover. It is not a
|
|
189
|
+
// menu; activating it opens the color picker popover (where the full
|
|
190
|
+
// warning notice lives), so it doubles as a shortcut to the fix. The
|
|
191
|
+
// accessible name and hover/focus tooltip come from the button label.
|
|
192
|
+
.block-editor-panel-color-gradient-settings__contrast-warning {
|
|
193
|
+
position: absolute;
|
|
194
|
+
right: 0;
|
|
195
|
+
top: $grid-unit;
|
|
196
|
+
margin: auto $grid-unit auto;
|
|
197
|
+
|
|
198
|
+
&.block-editor-panel-color-gradient-settings__contrast-warning {
|
|
199
|
+
border-radius: $radius-small;
|
|
200
|
+
}
|
|
164
201
|
}
|
|
@@ -69,3 +69,12 @@ The text color to check the contrast of the background against.
|
|
|
69
69
|
|
|
70
70
|
- Type: `String`
|
|
71
71
|
- Required: No
|
|
72
|
+
|
|
73
|
+
#### messageOverride
|
|
74
|
+
|
|
75
|
+
Custom warning message to display (and announce) instead of the default
|
|
76
|
+
contrast guidance when the color combination has insufficient contrast. Useful
|
|
77
|
+
for providing panel-specific, more concise copy.
|
|
78
|
+
|
|
79
|
+
- Type: `String`
|
|
80
|
+
- Required: No
|
|
@@ -14,7 +14,28 @@ import { speak } from '@wordpress/a11y';
|
|
|
14
14
|
|
|
15
15
|
extend( [ namesPlugin, a11yPlugin ] );
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Computes a contrast warning for the given color combination, if any.
|
|
19
|
+
*
|
|
20
|
+
* Shared between the `ContrastChecker` component and the block inspector
|
|
21
|
+
* contrast warning indicators, which surface the result without rendering
|
|
22
|
+
* a notice.
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} props
|
|
25
|
+
* @param {string} [props.backgroundColor] Background color.
|
|
26
|
+
* @param {string} [props.fallbackBackgroundColor] Fallback background color.
|
|
27
|
+
* @param {string} [props.fallbackTextColor] Fallback text color.
|
|
28
|
+
* @param {string} [props.fallbackLinkColor] Fallback link color.
|
|
29
|
+
* @param {number} [props.fontSize] Font size value in pixels.
|
|
30
|
+
* @param {boolean} [props.isLargeText] Whether the text is large.
|
|
31
|
+
* @param {string} [props.textColor] Text color.
|
|
32
|
+
* @param {string} [props.linkColor] Link color.
|
|
33
|
+
* @param {string} [props.messageOverride] Caller-provided copy used in place of the generic guidance.
|
|
34
|
+
* @param {boolean} [props.enableAlphaChecker] Whether to warn about transparent text.
|
|
35
|
+
*
|
|
36
|
+
* @return {?Object} `{ message, speakMessage }` when contrast is insufficient, otherwise `null`.
|
|
37
|
+
*/
|
|
38
|
+
export function getContrastWarning( {
|
|
18
39
|
backgroundColor,
|
|
19
40
|
fallbackBackgroundColor,
|
|
20
41
|
fallbackTextColor,
|
|
@@ -23,6 +44,7 @@ function ContrastChecker( {
|
|
|
23
44
|
isLargeText,
|
|
24
45
|
textColor,
|
|
25
46
|
linkColor,
|
|
47
|
+
messageOverride,
|
|
26
48
|
enableAlphaChecker = false,
|
|
27
49
|
} ) {
|
|
28
50
|
const currentBackgroundColor = backgroundColor || fallbackBackgroundColor;
|
|
@@ -81,6 +103,13 @@ function ContrastChecker( {
|
|
|
81
103
|
if ( backgroundColorHasTransparency || textHasTransparency ) {
|
|
82
104
|
continue;
|
|
83
105
|
}
|
|
106
|
+
// A caller can provide panel-specific copy that is clearer and
|
|
107
|
+
// more concise than the generic brighter/darker guidance.
|
|
108
|
+
if ( messageOverride ) {
|
|
109
|
+
message = messageOverride;
|
|
110
|
+
speakMessage = messageOverride;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
84
113
|
message =
|
|
85
114
|
backgroundColorBrightness < colordTextColor.brightness()
|
|
86
115
|
? sprintf(
|
|
@@ -119,11 +148,21 @@ function ContrastChecker( {
|
|
|
119
148
|
return null;
|
|
120
149
|
}
|
|
121
150
|
|
|
151
|
+
return { message, speakMessage };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function ContrastChecker( props ) {
|
|
155
|
+
const warning = getContrastWarning( props );
|
|
156
|
+
|
|
157
|
+
if ( ! warning ) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
122
161
|
// Note: The `Notice` component can speak messages via its `spokenMessage`
|
|
123
162
|
// prop, but the contrast checker requires granular control over when the
|
|
124
163
|
// announcements are made. Notably, the message will be re-announced if a
|
|
125
164
|
// new color combination is selected and the contrast is still insufficient.
|
|
126
|
-
speak( speakMessage );
|
|
165
|
+
speak( warning.speakMessage );
|
|
127
166
|
|
|
128
167
|
return (
|
|
129
168
|
<div className="block-editor-contrast-checker">
|
|
@@ -132,7 +171,7 @@ function ContrastChecker( {
|
|
|
132
171
|
status="warning"
|
|
133
172
|
isDismissible={ false }
|
|
134
173
|
>
|
|
135
|
-
{ message }
|
|
174
|
+
{ warning.message }
|
|
136
175
|
</Notice>
|
|
137
176
|
</div>
|
|
138
177
|
);
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
// Set the opacity of the initial block appender to the same as placeholder text in an empty Paragraph block.
|
|
31
31
|
opacity: 0.62;
|
|
32
32
|
|
|
33
|
+
// Reset the text shadow from the global styles.
|
|
34
|
+
text-shadow: none;
|
|
35
|
+
|
|
33
36
|
// The following prevents user agent styles from applying margins to the appender's inner paragraph.
|
|
34
37
|
// This in turn prevents layout shift due to layout styles removing margins from first and last children.
|
|
35
38
|
margin-block-start: 0;
|
|
@@ -7,19 +7,24 @@ import {
|
|
|
7
7
|
} from '@wordpress/components';
|
|
8
8
|
import { useCallback } from '@wordpress/element';
|
|
9
9
|
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { getValueFromVariable } from '@wordpress/global-styles-engine';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Internal dependencies
|
|
14
13
|
*/
|
|
15
14
|
import BackgroundImageControl from '../background-image-control';
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
15
|
+
import ColorGradientDropdownItem from './color-gradient-dropdown-item';
|
|
16
|
+
import { useHasBackgroundColorPanel } from './color-panel';
|
|
17
|
+
import { useColorGradientSettings } from './hooks';
|
|
18
18
|
import { useToolsPanelDropdownMenuProps } from './utils';
|
|
19
19
|
import { setImmutably } from '../../utils/object';
|
|
20
|
+
import {
|
|
21
|
+
extractPresetSlug,
|
|
22
|
+
encodeColorValueWithPalette,
|
|
23
|
+
} from '../../utils/color-values';
|
|
20
24
|
|
|
21
25
|
const DEFAULT_CONTROLS = {
|
|
22
26
|
backgroundImage: true,
|
|
27
|
+
backgroundColor: true,
|
|
23
28
|
gradient: true,
|
|
24
29
|
};
|
|
25
30
|
|
|
@@ -39,12 +44,17 @@ export function useHasBackgroundControl( settings, feature ) {
|
|
|
39
44
|
* `settings.background.backgroundSize` exists also,
|
|
40
45
|
* but can only be used if settings?.background?.backgroundImage is `true`.
|
|
41
46
|
*
|
|
47
|
+
* The panel is also shown when the block has color panel background
|
|
48
|
+
* support (`settings.color.background`), because background color and
|
|
49
|
+
* the legacy `color.gradient` control are rendered here.
|
|
50
|
+
*
|
|
42
51
|
* @param {Object} settings Site settings
|
|
43
52
|
* @return {boolean} Whether site settings has activated background panel.
|
|
44
53
|
*/
|
|
45
54
|
export function useHasBackgroundPanel( settings ) {
|
|
55
|
+
const hasBackgroundColor = useHasBackgroundColorPanel( settings );
|
|
46
56
|
const { backgroundImage, gradient } = settings?.background || {};
|
|
47
|
-
return backgroundImage || gradient;
|
|
57
|
+
return backgroundImage || gradient || hasBackgroundColor;
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
/**
|
|
@@ -92,7 +102,30 @@ export function hasBackgroundGradientValue( style ) {
|
|
|
92
102
|
);
|
|
93
103
|
}
|
|
94
104
|
|
|
95
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Checks if there is a current value for the background color (written to
|
|
107
|
+
* `color.background`).
|
|
108
|
+
*
|
|
109
|
+
* @param {Object} style Style attribute.
|
|
110
|
+
* @return {boolean} Whether the block has a background color value set.
|
|
111
|
+
*/
|
|
112
|
+
export function hasBackgroundColorValue( style ) {
|
|
113
|
+
return !! style?.color?.background;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Checks if there is a current value in the legacy `color.gradient` location
|
|
118
|
+
* (used by blocks with color panel gradient support that haven't adopted the
|
|
119
|
+
* `background.gradient` block support).
|
|
120
|
+
*
|
|
121
|
+
* @param {Object} style Style attribute.
|
|
122
|
+
* @return {boolean} Whether the block has a legacy color gradient value set.
|
|
123
|
+
*/
|
|
124
|
+
export function hasLegacyColorGradientValue( style ) {
|
|
125
|
+
return !! style?.color?.gradient;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function BackgroundToolsPanel( {
|
|
96
129
|
resetAllFilter,
|
|
97
130
|
onChange,
|
|
98
131
|
value,
|
|
@@ -128,23 +161,46 @@ export default function BackgroundImagePanel( {
|
|
|
128
161
|
as: Wrapper = BackgroundToolsPanel,
|
|
129
162
|
value,
|
|
130
163
|
onChange,
|
|
131
|
-
inheritedValue,
|
|
164
|
+
inheritedValue = value,
|
|
132
165
|
settings,
|
|
133
166
|
panelId,
|
|
134
167
|
defaultControls = DEFAULT_CONTROLS,
|
|
135
168
|
defaultValues = {},
|
|
136
169
|
headerLabel = __( 'Background' ),
|
|
170
|
+
contrastWarning,
|
|
137
171
|
} ) {
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
172
|
+
const {
|
|
173
|
+
colors,
|
|
174
|
+
gradients,
|
|
175
|
+
allColors,
|
|
176
|
+
areCustomSolidsEnabled,
|
|
177
|
+
areCustomGradientsEnabled,
|
|
178
|
+
hasSolidColors,
|
|
179
|
+
hasGradientColors,
|
|
180
|
+
decodeValue,
|
|
181
|
+
encodeGradientValue,
|
|
182
|
+
} = useColorGradientSettings( settings );
|
|
141
183
|
|
|
142
184
|
const hasBackgroundGradientControl = useHasBackgroundControl(
|
|
143
185
|
settings,
|
|
144
186
|
'gradient'
|
|
145
187
|
);
|
|
188
|
+
const hasColorPanelBackgroundSupport =
|
|
189
|
+
useHasBackgroundColorPanel( settings );
|
|
190
|
+
const showBackgroundColorControl =
|
|
191
|
+
hasColorPanelBackgroundSupport && hasSolidColors;
|
|
192
|
+
// New `background.gradient` block support — gradient lives under the
|
|
193
|
+
// `background` style path.
|
|
146
194
|
const showBackgroundGradientControl =
|
|
147
195
|
hasGradientColors && hasBackgroundGradientControl;
|
|
196
|
+
// Legacy `color.gradient` path — only rendered when the block has
|
|
197
|
+
// color panel background support and hasn't adopted the newer
|
|
198
|
+
// `background.gradient` support. Keeps the UI consistent for blocks
|
|
199
|
+
// that still write gradients to `color.gradient`.
|
|
200
|
+
const showLegacyColorGradientControl =
|
|
201
|
+
hasColorPanelBackgroundSupport &&
|
|
202
|
+
hasGradientColors &&
|
|
203
|
+
! hasBackgroundGradientControl;
|
|
148
204
|
const showBackgroundImageControl = useHasBackgroundControl(
|
|
149
205
|
settings,
|
|
150
206
|
'backgroundImage'
|
|
@@ -152,38 +208,38 @@ export default function BackgroundImagePanel( {
|
|
|
152
208
|
|
|
153
209
|
const resetAllFilter = useCallback(
|
|
154
210
|
( previousValue ) => {
|
|
211
|
+
const clearsColorBackground = showBackgroundColorControl;
|
|
212
|
+
const clearsColorGradient =
|
|
213
|
+
hasBackgroundGradientControl || showLegacyColorGradientControl;
|
|
214
|
+
if ( ! clearsColorBackground && ! clearsColorGradient ) {
|
|
215
|
+
return { ...previousValue, background: {} };
|
|
216
|
+
}
|
|
155
217
|
return {
|
|
156
218
|
...previousValue,
|
|
157
219
|
background: {},
|
|
158
|
-
color:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
: previousValue?.color,
|
|
220
|
+
color: {
|
|
221
|
+
...previousValue?.color,
|
|
222
|
+
...( clearsColorBackground && { background: undefined } ),
|
|
223
|
+
...( clearsColorGradient && { gradient: undefined } ),
|
|
224
|
+
},
|
|
164
225
|
};
|
|
165
226
|
},
|
|
166
|
-
[
|
|
227
|
+
[
|
|
228
|
+
hasBackgroundGradientControl,
|
|
229
|
+
showBackgroundColorControl,
|
|
230
|
+
showLegacyColorGradientControl,
|
|
231
|
+
]
|
|
167
232
|
);
|
|
168
233
|
|
|
169
|
-
if (
|
|
234
|
+
if (
|
|
235
|
+
! showBackgroundImageControl &&
|
|
236
|
+
! showBackgroundColorControl &&
|
|
237
|
+
! showBackgroundGradientControl &&
|
|
238
|
+
! showLegacyColorGradientControl
|
|
239
|
+
) {
|
|
170
240
|
return null;
|
|
171
241
|
}
|
|
172
242
|
|
|
173
|
-
const decodeValue = ( rawValue ) =>
|
|
174
|
-
getValueFromVariable( { settings }, '', rawValue );
|
|
175
|
-
const encodeGradientValue = ( gradientValue ) => {
|
|
176
|
-
const allGradients = gradients.flatMap(
|
|
177
|
-
( { gradients: originGradients } ) => originGradients
|
|
178
|
-
);
|
|
179
|
-
const gradientObject = allGradients.find(
|
|
180
|
-
( { gradient } ) => gradient === gradientValue
|
|
181
|
-
);
|
|
182
|
-
return gradientObject
|
|
183
|
-
? 'var:preset|gradient|' + gradientObject.slug
|
|
184
|
-
: gradientValue;
|
|
185
|
-
};
|
|
186
|
-
|
|
187
243
|
const resetBackground = () =>
|
|
188
244
|
onChange(
|
|
189
245
|
setImmutably(
|
|
@@ -203,6 +259,50 @@ export default function BackgroundImagePanel( {
|
|
|
203
259
|
onChange( newValue );
|
|
204
260
|
};
|
|
205
261
|
|
|
262
|
+
// Background color (written to `color.background`).
|
|
263
|
+
const backgroundColor = decodeValue( inheritedValue?.color?.background );
|
|
264
|
+
const userBackgroundColor = decodeValue( value?.color?.background );
|
|
265
|
+
const setBackgroundColor = ( newColor, newSlug ) => {
|
|
266
|
+
const newValue = setImmutably(
|
|
267
|
+
value,
|
|
268
|
+
[ 'color', 'background' ],
|
|
269
|
+
encodeColorValueWithPalette( allColors, newColor, newSlug )
|
|
270
|
+
);
|
|
271
|
+
// Legacy `color.gradient` is mutually exclusive with
|
|
272
|
+
// `color.background`. `background.gradient` is independent and
|
|
273
|
+
// should not be touched.
|
|
274
|
+
if ( showLegacyColorGradientControl ) {
|
|
275
|
+
newValue.color.gradient = undefined;
|
|
276
|
+
}
|
|
277
|
+
onChange( newValue );
|
|
278
|
+
};
|
|
279
|
+
const resetBackgroundColor = () => {
|
|
280
|
+
const newValue = setImmutably(
|
|
281
|
+
value,
|
|
282
|
+
[ 'color', 'background' ],
|
|
283
|
+
undefined
|
|
284
|
+
);
|
|
285
|
+
if ( showLegacyColorGradientControl ) {
|
|
286
|
+
newValue.color.gradient = undefined;
|
|
287
|
+
}
|
|
288
|
+
onChange( newValue );
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// Legacy `color.gradient` setters.
|
|
292
|
+
const legacyColorGradient = decodeValue( inheritedValue?.color?.gradient );
|
|
293
|
+
const userLegacyColorGradient = decodeValue( value?.color?.gradient );
|
|
294
|
+
const setLegacyColorGradient = ( newGradient ) => {
|
|
295
|
+
const newValue = setImmutably(
|
|
296
|
+
value,
|
|
297
|
+
[ 'color', 'gradient' ],
|
|
298
|
+
encodeGradientValue( newGradient )
|
|
299
|
+
);
|
|
300
|
+
newValue.color.background = undefined;
|
|
301
|
+
onChange( newValue );
|
|
302
|
+
};
|
|
303
|
+
const resetLegacyColorGradient = () =>
|
|
304
|
+
onChange( setImmutably( value, [ 'color', 'gradient' ], undefined ) );
|
|
305
|
+
|
|
206
306
|
// Get current gradient value, decoding preset slug references.
|
|
207
307
|
// Fall back to color.gradient for legacy blocks that haven't migrated
|
|
208
308
|
// to background.gradient yet (mirrors block inspector fallback in
|
|
@@ -237,7 +337,7 @@ export default function BackgroundImagePanel( {
|
|
|
237
337
|
>
|
|
238
338
|
{ showBackgroundImageControl && (
|
|
239
339
|
<ToolsPanelItem
|
|
240
|
-
className="block-editor-
|
|
340
|
+
className="block-editor-color-gradient-item"
|
|
241
341
|
hasValue={ () => hasBackgroundImageValue( value ) }
|
|
242
342
|
label={ __( 'Image' ) }
|
|
243
343
|
onDeselect={ resetBackground }
|
|
@@ -254,9 +354,49 @@ export default function BackgroundImagePanel( {
|
|
|
254
354
|
/>
|
|
255
355
|
</ToolsPanelItem>
|
|
256
356
|
) }
|
|
357
|
+
{ showBackgroundColorControl && (
|
|
358
|
+
<ColorGradientDropdownItem
|
|
359
|
+
label={ __( 'Color' ) }
|
|
360
|
+
hasValue={ () => hasBackgroundColorValue( value ) }
|
|
361
|
+
resetValue={ resetBackgroundColor }
|
|
362
|
+
isShownByDefault={ defaultControls.backgroundColor }
|
|
363
|
+
indicators={ [ userBackgroundColor ?? backgroundColor ] }
|
|
364
|
+
contrastWarning={ contrastWarning }
|
|
365
|
+
tabs={ [
|
|
366
|
+
{
|
|
367
|
+
key: 'background',
|
|
368
|
+
label: __( 'Color' ),
|
|
369
|
+
inheritedValue:
|
|
370
|
+
userBackgroundColor ?? backgroundColor,
|
|
371
|
+
// Resolve the slug from the same source as the
|
|
372
|
+
// displayed value (user value first, then the
|
|
373
|
+
// inherited fallback). For a block instance the
|
|
374
|
+
// selection lives in `value` while `inheritedValue`
|
|
375
|
+
// only holds the global styles fallback, so reading
|
|
376
|
+
// the slug from `inheritedValue` alone would miss it
|
|
377
|
+
// and two same-hex presets would both appear selected.
|
|
378
|
+
inheritedSlug:
|
|
379
|
+
extractPresetSlug(
|
|
380
|
+
value?.color?.background,
|
|
381
|
+
'color'
|
|
382
|
+
) ??
|
|
383
|
+
extractPresetSlug(
|
|
384
|
+
inheritedValue?.color?.background,
|
|
385
|
+
'color'
|
|
386
|
+
),
|
|
387
|
+
setValue: setBackgroundColor,
|
|
388
|
+
userValue: userBackgroundColor,
|
|
389
|
+
},
|
|
390
|
+
] }
|
|
391
|
+
colorGradientControlSettings={ {
|
|
392
|
+
colors,
|
|
393
|
+
disableCustomColors: ! areCustomSolidsEnabled,
|
|
394
|
+
} }
|
|
395
|
+
panelId={ panelId }
|
|
396
|
+
/>
|
|
397
|
+
) }
|
|
257
398
|
{ showBackgroundGradientControl && (
|
|
258
|
-
<
|
|
259
|
-
className="block-editor-background-panel__item"
|
|
399
|
+
<ColorGradientDropdownItem
|
|
260
400
|
label={ __( 'Gradient' ) }
|
|
261
401
|
hasValue={ () => hasBackgroundGradientValue( value ) }
|
|
262
402
|
resetValue={ resetGradient }
|
|
@@ -280,6 +420,33 @@ export default function BackgroundImagePanel( {
|
|
|
280
420
|
panelId={ panelId }
|
|
281
421
|
/>
|
|
282
422
|
) }
|
|
423
|
+
{ showLegacyColorGradientControl && (
|
|
424
|
+
<ColorGradientDropdownItem
|
|
425
|
+
label={ __( 'Gradient' ) }
|
|
426
|
+
hasValue={ () => hasLegacyColorGradientValue( value ) }
|
|
427
|
+
resetValue={ resetLegacyColorGradient }
|
|
428
|
+
isShownByDefault={ defaultControls.gradient }
|
|
429
|
+
indicators={ [
|
|
430
|
+
userLegacyColorGradient ?? legacyColorGradient,
|
|
431
|
+
] }
|
|
432
|
+
tabs={ [
|
|
433
|
+
{
|
|
434
|
+
key: 'gradient',
|
|
435
|
+
label: __( 'Gradient' ),
|
|
436
|
+
inheritedValue:
|
|
437
|
+
userLegacyColorGradient ?? legacyColorGradient,
|
|
438
|
+
setValue: setLegacyColorGradient,
|
|
439
|
+
userValue: userLegacyColorGradient,
|
|
440
|
+
isGradient: true,
|
|
441
|
+
},
|
|
442
|
+
] }
|
|
443
|
+
colorGradientControlSettings={ {
|
|
444
|
+
gradients,
|
|
445
|
+
disableCustomGradients: ! areCustomGradientsEnabled,
|
|
446
|
+
} }
|
|
447
|
+
panelId={ panelId }
|
|
448
|
+
/>
|
|
449
|
+
) }
|
|
283
450
|
</Wrapper>
|
|
284
451
|
);
|
|
285
452
|
}
|