@wordpress/block-editor 16.2.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/build/components/block-inspector/index.cjs +9 -6
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-keyboard-shortcuts/index.cjs +201 -0
- package/build/components/block-keyboard-shortcuts/index.cjs.map +7 -0
- package/build/components/block-list/block.cjs +10 -3
- package/build/components/block-list/block.cjs.map +2 -2
- package/build/components/block-list/index.cjs +6 -1
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs +4 -0
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs +6 -7
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
- package/build/components/block-parent-selector/index.cjs +98 -29
- package/build/components/block-parent-selector/index.cjs.map +3 -3
- package/build/components/block-popover/inbetween.cjs +2 -2
- package/build/components/block-popover/inbetween.cjs.map +2 -2
- package/build/components/block-preview/index.cjs +0 -4
- package/build/components/block-preview/index.cjs.map +2 -2
- package/build/components/block-styles/index.cjs +77 -33
- package/build/components/block-styles/index.cjs.map +3 -3
- package/build/components/block-visibility/constants.cjs.map +2 -2
- package/build/components/child-layout-control/index.cjs.map +2 -2
- package/build/components/colors/with-colors.cjs +55 -71
- package/build/components/colors/with-colors.cjs.map +2 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs +4 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +2 -2
- package/build/components/dimensions-tool/index.cjs +18 -16
- package/build/components/dimensions-tool/index.cjs.map +2 -2
- package/build/components/dimensions-tool/utils.cjs +61 -0
- package/build/components/dimensions-tool/utils.cjs.map +7 -0
- package/build/components/duotone-control/index.cjs +2 -0
- package/build/components/duotone-control/index.cjs.map +2 -2
- package/build/components/global-styles/advanced-panel.cjs.map +3 -3
- package/build/components/global-styles/border-panel.cjs +2 -5
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/color-panel.cjs +14 -2
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +9 -5
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/filters-panel.cjs +12 -8
- package/build/components/global-styles/filters-panel.cjs.map +2 -2
- package/build/components/global-styles/shadow-panel-components.cjs +16 -11
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/global-styles/utils.cjs +9 -0
- package/build/components/global-styles/utils.cjs.map +2 -2
- package/build/components/inner-blocks/index.cjs +5 -3
- package/build/components/inner-blocks/index.cjs.map +2 -2
- package/build/components/inserter/block-patterns-explorer/index.cjs +39 -22
- package/build/components/inserter/block-patterns-explorer/index.cjs.map +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.cjs +21 -55
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.cjs.map +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.cjs +19 -44
- package/build/components/inserter/block-patterns-explorer/pattern-list.cjs.map +3 -3
- package/build/components/inserter/hooks/use-insertion-point.cjs +4 -4
- package/build/components/inserter/hooks/use-insertion-point.cjs.map +2 -2
- package/build/components/inserter/menu.cjs +18 -7
- package/build/components/inserter/menu.cjs.map +2 -2
- package/build/components/inserter/quick-inserter.cjs +30 -27
- package/build/components/inserter/quick-inserter.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/list-view/index.cjs +31 -5
- package/build/components/list-view/index.cjs.map +3 -3
- package/build/components/list-view/utils.cjs +13 -1
- package/build/components/list-view/utils.cjs.map +2 -2
- package/build/components/media-placeholder/index.cjs +1 -1
- package/build/components/media-placeholder/index.cjs.map +3 -3
- package/build/components/provider/index.cjs +5 -1
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/publish-date-time-picker/index.cjs +3 -2
- package/build/components/publish-date-time-picker/index.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/enter.cjs +46 -39
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +7 -5
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/rich-text/multiline.cjs +105 -70
- package/build/components/rich-text/multiline.cjs.map +3 -3
- package/build/components/url-input/index.cjs.map +2 -2
- package/build/components/writing-flow/use-input.cjs +65 -13
- package/build/components/writing-flow/use-input.cjs.map +3 -3
- package/build/hooks/border.cjs +25 -3
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +9 -2
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/duotone.cjs +4 -3
- package/build/hooks/duotone.cjs.map +2 -2
- package/build/hooks/gap.cjs +8 -2
- package/build/hooks/gap.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +35 -13
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/layout.cjs +23 -1
- package/build/hooks/layout.cjs.map +2 -2
- package/build/hooks/states.cjs +7 -4
- package/build/hooks/states.cjs.map +2 -2
- package/build/layouts/constrained.cjs +8 -1
- package/build/layouts/constrained.cjs.map +2 -2
- package/build/layouts/flex.cjs +9 -0
- package/build/layouts/flex.cjs.map +2 -2
- package/build/layouts/flow.cjs +4 -1
- package/build/layouts/flow.cjs.map +2 -2
- package/build/layouts/grid.cjs +5 -1
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +3 -1
- package/build/private-apis.cjs.map +2 -2
- package/build/store/actions.cjs +1 -1
- package/build/store/actions.cjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +9 -6
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-keyboard-shortcuts/index.mjs +173 -0
- package/build-module/components/block-keyboard-shortcuts/index.mjs.map +7 -0
- package/build-module/components/block-list/block.mjs +10 -3
- package/build-module/components/block-list/block.mjs.map +2 -2
- package/build-module/components/block-list/index.mjs +6 -1
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs +4 -0
- package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs +6 -7
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
- package/build-module/components/block-parent-selector/index.mjs +101 -32
- package/build-module/components/block-parent-selector/index.mjs.map +2 -2
- package/build-module/components/block-popover/inbetween.mjs +2 -2
- package/build-module/components/block-popover/inbetween.mjs.map +2 -2
- package/build-module/components/block-preview/index.mjs +0 -4
- package/build-module/components/block-preview/index.mjs.map +2 -2
- package/build-module/components/block-styles/index.mjs +79 -35
- package/build-module/components/block-styles/index.mjs.map +2 -2
- package/build-module/components/block-visibility/constants.mjs.map +2 -2
- package/build-module/components/child-layout-control/index.mjs +5 -5
- package/build-module/components/child-layout-control/index.mjs.map +1 -1
- package/build-module/components/colors/with-colors.mjs +56 -72
- package/build-module/components/colors/with-colors.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +4 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/dimensions-tool/index.mjs +19 -17
- package/build-module/components/dimensions-tool/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/utils.mjs +35 -0
- package/build-module/components/dimensions-tool/utils.mjs.map +7 -0
- package/build-module/components/duotone-control/index.mjs +2 -0
- package/build-module/components/duotone-control/index.mjs.map +2 -2
- package/build-module/components/global-styles/advanced-panel.mjs +5 -2
- package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +2 -5
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs +14 -2
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +9 -5
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +16 -9
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/shadow-panel-components.mjs +16 -11
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/global-styles/utils.mjs +8 -0
- package/build-module/components/global-styles/utils.mjs.map +2 -2
- package/build-module/components/inner-blocks/index.mjs +5 -3
- package/build-module/components/inner-blocks/index.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-explorer/index.mjs +39 -22
- package/build-module/components/inserter/block-patterns-explorer/index.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.mjs +22 -56
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.mjs +20 -45
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-insertion-point.mjs +4 -4
- package/build-module/components/inserter/hooks/use-insertion-point.mjs.map +2 -2
- package/build-module/components/inserter/menu.mjs +19 -8
- package/build-module/components/inserter/menu.mjs.map +2 -2
- package/build-module/components/inserter/quick-inserter.mjs +30 -27
- package/build-module/components/inserter/quick-inserter.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/list-view/index.mjs +32 -5
- package/build-module/components/list-view/index.mjs.map +3 -3
- package/build-module/components/list-view/utils.mjs +13 -1
- package/build-module/components/list-view/utils.mjs.map +2 -2
- package/build-module/components/media-placeholder/index.mjs +3 -3
- package/build-module/components/media-placeholder/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +6 -2
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/publish-date-time-picker/index.mjs +3 -2
- package/build-module/components/publish-date-time-picker/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +46 -39
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +7 -5
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/rich-text/multiline.mjs +112 -72
- package/build-module/components/rich-text/multiline.mjs.map +2 -2
- package/build-module/components/url-input/index.mjs +2 -2
- package/build-module/components/url-input/index.mjs.map +1 -1
- package/build-module/components/writing-flow/use-input.mjs +66 -14
- package/build-module/components/writing-flow/use-input.mjs.map +3 -3
- package/build-module/hooks/border.mjs +26 -8
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +9 -2
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/duotone.mjs +8 -4
- package/build-module/hooks/duotone.mjs.map +2 -2
- package/build-module/hooks/gap.mjs +6 -1
- package/build-module/hooks/gap.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +36 -13
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +22 -1
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/states.mjs +8 -5
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/layouts/constrained.mjs +8 -1
- package/build-module/layouts/constrained.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +9 -0
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/flow.mjs +4 -1
- package/build-module/layouts/flow.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +5 -1
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/private-apis.mjs +3 -1
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +1 -1
- package/build-module/store/actions.mjs.map +2 -2
- package/build-style/style-rtl.css +108 -71
- package/build-style/style.css +108 -71
- package/build-types/components/block-visibility/constants.d.ts +4 -3
- package/build-types/components/block-visibility/constants.d.ts.map +1 -1
- package/package.json +43 -43
- package/src/components/background-image-control/README.md +122 -0
- package/src/components/block-edit-visually-button/README.md +39 -0
- package/src/components/block-editing-mode/README.md +72 -0
- package/src/components/block-inspector/index.js +6 -6
- package/src/components/block-keyboard-shortcuts/index.js +256 -0
- package/src/components/block-list/block.js +7 -0
- package/src/components/block-list/index.js +7 -1
- package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -0
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +6 -8
- package/src/components/block-parent-selector/index.js +111 -30
- package/src/components/block-popover/README.md +10 -3
- package/src/components/block-popover/inbetween.js +8 -2
- package/src/components/block-popover/stories/index.story.jsx +143 -0
- package/src/components/block-preview/index.js +0 -2
- package/src/components/block-styles/index.js +95 -43
- package/src/components/block-styles/style.scss +5 -34
- package/src/components/block-tools/style.scss +94 -0
- package/src/components/block-visibility/constants.ts +4 -3
- package/src/components/child-layout-control/index.js +5 -5
- package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -29
- package/src/components/colors/test/with-colors.js +6 -7
- package/src/components/colors/with-colors.js +79 -105
- package/src/components/dimensions-tool/aspect-ratio-tool.js +16 -4
- package/src/components/dimensions-tool/index.js +34 -22
- package/src/components/dimensions-tool/test/index.js +166 -2
- package/src/components/dimensions-tool/test/utils.js +51 -0
- package/src/components/dimensions-tool/utils.js +67 -0
- package/src/components/duotone-control/index.js +2 -0
- package/src/components/duotone-control/test/index.js +100 -0
- package/src/components/global-styles/advanced-panel.js +5 -2
- package/src/components/global-styles/border-panel.js +11 -9
- package/src/components/global-styles/color-panel.js +13 -1
- package/src/components/global-styles/dimensions-panel.js +17 -5
- package/src/components/global-styles/filters-panel.js +24 -10
- package/src/components/global-styles/shadow-panel-components.js +38 -11
- package/src/components/global-styles/test/border-panel.js +230 -0
- package/src/components/global-styles/test/color-panel.js +24 -0
- package/src/components/global-styles/test/dimensions-panel.js +98 -7
- package/src/components/global-styles/test/filters-panel.js +84 -0
- package/src/components/global-styles/test/utils.js +30 -0
- package/src/components/global-styles/utils.js +23 -0
- package/src/components/inner-blocks/index.js +11 -2
- package/src/components/inner-blocks/stories/index.story.jsx +246 -0
- package/src/components/inserter/block-patterns-explorer/index.js +24 -11
- package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +18 -56
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +22 -47
- package/src/components/inserter/hooks/use-insertion-point.js +9 -4
- package/src/components/inserter/menu.js +23 -10
- package/src/components/inserter/quick-inserter.js +15 -13
- package/src/components/inserter/style.scss +44 -62
- package/src/components/inspector-controls-tabs/README.md +92 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +1 -1
- package/src/components/link-control/test/index.js +5 -0
- package/src/components/list-view/index.js +50 -7
- package/src/components/list-view/utils.js +16 -1
- package/src/components/media-placeholder/index.js +9 -4
- package/src/components/plain-text/stories/index.story.jsx +3 -0
- package/src/components/provider/index.js +7 -1
- package/src/components/publish-date-time-picker/README.md +10 -0
- package/src/components/publish-date-time-picker/index.js +17 -14
- package/src/components/rich-text/event-listeners/enter.js +58 -45
- package/src/components/rich-text/index.js +9 -4
- package/src/components/rich-text/multiline.js +126 -86
- package/src/components/url-input/index.js +2 -2
- package/src/components/url-input/test/fixtures/validated-input-control-deprecation.js +27 -0
- package/src/components/url-input/test/index.js +5 -0
- package/src/components/url-popover/README.md +7 -0
- package/src/components/url-popover/stories/index.story.jsx +133 -47
- package/src/components/writing-flow/use-input.js +105 -15
- package/src/hooks/border.js +27 -8
- package/src/hooks/dimensions.js +8 -1
- package/src/hooks/duotone.js +23 -7
- package/src/hooks/gap.js +16 -0
- package/src/hooks/layout-child.js +41 -9
- package/src/hooks/layout.js +117 -71
- package/src/hooks/states.js +8 -5
- package/src/hooks/test/gap.js +31 -1
- package/src/hooks/test/layout-child.js +60 -1
- package/src/hooks/test/layout.js +27 -0
- package/src/layouts/constrained.js +9 -1
- package/src/layouts/flex.js +15 -0
- package/src/layouts/flow.js +4 -1
- package/src/layouts/grid.js +9 -1
- package/src/layouts/test/constrained.js +26 -0
- package/src/layouts/test/flow.js +26 -0
- package/src/layouts/test/grid.js +46 -0
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +14 -1
- package/build/components/floating-toolbar/nav-up-icon.cjs +0 -52
- package/build/components/floating-toolbar/nav-up-icon.cjs.map +0 -7
- package/build/components/gradients/with-gradient.cjs +0 -36
- package/build/components/gradients/with-gradient.cjs.map +0 -7
- package/build/components/inserter-button/sparkles.cjs +0 -36
- package/build/components/inserter-button/sparkles.cjs.map +0 -7
- package/build-module/components/floating-toolbar/nav-up-icon.mjs +0 -31
- package/build-module/components/floating-toolbar/nav-up-icon.mjs.map +0 -7
- package/build-module/components/gradients/with-gradient.mjs +0 -11
- package/build-module/components/gradients/with-gradient.mjs.map +0 -7
- package/build-module/components/inserter-button/sparkles.mjs +0 -15
- package/build-module/components/inserter-button/sparkles.mjs.map +0 -7
- package/build-style/default-editor-styles-rtl.css +0 -68
- package/build-style/default-editor-styles.css +0 -68
- package/src/components/floating-toolbar/nav-up-icon.js +0 -22
- package/src/components/gradients/with-gradient.js +0 -9
- package/src/components/inserter-button/README.md +0 -62
- package/src/components/inserter-button/sparkles.js +0 -12
- package/src/default-editor-styles.scss +0 -25
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/global-styles/dimensions-panel.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\tBoxControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { Icon, alignNone, stretchWide } from '@wordpress/icons';\nimport { useCallback, useState } from '@wordpress/element';\nimport { getValueFromVariable } from '@wordpress/global-styles-engine';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport SpacingSizesControl from '../spacing-sizes-control';\nimport DimensionControl from '../dimension-control';\nimport ChildLayoutControl from '../child-layout-control';\nimport AspectRatioTool from '../dimensions-tool/aspect-ratio-tool';\nimport { cleanEmptyObject } from '../../hooks/utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\tDEFAULT_BLOCK_STYLE_STATE,\n\thasPseudoBlockStyleState,\n\thasViewportBlockStyleState,\n} from '../../hooks/block-style-state';\nimport {\n\tgetInheritanceProps,\n\tInheritanceToolsPanelItem,\n\tisGlobalStylesInheritanceEnabled,\n} from './inheritance';\n\nconst AXIAL_SIDES = [ 'horizontal', 'vertical' ];\n\n/**\n * Determines whether a spacing control (`BoxControl` or `SpacingSizesControl`)\n * renders its linked/unlink toggle button, which the local-override reset dot\n * offsets itself against.\n *\n * @param {string[]|undefined} sides Configurable sides for the control.\n * @param {boolean} isPresetsControl Whether the presets-based\n * `SpacingSizesControl` is used.\n *\n * @return {boolean} Whether the toggle button is rendered.\n */\nfunction hasSpacingToggle( sides, isPresetsControl ) {\n\tif ( sides?.length === 1 ) {\n\t\treturn false;\n\t}\n\tif ( isPresetsControl ) {\n\t\tconst hasOnlyAxialSides =\n\t\t\tsides?.includes( 'horizontal' ) &&\n\t\t\tsides?.includes( 'vertical' ) &&\n\t\t\tsides?.length === 2;\n\t\treturn ! hasOnlyAxialSides;\n\t}\n\treturn true;\n}\n\nexport function useHasDimensionsPanel(\n\tsettings,\n\tstyleState = DEFAULT_BLOCK_STYLE_STATE\n) {\n\treturn (\n\t\thasContentSize( settings ) ||\n\t\thasWideSize( settings ) ||\n\t\thasPadding( settings ) ||\n\t\thasMargin( settings ) ||\n\t\thasGap( settings ) ||\n\t\thasHeight( settings ) ||\n\t\thasMinHeight( settings ) ||\n\t\thasMinWidth( settings ) ||\n\t\thasWidth( settings ) ||\n\t\thasAspectRatio( settings, styleState ) ||\n\t\thasChildLayout( settings, styleState )\n\t);\n}\n\nfunction hasContentSize( settings ) {\n\treturn settings?.layout?.contentSize;\n}\n\nfunction hasWideSize( settings ) {\n\treturn settings?.layout?.wideSize;\n}\n\nfunction hasPadding( settings ) {\n\treturn settings?.spacing?.padding;\n}\n\nfunction hasMargin( settings ) {\n\treturn settings?.spacing?.margin;\n}\n\nfunction hasGap( settings ) {\n\treturn settings?.spacing?.blockGap;\n}\n\nfunction hasHeight( settings ) {\n\treturn settings?.dimensions?.height;\n}\n\nfunction hasMinHeight( settings ) {\n\treturn settings?.dimensions?.minHeight;\n}\n\nfunction hasMinWidth( settings ) {\n\treturn settings?.dimensions?.minWidth;\n}\n\nfunction hasWidth( settings ) {\n\treturn settings?.dimensions?.width;\n}\n\nfunction hasAspectRatio( settings, styleState = DEFAULT_BLOCK_STYLE_STATE ) {\n\treturn (\n\t\t! hasPseudoBlockStyleState( styleState ) &&\n\t\tsettings?.dimensions?.aspectRatio\n\t);\n}\n\nfunction hasChildLayout( settings, styleState = DEFAULT_BLOCK_STYLE_STATE ) {\n\tif ( hasPseudoBlockStyleState( styleState ) ) {\n\t\treturn false;\n\t}\n\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tdefault: { type: defaultParentLayoutType = 'default' } = {},\n\t\tallowSizingOnChildren = false,\n\t} = settings?.parentLayout ?? {};\n\n\tconst support =\n\t\t( defaultParentLayoutType === 'flex' ||\n\t\t\tparentLayoutType === 'flex' ||\n\t\t\tdefaultParentLayoutType === 'grid' ||\n\t\t\tparentLayoutType === 'grid' ) &&\n\t\tallowSizingOnChildren;\n\treturn !! settings?.layout && support;\n}\n\nfunction hasSpacingPresets( settings ) {\n\tconst { defaultSpacingSizes, spacingSizes } = settings?.spacing || {};\n\treturn (\n\t\t( defaultSpacingSizes !== false &&\n\t\t\tspacingSizes?.default?.length > 0 ) ||\n\t\tspacingSizes?.theme?.length > 0 ||\n\t\tspacingSizes?.custom?.length > 0\n\t);\n}\n\nfunction filterValuesBySides( values, sides ) {\n\t// If no custom side configuration, all sides are opted into by default.\n\t// Without any values, we have nothing to filter either.\n\tif ( ! sides || ! values ) {\n\t\treturn values;\n\t}\n\n\t// Only include sides opted into within filtered values.\n\tconst filteredValues = {};\n\tsides.forEach( ( side ) => {\n\t\tif ( side === 'vertical' ) {\n\t\t\tfilteredValues.top = values.top;\n\t\t\tfilteredValues.bottom = values.bottom;\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tfilteredValues.left = values.left;\n\t\t\tfilteredValues.right = values.right;\n\t\t}\n\t\tfilteredValues[ side ] = values?.[ side ];\n\t} );\n\n\treturn filteredValues;\n}\n\nconst EMPTY_VALUES = [ undefined, null, '' ];\n\nfunction hasValue( value ) {\n\treturn ! EMPTY_VALUES.includes( value );\n}\n\n/**\n * Extracts the numeric quantity from a raw CSS value so it can be used as a\n * unit-control placeholder. The control's unit selector already reflects the\n * inherited unit, so the placeholder must contain only the number (e.g.\n * `120px` -> `120`) rather than the full unit string.\n *\n * @param {string|number|undefined} rawValue Inherited value to parse.\n * @return {number|undefined} The numeric quantity, or `undefined` when absent.\n */\nfunction getNumericPlaceholder( rawValue ) {\n\tif ( ! hasValue( rawValue ) ) {\n\t\treturn undefined;\n\t}\n\tconst [ quantity ] = parseQuantityAndUnitFromRawValue( rawValue );\n\treturn quantity;\n}\n\nfunction splitStyleValue( value ) {\n\t// Check for shorthand value (a string value).\n\tif ( hasValue( value ) && typeof value === 'string' ) {\n\t\t// Convert to value for individual sides for BoxControl.\n\t\treturn {\n\t\t\ttop: value,\n\t\t\tright: value,\n\t\t\tbottom: value,\n\t\t\tleft: value,\n\t\t};\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns the common side value of a sides object (top/right/bottom/left)\n * when all four sides are defined and equal; otherwise returns undefined.\n *\n * Used to derive a placeholder string for BoxControl's\n * `inputProps.placeholder` from an inherited shorthand or\n * shorthand-equivalent split-side value. When the inherited sides differ\n * from each other, the placeholder is suppressed because BoxControl's\n * `inputProps.placeholder` cannot vary per side.\n *\n * @param {Object|string|undefined} sidesValue The inherited sides shape.\n * @return {string|undefined} The common value, or undefined.\n */\nfunction getCommonSidesValue( sidesValue ) {\n\tif ( ! hasValue( sidesValue ) ) {\n\t\treturn undefined;\n\t}\n\tif ( typeof sidesValue === 'string' ) {\n\t\treturn sidesValue !== '' ? sidesValue : undefined;\n\t}\n\tif ( typeof sidesValue !== 'object' ) {\n\t\treturn undefined;\n\t}\n\tconst sideKeys = [ 'top', 'right', 'bottom', 'left' ];\n\tconst values = sideKeys.map( ( k ) => sidesValue[ k ] );\n\tconst allDefined = values.every( hasValue );\n\tif ( ! allDefined ) {\n\t\treturn undefined;\n\t}\n\tconst first = values[ 0 ];\n\treturn values.every( ( v ) => v === first ) ? first : undefined;\n}\n\n/**\n * Returns whether a sides object (top/right/bottom/left) or shorthand string\n * holds any value on at least one side.\n *\n * Unlike `getCommonSidesValue`, this does not require every side to be defined\n * or equal. It is used to drive the inherited-from-Global-Styles label\n * treatment and the local-override dot, which should reflect the mere presence\n * of an inherited value regardless of whether the individual sides match (a\n * constraint that only applies to BoxControl's single-string placeholder).\n *\n * @param {Object|string|undefined} sidesValue The sides shape.\n * @return {boolean} Whether any side holds a value.\n */\nfunction hasAnySideValue( sidesValue ) {\n\tif ( ! hasValue( sidesValue ) ) {\n\t\treturn false;\n\t}\n\tif ( typeof sidesValue === 'string' ) {\n\t\treturn sidesValue !== '';\n\t}\n\tif ( typeof sidesValue !== 'object' ) {\n\t\treturn false;\n\t}\n\treturn [ 'top', 'right', 'bottom', 'left' ].some( ( side ) =>\n\t\thasValue( sidesValue[ side ] )\n\t);\n}\n\nfunction splitGapValue( value, isAxialGap ) {\n\tif ( ! hasValue( value ) ) {\n\t\treturn value;\n\t}\n\n\t// Check for shorthand value (a string value).\n\tif ( typeof value === 'string' ) {\n\t\t/*\n\t\t * Map the string value to appropriate sides for the spacing control depending\n\t\t * on whether the current block has axial gap support or not.\n\t\t *\n\t\t * Note: The axial value pairs must match for the spacing control to display\n\t\t * the appropriate horizontal/vertical sliders.\n\t\t */\n\t\treturn isAxialGap\n\t\t\t? { top: value, right: value, bottom: value, left: value }\n\t\t\t: { top: value };\n\t}\n\n\treturn {\n\t\t...value,\n\t\tright: value?.left,\n\t\tbottom: value?.top,\n\t};\n}\n\nfunction DimensionsToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\tcontentSize: true,\n\twideSize: true,\n\tpadding: true,\n\tmargin: true,\n\tblockGap: true,\n\theight: true,\n\tminHeight: true,\n\tminWidth: true,\n\twidth: true,\n\taspectRatio: true,\n\tchildLayout: true,\n};\n\nexport default function DimensionsPanel( {\n\tas: Wrapper = DimensionsToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tonVisualize = () => {},\n\t// Special case because the layout controls are not part of the dimensions panel\n\t// in global styles but not in block inspector.\n\tincludeLayoutControls = false,\n\tstyleState = DEFAULT_BLOCK_STYLE_STATE,\n\tshowInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),\n} ) {\n\tconst { dimensions, spacing } = settings;\n\n\tconst decodeValue = ( rawValue ) => {\n\t\tif ( rawValue && typeof rawValue === 'object' ) {\n\t\t\treturn Object.keys( rawValue ).reduce( ( acc, key ) => {\n\t\t\t\tacc[ key ] = getValueFromVariable(\n\t\t\t\t\t{ settings: { dimensions, spacing } },\n\t\t\t\t\t'',\n\t\t\t\t\trawValue[ key ]\n\t\t\t\t);\n\t\t\t\treturn acc;\n\t\t\t}, {} );\n\t\t}\n\t\treturn getValueFromVariable(\n\t\t\t{ settings: { dimensions, spacing } },\n\t\t\t'',\n\t\t\trawValue\n\t\t);\n\t};\n\t// Always keep the layout className (e.g. `single-column`); only the\n\t// inheritance treatment is gated on `showInheritanceLabelIndicators`.\n\tconst inheritanceProps = ( isInherited, hasLocalOverride, className ) =>\n\t\tgetInheritanceProps(\n\t\t\tshowInheritanceLabelIndicators && isInherited,\n\t\t\tshowInheritanceLabelIndicators && hasLocalOverride,\n\t\t\tclassName\n\t\t);\n\n\tconst showSpacingPresetsControl = hasSpacingPresets( settings );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: settings?.spacing?.units || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vw',\n\t\t],\n\t} );\n\n\t//Minimum Margin Value\n\tconst minimumMargin = -Infinity;\n\tconst [ minMarginValue, setMinMarginValue ] = useState( minimumMargin );\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tlayout: cleanEmptyObject( {\n\t\t\t\t...previousValue?.layout,\n\t\t\t\tcontentSize: undefined,\n\t\t\t\twideSize: undefined,\n\t\t\t\tselfStretch: undefined,\n\t\t\t\tflexSize: undefined,\n\t\t\t\tcolumnStart: undefined,\n\t\t\t\trowStart: undefined,\n\t\t\t\tcolumnSpan: undefined,\n\t\t\t\trowSpan: undefined,\n\t\t\t} ),\n\t\t\tspacing: {\n\t\t\t\t...previousValue?.spacing,\n\t\t\t\tpadding: undefined,\n\t\t\t\tmargin: undefined,\n\t\t\t\tblockGap: undefined,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\t...previousValue?.dimensions,\n\t\t\t\theight: undefined,\n\t\t\t\tminHeight: undefined,\n\t\t\t\tminWidth: undefined,\n\t\t\t\taspectRatio: undefined,\n\t\t\t\twidth: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\t// Content Width\n\tconst showContentSizeControl =\n\t\thasContentSize( settings ) && includeLayoutControls;\n\tconst localContentSizeValue = decodeValue( value?.layout?.contentSize );\n\tconst inheritedContentSizeValue = decodeValue(\n\t\tinheritedValue?.layout?.contentSize\n\t);\n\tconst isContentSizePlaceholder =\n\t\t! hasValue( value?.layout?.contentSize ) &&\n\t\thasValue( inheritedContentSizeValue );\n\tconst setContentSizeValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'layout', 'contentSize' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasUserSetContentSizeValue = () =>\n\t\thasValue( value?.layout?.contentSize );\n\tconst resetContentSizeValue = () => setContentSizeValue( undefined );\n\n\t// Wide Width\n\tconst showWideSizeControl =\n\t\thasWideSize( settings ) && includeLayoutControls;\n\tconst localWideSizeValue = decodeValue( value?.layout?.wideSize );\n\tconst inheritedWideSizeValue = decodeValue(\n\t\tinheritedValue?.layout?.wideSize\n\t);\n\tconst isWideSizePlaceholder =\n\t\t! hasValue( value?.layout?.wideSize ) &&\n\t\thasValue( inheritedWideSizeValue );\n\tconst setWideSizeValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'layout', 'wideSize' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasUserSetWideSizeValue = () => hasValue( value?.layout?.wideSize );\n\tconst resetWideSizeValue = () => setWideSizeValue( undefined );\n\n\t// Padding\n\tconst showPaddingControl = hasPadding( settings );\n\tconst inheritedPaddingValues = splitStyleValue(\n\t\tdecodeValue( inheritedValue?.spacing?.padding )\n\t);\n\t// Local-only values feed BoxControl's `values` (with the inherited\n\t// surfaced via the at-rest placeholder).\n\tconst localPaddingValues = splitStyleValue(\n\t\tdecodeValue( value?.spacing?.padding )\n\t);\n\t// Merged local-then-inherited values feed SpacingSizesControl's\n\t// `values` because the preset slider has no placeholder slot — the\n\t// active chip itself is the at-rest cue.\n\tconst paddingValues = hasValue( value?.spacing?.padding )\n\t\t? localPaddingValues\n\t\t: inheritedPaddingValues;\n\tconst inheritedPaddingPlaceholder = getCommonSidesValue(\n\t\tinheritedPaddingValues\n\t);\n\tconst isPaddingPlaceholder =\n\t\t! hasValue( value?.spacing?.padding ) &&\n\t\tinheritedPaddingPlaceholder !== undefined;\n\t// Label/dot inheritance treatment is independent of whether the inherited\n\t// sides share a common value — it only reflects the presence of an\n\t// inherited value (the all-sides-equal constraint applies solely to the\n\t// single-string BoxControl placeholder above).\n\tconst hasInheritedPadding = hasAnySideValue( inheritedPaddingValues );\n\tconst isPaddingInherited =\n\t\t! hasValue( value?.spacing?.padding ) && hasInheritedPadding;\n\tconst paddingSides = Array.isArray( settings?.spacing?.padding )\n\t\t? settings?.spacing?.padding\n\t\t: settings?.spacing?.padding?.sides;\n\tconst isAxialPadding =\n\t\tpaddingSides &&\n\t\tpaddingSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst setPaddingValues = ( newPaddingValues ) => {\n\t\tconst padding = filterValuesBySides( newPaddingValues, paddingSides );\n\t\tonChange( setImmutably( value, [ 'spacing', 'padding' ], padding ) );\n\t};\n\tconst hasPaddingValue = () =>\n\t\thasValue( value?.spacing?.padding ) &&\n\t\tObject.keys( value?.spacing?.padding ).length;\n\tconst resetPaddingValue = () => setPaddingValues( undefined );\n\tconst onMouseOverPadding = () => onVisualize( 'padding' );\n\n\t// Margin\n\tconst showMarginControl = hasMargin( settings );\n\tconst inheritedMarginValues = splitStyleValue(\n\t\tdecodeValue( inheritedValue?.spacing?.margin )\n\t);\n\tconst localMarginValues = splitStyleValue(\n\t\tdecodeValue( value?.spacing?.margin )\n\t);\n\tconst marginValues = hasValue( value?.spacing?.margin )\n\t\t? localMarginValues\n\t\t: inheritedMarginValues;\n\tconst inheritedMarginPlaceholder = getCommonSidesValue(\n\t\tinheritedMarginValues\n\t);\n\tconst isMarginPlaceholder =\n\t\t! hasValue( value?.spacing?.margin ) &&\n\t\tinheritedMarginPlaceholder !== undefined;\n\tconst hasInheritedMargin = hasAnySideValue( inheritedMarginValues );\n\tconst isMarginInherited =\n\t\t! hasValue( value?.spacing?.margin ) && hasInheritedMargin;\n\tconst marginSides = Array.isArray( settings?.spacing?.margin )\n\t\t? settings?.spacing?.margin\n\t\t: settings?.spacing?.margin?.sides;\n\tconst isAxialMargin =\n\t\tmarginSides &&\n\t\tmarginSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst setMarginValues = ( newMarginValues ) => {\n\t\tconst margin = filterValuesBySides( newMarginValues, marginSides );\n\t\tonChange( setImmutably( value, [ 'spacing', 'margin' ], margin ) );\n\t};\n\tconst hasMarginValue = () =>\n\t\thasValue( value?.spacing?.margin ) &&\n\t\tObject.keys( value?.spacing?.margin ).length;\n\tconst resetMarginValue = () => setMarginValues( undefined );\n\tconst onMouseOverMargin = () => onVisualize( 'margin' );\n\n\t// Block Gap\n\tconst showGapControl = hasGap( settings );\n\tconst gapSides = Array.isArray( settings?.spacing?.blockGap )\n\t\t? settings?.spacing?.blockGap\n\t\t: settings?.spacing?.blockGap?.sides;\n\tconst isAxialGap =\n\t\tgapSides && gapSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst localGapRaw = decodeValue( value?.spacing?.blockGap );\n\tconst inheritedGapRaw = decodeValue( inheritedValue?.spacing?.blockGap );\n\t// Merge local-then-inherited so SpacingSizesControl's chip slider and\n\t// the axial-gap BoxControl reflect the local value when set and fall\n\t// back to the inherited value at rest.\n\tconst gapRawForDisplay = hasValue( value?.spacing?.blockGap )\n\t\t? localGapRaw\n\t\t: inheritedGapRaw;\n\tconst gapValues = splitGapValue( gapRawForDisplay, isAxialGap );\n\t// Placeholder state for the single-input (non-axial, non-preset) blockGap\n\t// path. The axial / preset paths render compound or chip controls without\n\t// a native placeholder slot — the displayed `values` themselves are the\n\t// at-rest cue for those.\n\tconst isGapPlaceholder =\n\t\t! hasValue( value?.spacing?.blockGap ) &&\n\t\ttypeof inheritedGapRaw === 'string' &&\n\t\tinheritedGapRaw !== '';\n\tconst setGapValue = ( newGapValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'spacing', 'blockGap' ], newGapValue )\n\t\t);\n\t};\n\tconst setGapValues = ( nextBoxGapValue ) => {\n\t\tif ( ! hasValue( nextBoxGapValue ) ) {\n\t\t\tsetGapValue( null );\n\t\t}\n\t\t// If axial gap is not enabled, treat the 'top' value as the shorthand gap value.\n\t\tif ( ! isAxialGap && nextBoxGapValue?.hasOwnProperty( 'top' ) ) {\n\t\t\tsetGapValue( nextBoxGapValue.top );\n\t\t} else {\n\t\t\tsetGapValue( {\n\t\t\t\ttop: nextBoxGapValue?.top,\n\t\t\t\tleft: nextBoxGapValue?.left,\n\t\t\t} );\n\t\t}\n\t};\n\tconst resetGapValue = () => setGapValue( undefined );\n\tconst hasGapValue = () => hasValue( value?.spacing?.blockGap );\n\n\t// Min Height\n\tconst showMinHeightControl = hasMinHeight( settings );\n\tconst localMinHeightValue = decodeValue( value?.dimensions?.minHeight );\n\tconst inheritedMinHeightValue = decodeValue(\n\t\tinheritedValue?.dimensions?.minHeight\n\t);\n\tconst isMinHeightPlaceholder =\n\t\t! hasValue( value?.dimensions?.minHeight ) &&\n\t\thasValue( inheritedMinHeightValue );\n\tconst setMinHeightValue = ( newValue ) => {\n\t\tconst tempValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'dimensions', 'minHeight' ],\n\t\t\tnewValue\n\t\t);\n\t\t// Apply min-height, while removing any applied aspect ratio.\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\ttempValue,\n\t\t\t\t[ 'dimensions', 'aspectRatio' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\t};\n\tconst resetMinHeightValue = () => {\n\t\tsetMinHeightValue( undefined );\n\t};\n\tconst hasMinHeightValue = () => hasValue( value?.dimensions?.minHeight );\n\n\t// Height\n\tconst showHeightControl = hasHeight( settings );\n\tconst localHeightValue = decodeValue( value?.dimensions?.height );\n\tconst inheritedHeightValue = decodeValue(\n\t\tinheritedValue?.dimensions?.height\n\t);\n\tconst isHeightPlaceholder =\n\t\t! hasValue( value?.dimensions?.height ) &&\n\t\thasValue( inheritedHeightValue );\n\tconst setHeightValue = ( newValue ) => {\n\t\tconst tempValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'dimensions', 'height' ],\n\t\t\tnewValue\n\t\t);\n\t\t// Apply height, while removing any applied aspect ratio.\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\ttempValue,\n\t\t\t\t[ 'dimensions', 'aspectRatio' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\t};\n\tconst resetHeightValue = () => {\n\t\tsetHeightValue( undefined );\n\t};\n\tconst hasHeightValue = () => hasValue( value?.dimensions?.height );\n\n\t// Min Width\n\tconst showMinWidthControl = hasMinWidth( settings );\n\tconst localMinWidthValue = decodeValue( value?.dimensions?.minWidth );\n\tconst inheritedMinWidthValue = decodeValue(\n\t\tinheritedValue?.dimensions?.minWidth\n\t);\n\tconst isMinWidthPlaceholder =\n\t\t! hasValue( value?.dimensions?.minWidth ) &&\n\t\thasValue( inheritedMinWidthValue );\n\tconst setMinWidthValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'dimensions', 'minWidth' ], newValue )\n\t\t);\n\t};\n\tconst resetMinWidthValue = () => {\n\t\tsetMinWidthValue( undefined );\n\t};\n\tconst hasMinWidthValue = () => hasValue( value?.dimensions?.minWidth );\n\n\t// Width\n\tconst showWidthControl = hasWidth( settings );\n\tconst localWidthValue = decodeValue( value?.dimensions?.width );\n\tconst inheritedWidthValue = decodeValue(\n\t\tinheritedValue?.dimensions?.width\n\t);\n\tconst isWidthPlaceholder =\n\t\t! hasValue( value?.dimensions?.width ) &&\n\t\thasValue( inheritedWidthValue );\n\tconst setWidthValue = ( newValue ) => {\n\t\tonChange( setImmutably( value, [ 'dimensions', 'width' ], newValue ) );\n\t};\n\tconst resetWidthValue = () => {\n\t\tsetWidthValue( undefined );\n\t};\n\tconst hasWidthValue = () => hasValue( value?.dimensions?.width );\n\n\t// Aspect Ratio\n\tconst showAspectRatioControl = hasAspectRatio( settings, styleState );\n\tconst localAspectRatioValue = decodeValue( value?.dimensions?.aspectRatio );\n\tconst inheritedAspectRatioValue = decodeValue(\n\t\tinheritedValue?.dimensions?.aspectRatio\n\t);\n\tconst aspectRatioValue = localAspectRatioValue ?? inheritedAspectRatioValue;\n\tconst isAspectRatioPlaceholder =\n\t\t! hasValue( value?.dimensions?.aspectRatio ) &&\n\t\thasValue( inheritedAspectRatioValue );\n\tconst setAspectRatioValue = ( newValue ) => {\n\t\tconst tempValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'dimensions', 'aspectRatio' ],\n\t\t\tnewValue\n\t\t);\n\t\t// Apply aspect-ratio, while removing any applied min-height.\n\t\tonChange(\n\t\t\tsetImmutably( tempValue, [ 'dimensions', 'minHeight' ], undefined )\n\t\t);\n\t};\n\tconst hasAspectRatioValue = () =>\n\t\thasValue( value?.dimensions?.aspectRatio );\n\n\t// Child Layout. There is no Global Styles inheritance model for the\n\t// child-layout sub-keys (`selfStretch`, `flexSize`, `columnStart`,\n\t// `rowStart`, `columnSpan`, `rowSpan`); they are per-block attributes\n\t// only. Render the local value directly so user-set overrides are\n\t// reflected in the control rather than washed out by a misshapen\n\t// inherited layout payload.\n\tconst showChildLayoutControl = hasChildLayout( settings, styleState );\n\tconst childLayout = value?.layout;\n\n\tconst setChildLayout = ( newChildLayout ) => {\n\t\tonChange( {\n\t\t\t...value,\n\t\t\tlayout: {\n\t\t\t\t...value?.layout,\n\t\t\t\t...newChildLayout,\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst onMouseLeaveControls = () => onVisualize( false );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ ( showContentSizeControl || showWideSizeControl ) && (\n\t\t\t\t<span className=\"span-columns\">\n\t\t\t\t\t{ __( 'Set the width of the main content area.' ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t{ showContentSizeControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisContentSizePlaceholder,\n\t\t\t\t\t\thasUserSetContentSizeValue() &&\n\t\t\t\t\t\t\tinheritedContentSizeValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Content width' ) }\n\t\t\t\t\thasValue={ hasUserSetContentSizeValue }\n\t\t\t\t\tonDeselect={ resetContentSizeValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.contentSize ??\n\t\t\t\t\t\tDEFAULT_CONTROLS.contentSize\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tlabel={ __( 'Content width' ) }\n\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// (e.g. \"620px\" keeps its unit rather than the value\n\t\t\t\t\t\t// string sitting greyed-out behind a default px unit). It\n\t\t\t\t\t\t// is only written to local on user change.\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tlocalContentSizeValue ?? inheritedContentSizeValue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisContentSizePlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedContentSizeValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( nextContentSize ) => {\n\t\t\t\t\t\t\tsetContentSizeValue( nextContentSize );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\t<InputControlPrefixWrapper variant=\"icon\">\n\t\t\t\t\t\t\t\t<Icon icon={ alignNone } />\n\t\t\t\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showWideSizeControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisWideSizePlaceholder,\n\t\t\t\t\t\thasUserSetWideSizeValue() &&\n\t\t\t\t\t\t\tinheritedWideSizeValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Wide width' ) }\n\t\t\t\t\thasValue={ hasUserSetWideSizeValue }\n\t\t\t\t\tonDeselect={ resetWideSizeValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.wideSize ?? DEFAULT_CONTROLS.wideSize\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tlabel={ __( 'Wide width' ) }\n\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// rather than the value string sitting greyed-out behind\n\t\t\t\t\t\t// a default px unit. It is only written to local on user\n\t\t\t\t\t\t// change.\n\t\t\t\t\t\tvalue={ localWideSizeValue ?? inheritedWideSizeValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisWideSizePlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedWideSizeValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( nextWideSize ) => {\n\t\t\t\t\t\t\tsetWideSizeValue( nextWideSize );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\t<InputControlPrefixWrapper variant=\"icon\">\n\t\t\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showPaddingControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\thasValue={ hasPaddingValue }\n\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\thasInlineEndToggle={ hasSpacingToggle(\n\t\t\t\t\t\tpaddingSides,\n\t\t\t\t\t\tshowSpacingPresetsControl\n\t\t\t\t\t) }\n\t\t\t\t\tonDeselect={ resetPaddingValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.padding ?? DEFAULT_CONTROLS.padding\n\t\t\t\t\t}\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisPaddingInherited,\n\t\t\t\t\t\thasPaddingValue() && hasInheritedPadding,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'tools-panel-item-spacing':\n\t\t\t\t\t\t\t\tshowSpacingPresetsControl,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ localPaddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialPadding }\n\t\t\t\t\t\t\tinputProps={ {\n\t\t\t\t\t\t\t\tonMouseOver: onMouseOverPadding,\n\t\t\t\t\t\t\t\tonMouseOut: onMouseLeaveControls,\n\t\t\t\t\t\t\t\tplaceholder: isPaddingPlaceholder\n\t\t\t\t\t\t\t\t\t? inheritedPaddingPlaceholder\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ paddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tonMouseOver={ onMouseOverPadding }\n\t\t\t\t\t\t\tonMouseOut={ onMouseLeaveControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMarginControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\thasValue={ hasMarginValue }\n\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\thasInlineEndToggle={ hasSpacingToggle(\n\t\t\t\t\t\tmarginSides,\n\t\t\t\t\t\tshowSpacingPresetsControl\n\t\t\t\t\t) }\n\t\t\t\t\tonDeselect={ resetMarginValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.margin ?? DEFAULT_CONTROLS.margin\n\t\t\t\t\t}\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisMarginInherited,\n\t\t\t\t\t\thasMarginValue() && hasInheritedMargin,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'tools-panel-item-spacing':\n\t\t\t\t\t\t\t\tshowSpacingPresetsControl,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ localMarginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tinputProps={ {\n\t\t\t\t\t\t\t\tmin: minMarginValue,\n\t\t\t\t\t\t\t\tonDragStart: () => {\n\t\t\t\t\t\t\t\t\t// Reset to 0 in case the value was negative.\n\t\t\t\t\t\t\t\t\tsetMinMarginValue( 0 );\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonDragEnd: () => {\n\t\t\t\t\t\t\t\t\tsetMinMarginValue( minimumMargin );\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonMouseOver: onMouseOverMargin,\n\t\t\t\t\t\t\t\tonMouseOut: onMouseLeaveControls,\n\t\t\t\t\t\t\t\tplaceholder: isMarginPlaceholder\n\t\t\t\t\t\t\t\t\t? inheritedMarginPlaceholder\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialMargin }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ marginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tminimumCustomValue={ -Infinity }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tonMouseOver={ onMouseOverMargin }\n\t\t\t\t\t\t\tonMouseOut={ onMouseLeaveControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showGapControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\thasValue={ hasGapValue }\n\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\thasInlineEndToggle={ isAxialGap }\n\t\t\t\t\tonDeselect={ resetGapValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.blockGap ?? DEFAULT_CONTROLS.blockGap\n\t\t\t\t\t}\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisGapPlaceholder,\n\t\t\t\t\t\thasGapValue() && inheritedGapRaw !== undefined,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'tools-panel-item-spacing':\n\t\t\t\t\t\t\t\tshowSpacingPresetsControl,\n\t\t\t\t\t\t\t'single-column':\n\t\t\t\t\t\t\t\t// If UnitControl is used, should be single-column.\n\t\t\t\t\t\t\t\t! showSpacingPresetsControl && ! isAxialGap,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl &&\n\t\t\t\t\t\t( isAxialGap ? (\n\t\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tsides={ gapSides }\n\t\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\tsplitOnAxis={ isAxialGap }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValue }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tvalue={ localGapRaw ?? undefined }\n\t\t\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t\t\tisGapPlaceholder\n\t\t\t\t\t\t\t\t\t\t? inheritedGapRaw\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\tshowSideInLabel={ false }\n\t\t\t\t\t\t\tsides={ isAxialGap ? gapSides : [ 'top' ] } // Use 'top' as the shorthand property in non-axial configurations.\n\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showChildLayoutControl && (\n\t\t\t\t<ChildLayoutControl\n\t\t\t\t\tvalue={ childLayout }\n\t\t\t\t\tonChange={ setChildLayout }\n\t\t\t\t\tparentLayout={ settings?.parentLayout }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\tshowGridSpanDefaults={\n\t\t\t\t\t\t! hasViewportBlockStyleState( styleState )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.childLayout ??\n\t\t\t\t\t\tDEFAULT_CONTROLS.childLayout\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showMinHeightControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisMinHeightPlaceholder,\n\t\t\t\t\t\thasMinHeightValue() &&\n\t\t\t\t\t\t\tinheritedMinHeightValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasMinHeightValue }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ resetMinHeightValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.minHeight ?? DEFAULT_CONTROLS.minHeight\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// (e.g. \"120px\" keeps its unit rather than the value\n\t\t\t\t\t\t// string sitting behind a default px unit). It is only\n\t\t\t\t\t\t// written to local on user change.\n\t\t\t\t\t\tvalue={ localMinHeightValue ?? inheritedMinHeightValue }\n\t\t\t\t\t\tonChange={ setMinHeightValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisMinHeightPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedMinHeightValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMinWidthControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisMinWidthPlaceholder,\n\t\t\t\t\t\thasMinWidthValue() &&\n\t\t\t\t\t\t\tinheritedMinWidthValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasMinWidthValue }\n\t\t\t\t\tlabel={ __( 'Minimum width' ) }\n\t\t\t\t\tonDeselect={ resetMinWidthValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.minWidth ?? DEFAULT_CONTROLS.minWidth\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Minimum width' ) }\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// rather than the value string sitting behind a default\n\t\t\t\t\t\t// px unit. It is only written to local on user change.\n\t\t\t\t\t\tvalue={ localMinWidthValue ?? inheritedMinWidthValue }\n\t\t\t\t\t\tonChange={ setMinWidthValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisMinWidthPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedMinWidthValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showHeightControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisHeightPlaceholder,\n\t\t\t\t\t\thasHeightValue() && inheritedHeightValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasHeightValue }\n\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\tonDeselect={ resetHeightValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.height ?? DEFAULT_CONTROLS.height\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\tvalue={ localHeightValue }\n\t\t\t\t\t\tonChange={ setHeightValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisHeightPlaceholder\n\t\t\t\t\t\t\t\t? inheritedHeightValue\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showWidthControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisWidthPlaceholder,\n\t\t\t\t\t\thasWidthValue() && inheritedWidthValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasWidthValue }\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tonDeselect={ resetWidthValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.width ?? DEFAULT_CONTROLS.width\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tvalue={ localWidthValue }\n\t\t\t\t\t\tonChange={ setWidthValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisWidthPlaceholder ? inheritedWidthValue : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showAspectRatioControl && (\n\t\t\t\t<AspectRatioTool\n\t\t\t\t\thasValue={ hasAspectRatioValue }\n\t\t\t\t\tvalue={ aspectRatioValue }\n\t\t\t\t\tonChange={ setAspectRatioValue }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisAspectRatioPlaceholder,\n\t\t\t\t\t\thasAspectRatioValue() &&\n\t\t\t\t\t\t\tinheritedAspectRatioValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.aspectRatio ??\n\t\t\t\t\t\tDEFAULT_CONTROLS.aspectRatio\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAOO;AACP,mBAA6C;AAC7C,qBAAsC;AACtC,kCAAqC;AACrC,mBAA+C;AAC/C,mCAAgC;AAChC,+BAA6B;AAC7B,kCAA+B;AAC/B,+BAA4B;AAC5B,IAAAA,gBAAiC;AACjC,oBAA6B;AAC7B,+BAIO;AACP,yBAIO;AA4RL;AA1RF,IAAM,cAAc,CAAE,cAAc,UAAW;AAa/C,SAAS,iBAAkB,OAAO,kBAAmB;AACpD,MAAK,OAAO,WAAW,GAAI;AAC1B,WAAO;AAAA,EACR;AACA,MAAK,kBAAmB;AACvB,UAAM,oBACL,OAAO,SAAU,YAAa,KAC9B,OAAO,SAAU,UAAW,KAC5B,OAAO,WAAW;AACnB,WAAO,CAAE;AAAA,EACV;AACA,SAAO;AACR;AAEO,SAAS,sBACf,UACA,aAAa,oDACZ;AACD,SACC,eAAgB,QAAS,KACzB,YAAa,QAAS,KACtB,WAAY,QAAS,KACrB,UAAW,QAAS,KACpB,OAAQ,QAAS,KACjB,UAAW,QAAS,KACpB,aAAc,QAAS,KACvB,YAAa,QAAS,KAC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iBAAiB;AAAA;AAAA,QAEnB;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\tBoxControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { Icon, alignNone, stretchWide } from '@wordpress/icons';\nimport { useCallback, useState } from '@wordpress/element';\nimport { getValueFromVariable } from '@wordpress/global-styles-engine';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport SpacingSizesControl from '../spacing-sizes-control';\nimport DimensionControl from '../dimension-control';\nimport ChildLayoutControl from '../child-layout-control';\nimport AspectRatioTool from '../dimensions-tool/aspect-ratio-tool';\nimport { cleanEmptyObject } from '../../hooks/utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\tDEFAULT_BLOCK_STYLE_STATE,\n\thasPseudoBlockStyleState,\n\thasViewportBlockStyleState,\n} from '../../hooks/block-style-state';\nimport {\n\tgetInheritanceProps,\n\tInheritanceToolsPanelItem,\n\tisGlobalStylesInheritanceEnabled,\n} from './inheritance';\n\nconst AXIAL_SIDES = [ 'horizontal', 'vertical' ];\n\n/**\n * Determines whether a spacing control (`BoxControl` or `SpacingSizesControl`)\n * renders its linked/unlink toggle button, which the local-override reset dot\n * offsets itself against.\n *\n * @param {string[]|undefined} sides Configurable sides for the control.\n * @param {boolean} isPresetsControl Whether the presets-based\n * `SpacingSizesControl` is used.\n *\n * @return {boolean} Whether the toggle button is rendered.\n */\nfunction hasSpacingToggle( sides, isPresetsControl ) {\n\tif ( sides?.length === 1 ) {\n\t\treturn false;\n\t}\n\tif ( isPresetsControl ) {\n\t\tconst hasOnlyAxialSides =\n\t\t\tsides?.includes( 'horizontal' ) &&\n\t\t\tsides?.includes( 'vertical' ) &&\n\t\t\tsides?.length === 2;\n\t\treturn ! hasOnlyAxialSides;\n\t}\n\treturn true;\n}\n\nexport function useHasDimensionsPanel(\n\tsettings,\n\tstyleState = DEFAULT_BLOCK_STYLE_STATE\n) {\n\treturn (\n\t\thasContentSize( settings ) ||\n\t\thasWideSize( settings ) ||\n\t\thasPadding( settings ) ||\n\t\thasMargin( settings ) ||\n\t\thasGap( settings ) ||\n\t\thasHeight( settings ) ||\n\t\thasMinHeight( settings ) ||\n\t\thasMinWidth( settings ) ||\n\t\thasWidth( settings ) ||\n\t\thasAspectRatio( settings, styleState ) ||\n\t\thasChildLayout( settings, styleState )\n\t);\n}\n\nfunction hasContentSize( settings ) {\n\treturn settings?.layout?.contentSize;\n}\n\nfunction hasWideSize( settings ) {\n\treturn settings?.layout?.wideSize;\n}\n\nfunction hasPadding( settings ) {\n\treturn settings?.spacing?.padding;\n}\n\nfunction hasMargin( settings ) {\n\treturn settings?.spacing?.margin;\n}\n\nfunction hasGap( settings ) {\n\treturn settings?.spacing?.blockGap;\n}\n\nfunction hasHeight( settings ) {\n\treturn settings?.dimensions?.height;\n}\n\nfunction hasMinHeight( settings ) {\n\treturn settings?.dimensions?.minHeight;\n}\n\nfunction hasMinWidth( settings ) {\n\treturn settings?.dimensions?.minWidth;\n}\n\nfunction hasWidth( settings ) {\n\treturn settings?.dimensions?.width;\n}\n\nfunction hasAspectRatio( settings, styleState = DEFAULT_BLOCK_STYLE_STATE ) {\n\treturn (\n\t\t! hasPseudoBlockStyleState( styleState ) &&\n\t\tsettings?.dimensions?.aspectRatio\n\t);\n}\n\nfunction hasChildLayout( settings, styleState = DEFAULT_BLOCK_STYLE_STATE ) {\n\tif ( hasPseudoBlockStyleState( styleState ) ) {\n\t\treturn false;\n\t}\n\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tdefault: { type: defaultParentLayoutType = 'default' } = {},\n\t\tallowSizingOnChildren = false,\n\t} = settings?.parentLayout ?? {};\n\n\tconst support =\n\t\t( defaultParentLayoutType === 'flex' ||\n\t\t\tparentLayoutType === 'flex' ||\n\t\t\tdefaultParentLayoutType === 'grid' ||\n\t\t\tparentLayoutType === 'grid' ) &&\n\t\tallowSizingOnChildren;\n\treturn !! settings?.layout && support;\n}\n\nfunction hasSpacingPresets( settings ) {\n\tconst { defaultSpacingSizes, spacingSizes } = settings?.spacing || {};\n\treturn (\n\t\t( defaultSpacingSizes !== false &&\n\t\t\tspacingSizes?.default?.length > 0 ) ||\n\t\tspacingSizes?.theme?.length > 0 ||\n\t\tspacingSizes?.custom?.length > 0\n\t);\n}\n\nfunction filterValuesBySides( values, sides ) {\n\t// If no custom side configuration, all sides are opted into by default.\n\t// Without any values, we have nothing to filter either.\n\tif ( ! sides || ! values ) {\n\t\treturn values;\n\t}\n\n\t// Only include sides opted into within filtered values.\n\tconst filteredValues = {};\n\tsides.forEach( ( side ) => {\n\t\tif ( side === 'vertical' ) {\n\t\t\tfilteredValues.top = values.top;\n\t\t\tfilteredValues.bottom = values.bottom;\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tfilteredValues.left = values.left;\n\t\t\tfilteredValues.right = values.right;\n\t\t}\n\t\tfilteredValues[ side ] = values?.[ side ];\n\t} );\n\n\treturn filteredValues;\n}\n\nconst EMPTY_VALUES = [ undefined, null, '' ];\n\nfunction hasValue( value ) {\n\treturn ! EMPTY_VALUES.includes( value );\n}\n\n/**\n * Extracts the numeric quantity from a raw CSS value so it can be used as a\n * unit-control placeholder. The control's unit selector already reflects the\n * inherited unit, so the placeholder must contain only the number (e.g.\n * `120px` -> `120`) rather than the full unit string.\n *\n * @param {string|number|undefined} rawValue Inherited value to parse.\n * @return {number|undefined} The numeric quantity, or `undefined` when absent.\n */\nfunction getNumericPlaceholder( rawValue ) {\n\tif ( ! hasValue( rawValue ) ) {\n\t\treturn undefined;\n\t}\n\tconst [ quantity ] = parseQuantityAndUnitFromRawValue( rawValue );\n\treturn quantity;\n}\n\nfunction splitStyleValue( value ) {\n\t// Check for shorthand value (a string value).\n\tif ( hasValue( value ) && typeof value === 'string' ) {\n\t\t// Convert to value for individual sides for BoxControl.\n\t\treturn {\n\t\t\ttop: value,\n\t\t\tright: value,\n\t\t\tbottom: value,\n\t\t\tleft: value,\n\t\t};\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns the common side value of a sides object (top/right/bottom/left)\n * when all four sides are defined and equal; otherwise returns undefined.\n *\n * Used to derive a placeholder string for BoxControl's\n * `inputProps.placeholder` from an inherited shorthand or\n * shorthand-equivalent split-side value. When the inherited sides differ\n * from each other, the placeholder is suppressed because BoxControl's\n * `inputProps.placeholder` cannot vary per side.\n *\n * @param {Object|string|undefined} sidesValue The inherited sides shape.\n * @return {string|undefined} The common value, or undefined.\n */\nfunction getCommonSidesValue( sidesValue ) {\n\tif ( ! hasValue( sidesValue ) ) {\n\t\treturn undefined;\n\t}\n\tif ( typeof sidesValue === 'string' ) {\n\t\treturn sidesValue !== '' ? sidesValue : undefined;\n\t}\n\tif ( typeof sidesValue !== 'object' ) {\n\t\treturn undefined;\n\t}\n\tconst sideKeys = [ 'top', 'right', 'bottom', 'left' ];\n\tconst values = sideKeys.map( ( k ) => sidesValue[ k ] );\n\tconst allDefined = values.every( hasValue );\n\tif ( ! allDefined ) {\n\t\treturn undefined;\n\t}\n\tconst first = values[ 0 ];\n\treturn values.every( ( v ) => v === first ) ? first : undefined;\n}\n\n/**\n * Returns whether a sides object (top/right/bottom/left) or shorthand string\n * holds any value on at least one side.\n *\n * Unlike `getCommonSidesValue`, this does not require every side to be defined\n * or equal. It is used to drive the inherited-from-Global-Styles label\n * treatment and the local-override dot, which should reflect the mere presence\n * of an inherited value regardless of whether the individual sides match (a\n * constraint that only applies to BoxControl's single-string placeholder).\n *\n * @param {Object|string|undefined} sidesValue The sides shape.\n * @return {boolean} Whether any side holds a value.\n */\nfunction hasAnySideValue( sidesValue ) {\n\tif ( ! hasValue( sidesValue ) ) {\n\t\treturn false;\n\t}\n\tif ( typeof sidesValue === 'string' ) {\n\t\treturn sidesValue !== '';\n\t}\n\tif ( typeof sidesValue !== 'object' ) {\n\t\treturn false;\n\t}\n\treturn [ 'top', 'right', 'bottom', 'left' ].some( ( side ) =>\n\t\thasValue( sidesValue[ side ] )\n\t);\n}\n\nfunction splitGapValue( value, isAxialGap ) {\n\tif ( ! hasValue( value ) ) {\n\t\treturn value;\n\t}\n\n\t// Check for shorthand value (a string value).\n\tif ( typeof value === 'string' ) {\n\t\t/*\n\t\t * Map the string value to appropriate sides for the spacing control depending\n\t\t * on whether the current block has axial gap support or not.\n\t\t *\n\t\t * Note: The axial value pairs must match for the spacing control to display\n\t\t * the appropriate horizontal/vertical sliders.\n\t\t */\n\t\treturn isAxialGap\n\t\t\t? { top: value, right: value, bottom: value, left: value }\n\t\t\t: { top: value };\n\t}\n\n\treturn {\n\t\t...value,\n\t\tright: value?.left,\n\t\tbottom: value?.top,\n\t};\n}\n\nfunction DimensionsToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\tcontentSize: true,\n\twideSize: true,\n\tpadding: true,\n\tmargin: true,\n\tblockGap: true,\n\theight: true,\n\tminHeight: true,\n\tminWidth: true,\n\twidth: true,\n\taspectRatio: true,\n\tchildLayout: true,\n};\n\nexport default function DimensionsPanel( {\n\tas: Wrapper = DimensionsToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tonVisualize = () => {},\n\t// Special case because the layout controls are not part of the dimensions panel\n\t// in global styles but not in block inspector.\n\tincludeLayoutControls = false,\n\tallowAxialBlockGap = true,\n\tstyleState = DEFAULT_BLOCK_STYLE_STATE,\n\tshowInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),\n} ) {\n\tconst { dimensions, spacing } = settings;\n\n\tconst decodeValue = ( rawValue ) => {\n\t\tif ( rawValue && typeof rawValue === 'object' ) {\n\t\t\treturn Object.keys( rawValue ).reduce( ( acc, key ) => {\n\t\t\t\tacc[ key ] = getValueFromVariable(\n\t\t\t\t\t{ settings: { dimensions, spacing } },\n\t\t\t\t\t'',\n\t\t\t\t\trawValue[ key ]\n\t\t\t\t);\n\t\t\t\treturn acc;\n\t\t\t}, {} );\n\t\t}\n\t\treturn getValueFromVariable(\n\t\t\t{ settings: { dimensions, spacing } },\n\t\t\t'',\n\t\t\trawValue\n\t\t);\n\t};\n\t// Always keep the layout className (e.g. `single-column`); only the\n\t// inheritance treatment is gated on `showInheritanceLabelIndicators`.\n\tconst inheritanceProps = ( isInherited, hasLocalOverride, className ) =>\n\t\tgetInheritanceProps(\n\t\t\tshowInheritanceLabelIndicators && isInherited,\n\t\t\tshowInheritanceLabelIndicators && hasLocalOverride,\n\t\t\tclassName\n\t\t);\n\n\tconst showSpacingPresetsControl = hasSpacingPresets( settings );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: settings?.spacing?.units || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vw',\n\t\t],\n\t} );\n\n\t//Minimum Margin Value\n\tconst minimumMargin = -Infinity;\n\tconst [ minMarginValue, setMinMarginValue ] = useState( minimumMargin );\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tlayout: cleanEmptyObject( {\n\t\t\t\t...previousValue?.layout,\n\t\t\t\tcontentSize: undefined,\n\t\t\t\twideSize: undefined,\n\t\t\t\tselfStretch: undefined,\n\t\t\t\tflexSize: undefined,\n\t\t\t\tcolumnStart: undefined,\n\t\t\t\trowStart: undefined,\n\t\t\t\tcolumnSpan: undefined,\n\t\t\t\trowSpan: undefined,\n\t\t\t} ),\n\t\t\tspacing: {\n\t\t\t\t...previousValue?.spacing,\n\t\t\t\tpadding: undefined,\n\t\t\t\tmargin: undefined,\n\t\t\t\tblockGap: undefined,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\t...previousValue?.dimensions,\n\t\t\t\theight: undefined,\n\t\t\t\tminHeight: undefined,\n\t\t\t\tminWidth: undefined,\n\t\t\t\taspectRatio: undefined,\n\t\t\t\twidth: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\t// Content Width\n\tconst showContentSizeControl =\n\t\thasContentSize( settings ) && includeLayoutControls;\n\tconst localContentSizeValue = decodeValue( value?.layout?.contentSize );\n\tconst inheritedContentSizeValue = decodeValue(\n\t\tinheritedValue?.layout?.contentSize\n\t);\n\tconst isContentSizePlaceholder =\n\t\t! hasValue( value?.layout?.contentSize ) &&\n\t\thasValue( inheritedContentSizeValue );\n\tconst setContentSizeValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'layout', 'contentSize' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasUserSetContentSizeValue = () =>\n\t\thasValue( value?.layout?.contentSize );\n\tconst resetContentSizeValue = () => setContentSizeValue( undefined );\n\n\t// Wide Width\n\tconst showWideSizeControl =\n\t\thasWideSize( settings ) && includeLayoutControls;\n\tconst localWideSizeValue = decodeValue( value?.layout?.wideSize );\n\tconst inheritedWideSizeValue = decodeValue(\n\t\tinheritedValue?.layout?.wideSize\n\t);\n\tconst isWideSizePlaceholder =\n\t\t! hasValue( value?.layout?.wideSize ) &&\n\t\thasValue( inheritedWideSizeValue );\n\tconst setWideSizeValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'layout', 'wideSize' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasUserSetWideSizeValue = () => hasValue( value?.layout?.wideSize );\n\tconst resetWideSizeValue = () => setWideSizeValue( undefined );\n\n\t// Padding\n\tconst showPaddingControl = hasPadding( settings );\n\tconst inheritedPaddingValues = splitStyleValue(\n\t\tdecodeValue( inheritedValue?.spacing?.padding )\n\t);\n\t// Local-only values feed BoxControl's `values` (with the inherited\n\t// surfaced via the at-rest placeholder).\n\tconst localPaddingValues = splitStyleValue(\n\t\tdecodeValue( value?.spacing?.padding )\n\t);\n\t// Merged local-then-inherited values feed SpacingSizesControl's\n\t// `values` because the preset slider has no placeholder slot — the\n\t// active chip itself is the at-rest cue.\n\tconst paddingValues = hasValue( value?.spacing?.padding )\n\t\t? localPaddingValues\n\t\t: inheritedPaddingValues;\n\tconst inheritedPaddingPlaceholder = getCommonSidesValue(\n\t\tinheritedPaddingValues\n\t);\n\tconst isPaddingPlaceholder =\n\t\t! hasValue( value?.spacing?.padding ) &&\n\t\tinheritedPaddingPlaceholder !== undefined;\n\t// Label/dot inheritance treatment is independent of whether the inherited\n\t// sides share a common value — it only reflects the presence of an\n\t// inherited value (the all-sides-equal constraint applies solely to the\n\t// single-string BoxControl placeholder above).\n\tconst hasInheritedPadding = hasAnySideValue( inheritedPaddingValues );\n\tconst isPaddingInherited =\n\t\t! hasValue( value?.spacing?.padding ) && hasInheritedPadding;\n\tconst paddingSides = Array.isArray( settings?.spacing?.padding )\n\t\t? settings?.spacing?.padding\n\t\t: settings?.spacing?.padding?.sides;\n\tconst isAxialPadding =\n\t\tpaddingSides &&\n\t\tpaddingSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst setPaddingValues = ( newPaddingValues ) => {\n\t\tconst padding = filterValuesBySides( newPaddingValues, paddingSides );\n\t\tonChange( setImmutably( value, [ 'spacing', 'padding' ], padding ) );\n\t};\n\tconst hasPaddingValue = () =>\n\t\thasValue( value?.spacing?.padding ) &&\n\t\tObject.keys( value?.spacing?.padding ).length;\n\tconst resetPaddingValue = () => setPaddingValues( undefined );\n\tconst onMouseOverPadding = () => onVisualize( 'padding' );\n\n\t// Margin\n\tconst showMarginControl = hasMargin( settings );\n\tconst inheritedMarginValues = splitStyleValue(\n\t\tdecodeValue( inheritedValue?.spacing?.margin )\n\t);\n\tconst localMarginValues = splitStyleValue(\n\t\tdecodeValue( value?.spacing?.margin )\n\t);\n\tconst marginValues = hasValue( value?.spacing?.margin )\n\t\t? localMarginValues\n\t\t: inheritedMarginValues;\n\tconst inheritedMarginPlaceholder = getCommonSidesValue(\n\t\tinheritedMarginValues\n\t);\n\tconst isMarginPlaceholder =\n\t\t! hasValue( value?.spacing?.margin ) &&\n\t\tinheritedMarginPlaceholder !== undefined;\n\tconst hasInheritedMargin = hasAnySideValue( inheritedMarginValues );\n\tconst isMarginInherited =\n\t\t! hasValue( value?.spacing?.margin ) && hasInheritedMargin;\n\tconst marginSides = Array.isArray( settings?.spacing?.margin )\n\t\t? settings?.spacing?.margin\n\t\t: settings?.spacing?.margin?.sides;\n\tconst isAxialMargin =\n\t\tmarginSides &&\n\t\tmarginSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst setMarginValues = ( newMarginValues ) => {\n\t\tconst margin = filterValuesBySides( newMarginValues, marginSides );\n\t\tonChange( setImmutably( value, [ 'spacing', 'margin' ], margin ) );\n\t};\n\tconst hasMarginValue = () =>\n\t\thasValue( value?.spacing?.margin ) &&\n\t\tObject.keys( value?.spacing?.margin ).length;\n\tconst resetMarginValue = () => setMarginValues( undefined );\n\tconst onMouseOverMargin = () => onVisualize( 'margin' );\n\n\t// Block Gap\n\tconst showGapControl = hasGap( settings );\n\tconst gapSides = Array.isArray( settings?.spacing?.blockGap )\n\t\t? settings?.spacing?.blockGap\n\t\t: settings?.spacing?.blockGap?.sides;\n\tconst isAxialGap =\n\t\tallowAxialBlockGap &&\n\t\tgapSides &&\n\t\tgapSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst localGapRaw = decodeValue( value?.spacing?.blockGap );\n\tconst inheritedGapRaw = decodeValue( inheritedValue?.spacing?.blockGap );\n\tconst localGapForSingleInput =\n\t\t! isAxialGap && typeof localGapRaw === 'object'\n\t\t\t? localGapRaw?.top\n\t\t\t: localGapRaw;\n\tconst inheritedGapForSingleInput =\n\t\t! isAxialGap && typeof inheritedGapRaw === 'object'\n\t\t\t? inheritedGapRaw?.top\n\t\t\t: inheritedGapRaw;\n\t// Merge local-then-inherited so SpacingSizesControl's chip slider and\n\t// the axial-gap BoxControl reflect the local value when set and fall\n\t// back to the inherited value at rest.\n\tconst gapRawForDisplay = hasValue( value?.spacing?.blockGap )\n\t\t? localGapRaw\n\t\t: inheritedGapRaw;\n\tconst gapValues = splitGapValue( gapRawForDisplay, isAxialGap );\n\t// Placeholder state for the single-input (non-axial, non-preset) blockGap\n\t// path. The axial / preset paths render compound or chip controls without\n\t// a native placeholder slot — the displayed `values` themselves are the\n\t// at-rest cue for those.\n\tconst isGapPlaceholder =\n\t\t! hasValue( value?.spacing?.blockGap ) &&\n\t\ttypeof inheritedGapForSingleInput === 'string' &&\n\t\tinheritedGapForSingleInput !== '';\n\tconst setGapValue = ( newGapValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'spacing', 'blockGap' ], newGapValue )\n\t\t);\n\t};\n\tconst setGapValues = ( nextBoxGapValue ) => {\n\t\tif ( ! hasValue( nextBoxGapValue ) ) {\n\t\t\tsetGapValue( null );\n\t\t}\n\t\t// If axial gap is not enabled, treat the 'top' value as the shorthand gap value.\n\t\tif ( ! isAxialGap && nextBoxGapValue?.hasOwnProperty( 'top' ) ) {\n\t\t\tsetGapValue( nextBoxGapValue.top );\n\t\t} else {\n\t\t\tsetGapValue( {\n\t\t\t\ttop: nextBoxGapValue?.top,\n\t\t\t\tleft: nextBoxGapValue?.left,\n\t\t\t} );\n\t\t}\n\t};\n\tconst resetGapValue = () => setGapValue( undefined );\n\tconst hasGapValue = () => hasValue( value?.spacing?.blockGap );\n\n\t// Min Height\n\tconst showMinHeightControl = hasMinHeight( settings );\n\tconst localMinHeightValue = decodeValue( value?.dimensions?.minHeight );\n\tconst inheritedMinHeightValue = decodeValue(\n\t\tinheritedValue?.dimensions?.minHeight\n\t);\n\tconst isMinHeightPlaceholder =\n\t\t! hasValue( value?.dimensions?.minHeight ) &&\n\t\thasValue( inheritedMinHeightValue );\n\tconst setMinHeightValue = ( newValue ) => {\n\t\tconst tempValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'dimensions', 'minHeight' ],\n\t\t\tnewValue\n\t\t);\n\t\t// Apply min-height, while removing any applied aspect ratio.\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\ttempValue,\n\t\t\t\t[ 'dimensions', 'aspectRatio' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\t};\n\tconst resetMinHeightValue = () => {\n\t\tsetMinHeightValue( undefined );\n\t};\n\tconst hasMinHeightValue = () => hasValue( value?.dimensions?.minHeight );\n\n\t// Height\n\tconst showHeightControl = hasHeight( settings );\n\tconst localHeightValue = decodeValue( value?.dimensions?.height );\n\tconst inheritedHeightValue = decodeValue(\n\t\tinheritedValue?.dimensions?.height\n\t);\n\tconst isHeightPlaceholder =\n\t\t! hasValue( value?.dimensions?.height ) &&\n\t\thasValue( inheritedHeightValue );\n\tconst setHeightValue = ( newValue ) => {\n\t\tconst tempValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'dimensions', 'height' ],\n\t\t\tnewValue\n\t\t);\n\t\t// Apply height, while removing any applied aspect ratio.\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\ttempValue,\n\t\t\t\t[ 'dimensions', 'aspectRatio' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\t};\n\tconst resetHeightValue = () => {\n\t\tsetHeightValue( undefined );\n\t};\n\tconst hasHeightValue = () => hasValue( value?.dimensions?.height );\n\n\t// Min Width\n\tconst showMinWidthControl = hasMinWidth( settings );\n\tconst localMinWidthValue = decodeValue( value?.dimensions?.minWidth );\n\tconst inheritedMinWidthValue = decodeValue(\n\t\tinheritedValue?.dimensions?.minWidth\n\t);\n\tconst isMinWidthPlaceholder =\n\t\t! hasValue( value?.dimensions?.minWidth ) &&\n\t\thasValue( inheritedMinWidthValue );\n\tconst setMinWidthValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'dimensions', 'minWidth' ], newValue )\n\t\t);\n\t};\n\tconst resetMinWidthValue = () => {\n\t\tsetMinWidthValue( undefined );\n\t};\n\tconst hasMinWidthValue = () => hasValue( value?.dimensions?.minWidth );\n\n\t// Width\n\tconst showWidthControl = hasWidth( settings );\n\tconst localWidthValue = decodeValue( value?.dimensions?.width );\n\tconst inheritedWidthValue = decodeValue(\n\t\tinheritedValue?.dimensions?.width\n\t);\n\tconst isWidthPlaceholder =\n\t\t! hasValue( value?.dimensions?.width ) &&\n\t\thasValue( inheritedWidthValue );\n\tconst setWidthValue = ( newValue ) => {\n\t\tonChange( setImmutably( value, [ 'dimensions', 'width' ], newValue ) );\n\t};\n\tconst resetWidthValue = () => {\n\t\tsetWidthValue( undefined );\n\t};\n\tconst hasWidthValue = () => hasValue( value?.dimensions?.width );\n\n\t// Aspect Ratio\n\tconst showAspectRatioControl = hasAspectRatio( settings, styleState );\n\tconst localAspectRatioValue = decodeValue( value?.dimensions?.aspectRatio );\n\tconst inheritedAspectRatioValue = decodeValue(\n\t\tinheritedValue?.dimensions?.aspectRatio\n\t);\n\tconst aspectRatioValue = localAspectRatioValue ?? inheritedAspectRatioValue;\n\tconst isAspectRatioPlaceholder =\n\t\t! hasValue( value?.dimensions?.aspectRatio ) &&\n\t\thasValue( inheritedAspectRatioValue );\n\tconst setAspectRatioValue = ( newValue ) => {\n\t\tconst tempValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'dimensions', 'aspectRatio' ],\n\t\t\tnewValue\n\t\t);\n\t\t// Apply aspect-ratio, while removing any applied min-height.\n\t\tonChange(\n\t\t\tsetImmutably( tempValue, [ 'dimensions', 'minHeight' ], undefined )\n\t\t);\n\t};\n\tconst hasAspectRatioValue = () =>\n\t\thasValue( value?.dimensions?.aspectRatio );\n\n\t// Child Layout. There is no Global Styles inheritance model for the\n\t// child-layout sub-keys (`selfStretch`, `flexSize`, `columnStart`,\n\t// `rowStart`, `columnSpan`, `rowSpan`); they are per-block attributes\n\t// only. Render the local value directly so user-set overrides are\n\t// reflected in the control rather than washed out by a misshapen\n\t// inherited layout payload.\n\tconst showChildLayoutControl = hasChildLayout( settings, styleState );\n\tconst childLayout = value?.layout;\n\n\tconst setChildLayout = ( newChildLayout ) => {\n\t\tonChange( {\n\t\t\t...value,\n\t\t\tlayout: {\n\t\t\t\t...value?.layout,\n\t\t\t\t...newChildLayout,\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst onMouseLeaveControls = () => onVisualize( false );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ ( showContentSizeControl || showWideSizeControl ) && (\n\t\t\t\t<span className=\"span-columns\">\n\t\t\t\t\t{ __( 'Set the width of the main content area.' ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t{ showContentSizeControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisContentSizePlaceholder,\n\t\t\t\t\t\thasUserSetContentSizeValue() &&\n\t\t\t\t\t\t\tinheritedContentSizeValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Content width' ) }\n\t\t\t\t\thasValue={ hasUserSetContentSizeValue }\n\t\t\t\t\tonDeselect={ resetContentSizeValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.contentSize ??\n\t\t\t\t\t\tDEFAULT_CONTROLS.contentSize\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tlabel={ __( 'Content width' ) }\n\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// (e.g. \"620px\" keeps its unit rather than the value\n\t\t\t\t\t\t// string sitting greyed-out behind a default px unit). It\n\t\t\t\t\t\t// is only written to local on user change.\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tlocalContentSizeValue ?? inheritedContentSizeValue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisContentSizePlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedContentSizeValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( nextContentSize ) => {\n\t\t\t\t\t\t\tsetContentSizeValue( nextContentSize );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\t<InputControlPrefixWrapper variant=\"icon\">\n\t\t\t\t\t\t\t\t<Icon icon={ alignNone } />\n\t\t\t\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showWideSizeControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisWideSizePlaceholder,\n\t\t\t\t\t\thasUserSetWideSizeValue() &&\n\t\t\t\t\t\t\tinheritedWideSizeValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Wide width' ) }\n\t\t\t\t\thasValue={ hasUserSetWideSizeValue }\n\t\t\t\t\tonDeselect={ resetWideSizeValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.wideSize ?? DEFAULT_CONTROLS.wideSize\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tlabel={ __( 'Wide width' ) }\n\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// rather than the value string sitting greyed-out behind\n\t\t\t\t\t\t// a default px unit. It is only written to local on user\n\t\t\t\t\t\t// change.\n\t\t\t\t\t\tvalue={ localWideSizeValue ?? inheritedWideSizeValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisWideSizePlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedWideSizeValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( nextWideSize ) => {\n\t\t\t\t\t\t\tsetWideSizeValue( nextWideSize );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\t<InputControlPrefixWrapper variant=\"icon\">\n\t\t\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showPaddingControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\thasValue={ hasPaddingValue }\n\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\thasInlineEndToggle={ hasSpacingToggle(\n\t\t\t\t\t\tpaddingSides,\n\t\t\t\t\t\tshowSpacingPresetsControl\n\t\t\t\t\t) }\n\t\t\t\t\tonDeselect={ resetPaddingValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.padding ?? DEFAULT_CONTROLS.padding\n\t\t\t\t\t}\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisPaddingInherited,\n\t\t\t\t\t\thasPaddingValue() && hasInheritedPadding,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'tools-panel-item-spacing':\n\t\t\t\t\t\t\t\tshowSpacingPresetsControl,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ localPaddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialPadding }\n\t\t\t\t\t\t\tinputProps={ {\n\t\t\t\t\t\t\t\tonMouseOver: onMouseOverPadding,\n\t\t\t\t\t\t\t\tonMouseOut: onMouseLeaveControls,\n\t\t\t\t\t\t\t\tplaceholder: isPaddingPlaceholder\n\t\t\t\t\t\t\t\t\t? inheritedPaddingPlaceholder\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ paddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tonMouseOver={ onMouseOverPadding }\n\t\t\t\t\t\t\tonMouseOut={ onMouseLeaveControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMarginControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\thasValue={ hasMarginValue }\n\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\thasInlineEndToggle={ hasSpacingToggle(\n\t\t\t\t\t\tmarginSides,\n\t\t\t\t\t\tshowSpacingPresetsControl\n\t\t\t\t\t) }\n\t\t\t\t\tonDeselect={ resetMarginValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.margin ?? DEFAULT_CONTROLS.margin\n\t\t\t\t\t}\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisMarginInherited,\n\t\t\t\t\t\thasMarginValue() && hasInheritedMargin,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'tools-panel-item-spacing':\n\t\t\t\t\t\t\t\tshowSpacingPresetsControl,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ localMarginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tinputProps={ {\n\t\t\t\t\t\t\t\tmin: minMarginValue,\n\t\t\t\t\t\t\t\tonDragStart: () => {\n\t\t\t\t\t\t\t\t\t// Reset to 0 in case the value was negative.\n\t\t\t\t\t\t\t\t\tsetMinMarginValue( 0 );\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonDragEnd: () => {\n\t\t\t\t\t\t\t\t\tsetMinMarginValue( minimumMargin );\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonMouseOver: onMouseOverMargin,\n\t\t\t\t\t\t\t\tonMouseOut: onMouseLeaveControls,\n\t\t\t\t\t\t\t\tplaceholder: isMarginPlaceholder\n\t\t\t\t\t\t\t\t\t? inheritedMarginPlaceholder\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialMargin }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ marginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tminimumCustomValue={ -Infinity }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tonMouseOver={ onMouseOverMargin }\n\t\t\t\t\t\t\tonMouseOut={ onMouseLeaveControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showGapControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\thasValue={ hasGapValue }\n\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\thasInlineEndToggle={ isAxialGap }\n\t\t\t\t\tonDeselect={ resetGapValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.blockGap ?? DEFAULT_CONTROLS.blockGap\n\t\t\t\t\t}\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisGapPlaceholder,\n\t\t\t\t\t\thasGapValue() && inheritedGapRaw !== undefined,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'tools-panel-item-spacing':\n\t\t\t\t\t\t\t\tshowSpacingPresetsControl,\n\t\t\t\t\t\t\t'single-column':\n\t\t\t\t\t\t\t\t// If UnitControl is used, should be single-column.\n\t\t\t\t\t\t\t\t! showSpacingPresetsControl && ! isAxialGap,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl &&\n\t\t\t\t\t\t( isAxialGap ? (\n\t\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tsides={ gapSides }\n\t\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\tsplitOnAxis={ isAxialGap }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValue }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tvalue={ localGapForSingleInput ?? undefined }\n\t\t\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t\t\tisGapPlaceholder\n\t\t\t\t\t\t\t\t\t\t? inheritedGapForSingleInput\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tkey={ isAxialGap ? 'axial-gap' : 'single-gap' }\n\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\tshowSideInLabel={ false }\n\t\t\t\t\t\t\tsides={ isAxialGap ? gapSides : [ 'top' ] } // Use 'top' as the shorthand property in non-axial configurations.\n\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showChildLayoutControl && (\n\t\t\t\t<ChildLayoutControl\n\t\t\t\t\tvalue={ childLayout }\n\t\t\t\t\tonChange={ setChildLayout }\n\t\t\t\t\tparentLayout={ settings?.parentLayout }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\tshowGridSpanDefaults={\n\t\t\t\t\t\t! hasViewportBlockStyleState( styleState )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.childLayout ??\n\t\t\t\t\t\tDEFAULT_CONTROLS.childLayout\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showMinHeightControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisMinHeightPlaceholder,\n\t\t\t\t\t\thasMinHeightValue() &&\n\t\t\t\t\t\t\tinheritedMinHeightValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasMinHeightValue }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ resetMinHeightValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.minHeight ?? DEFAULT_CONTROLS.minHeight\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// (e.g. \"120px\" keeps its unit rather than the value\n\t\t\t\t\t\t// string sitting behind a default px unit). It is only\n\t\t\t\t\t\t// written to local on user change.\n\t\t\t\t\t\tvalue={ localMinHeightValue ?? inheritedMinHeightValue }\n\t\t\t\t\t\tonChange={ setMinHeightValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisMinHeightPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedMinHeightValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMinWidthControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisMinWidthPlaceholder,\n\t\t\t\t\t\thasMinWidthValue() &&\n\t\t\t\t\t\t\tinheritedMinWidthValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasMinWidthValue }\n\t\t\t\t\tlabel={ __( 'Minimum width' ) }\n\t\t\t\t\tonDeselect={ resetMinWidthValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.minWidth ?? DEFAULT_CONTROLS.minWidth\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Minimum width' ) }\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as the\n\t\t\t\t\t\t// control's value at rest so the unit parses from it\n\t\t\t\t\t\t// rather than the value string sitting behind a default\n\t\t\t\t\t\t// px unit. It is only written to local on user change.\n\t\t\t\t\t\tvalue={ localMinWidthValue ?? inheritedMinWidthValue }\n\t\t\t\t\t\tonChange={ setMinWidthValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisMinWidthPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedMinWidthValue\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showHeightControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisHeightPlaceholder,\n\t\t\t\t\t\thasHeightValue() && inheritedHeightValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasHeightValue }\n\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\tonDeselect={ resetHeightValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.height ?? DEFAULT_CONTROLS.height\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\tvalue={ localHeightValue }\n\t\t\t\t\t\tonChange={ setHeightValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisHeightPlaceholder\n\t\t\t\t\t\t\t\t? inheritedHeightValue\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showWidthControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisWidthPlaceholder,\n\t\t\t\t\t\thasWidthValue() && inheritedWidthValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\thasValue={ hasWidthValue }\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tonDeselect={ resetWidthValue }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.width ?? DEFAULT_CONTROLS.width\n\t\t\t\t\t}\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<DimensionControl\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tvalue={ localWidthValue }\n\t\t\t\t\t\tonChange={ setWidthValue }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisWidthPlaceholder ? inheritedWidthValue : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdimensionSizes={ dimensions?.dimensionSizes }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showAspectRatioControl && (\n\t\t\t\t<AspectRatioTool\n\t\t\t\t\thasValue={ hasAspectRatioValue }\n\t\t\t\t\tvalue={ aspectRatioValue }\n\t\t\t\t\tonChange={ setAspectRatioValue }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisAspectRatioPlaceholder,\n\t\t\t\t\t\thasAspectRatioValue() &&\n\t\t\t\t\t\t\tinheritedAspectRatioValue !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tisShownByDefault={\n\t\t\t\t\t\tdefaultControls.aspectRatio ??\n\t\t\t\t\t\tDEFAULT_CONTROLS.aspectRatio\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAA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AAAA,YAE5C;AAAA,YAEA;AAAA,cAAC,yBAAAA;AAAA,cAAA;AAAA,gBACA,WAAQ,gBAAI,QAAS;AAAA,gBACrB,OAAQ;AAAA,gBACR,UAAW;AAAA,gBACX,aACC,sBACG,uBACA;AAAA,gBAEJ,gBAAiB,YAAY;AAAA;AAAA,YAC9B;AAAA;AAAA,QACD;AAAA,QAEC,oBACD;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,cACJ;AAAA,cACA,cAAc,KAAK,wBAAwB;AAAA,YAC5C;AAAA,YACA,UAAW;AAAA,YACX,WAAQ,gBAAI,OAAQ;AAAA,YACpB,YAAa;AAAA,YACb,kBACC,gBAAgB,SAAS,iBAAiB;AAAA,YAE3C;AAAA,YAEA;AAAA,cAAC,yBAAAA;AAAA,cAAA;AAAA,gBACA,WAAQ,gBAAI,OAAQ;AAAA,gBACpB,OAAQ;AAAA,gBACR,UAAW;AAAA,gBACX,aACC,qBAAqB,sBAAsB;AAAA,gBAE5C,gBAAiB,YAAY;AAAA;AAAA,YAC9B;AAAA;AAAA,QACD;AAAA,QAEC,0BACD;AAAA,UAAC,yBAAAC;AAAA,UAAA;AAAA,YACA,UAAW;AAAA,YACX,OAAQ;AAAA,YACR,UAAW;AAAA,YACX;AAAA,YACE,GAAG;AAAA,cACJ;AAAA,cACA,oBAAoB,KACnB,8BAA8B;AAAA,YAChC;AAAA,YACA,kBACC,gBAAgB,eAChB,iBAAiB;AAAA;AAAA,QAEnB;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": ["import_utils", "parseQuantityAndUnitFromRawValue", "ToolsPanel", "useCustomUnits", "UnitControl", "InputControlPrefixWrapper", "SpacingSizesControl", "ChildLayoutControl", "DimensionControl", "AspectRatioTool"]
|
|
7
7
|
}
|
|
@@ -182,22 +182,25 @@ function FiltersPanel({
|
|
|
182
182
|
const localDuotone = decodeValue(value?.filter?.duotone);
|
|
183
183
|
const inheritedDuotone = decodeValue(inheritedValue?.filter?.duotone);
|
|
184
184
|
const duotone = localDuotone ?? inheritedDuotone;
|
|
185
|
+
const localDuotoneSlug = (0, import_utils.getDuotoneSlugFromPreset)(value?.filter?.duotone);
|
|
186
|
+
const inheritedDuotoneSlug = (0, import_utils.getDuotoneSlugFromPreset)(
|
|
187
|
+
inheritedValue?.filter?.duotone
|
|
188
|
+
);
|
|
189
|
+
const duotoneSlug = localDuotone !== void 0 ? localDuotoneSlug : inheritedDuotoneSlug;
|
|
185
190
|
const isDuotonePlaceholder = localDuotone === void 0 && inheritedDuotone !== void 0;
|
|
186
|
-
const setDuotone = (newValue) => {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
});
|
|
190
|
-
const duotoneValue = duotonePreset ? `var:preset|duotone|${duotonePreset.slug}` : newValue;
|
|
191
|
+
const setDuotone = (newValue, slug) => {
|
|
192
|
+
const presetSlug = slug ?? duotonePalette.find(({ colors }) => colors === newValue)?.slug;
|
|
193
|
+
const duotoneValue = presetSlug ? `var:preset|duotone|${presetSlug}` : newValue;
|
|
191
194
|
onChange(
|
|
192
195
|
(0, import_object.setImmutably)(value, ["filter", "duotone"], duotoneValue)
|
|
193
196
|
);
|
|
194
197
|
};
|
|
195
|
-
const setDuotoneWithInheritedCommit = (newValue) => {
|
|
198
|
+
const setDuotoneWithInheritedCommit = (newValue, index, slug) => {
|
|
196
199
|
if (newValue === void 0 && isDuotonePlaceholder && inheritedDuotone !== void 0) {
|
|
197
|
-
setDuotone(inheritedDuotone);
|
|
200
|
+
setDuotone(inheritedDuotone, inheritedDuotoneSlug);
|
|
198
201
|
return;
|
|
199
202
|
}
|
|
200
|
-
setDuotone(newValue);
|
|
203
|
+
setDuotone(newValue, slug);
|
|
201
204
|
};
|
|
202
205
|
const hasDuotone = () => !!value?.filter?.duotone;
|
|
203
206
|
const resetDuotone = () => setDuotone(void 0);
|
|
@@ -253,6 +256,7 @@ function FiltersPanel({
|
|
|
253
256
|
disableCustomColors: true,
|
|
254
257
|
disableCustomDuotone: true,
|
|
255
258
|
value: duotone,
|
|
259
|
+
selectedSlug: duotoneSlug,
|
|
256
260
|
onChange: setDuotoneWithInheritedCommit
|
|
257
261
|
}
|
|
258
262
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/global-styles/filters-panel.js"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalHStack as HStack, // eslint-disable-line @wordpress/use-recommended-components\n\t__experimentalZStack as ZStack, // eslint-disable-line @wordpress/use-recommended-components\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tMenuGroup,\n\tColorIndicator,\n\tDuotonePicker,\n\tDuotoneSwatch,\n\tDropdown,\n\tFlex,\n\tFlexItem,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useCallback, useMemo, useRef } from '@wordpress/element';\nimport { reset as resetIcon } from '@wordpress/icons';\nimport { getValueFromVariable } from '@wordpress/global-styles-engine';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\tgetInheritanceProps,\n\tInheritanceToolsPanelItem,\n\tInheritanceResetButton,\n\tisGlobalStylesInheritanceEnabled,\n} from './inheritance';\n\nconst EMPTY_ARRAY = [];\nfunction useMultiOriginColorPresets(\n\tsettings,\n\t{ presetSetting, defaultSetting }\n) {\n\tconst disableDefault = ! settings?.color?.[ defaultSetting ];\n\tconst userPresets =\n\t\tsettings?.color?.[ presetSetting ]?.custom || EMPTY_ARRAY;\n\tconst themePresets =\n\t\tsettings?.color?.[ presetSetting ]?.theme || EMPTY_ARRAY;\n\tconst defaultPresets =\n\t\tsettings?.color?.[ presetSetting ]?.default || EMPTY_ARRAY;\n\treturn useMemo(\n\t\t() => [\n\t\t\t...userPresets,\n\t\t\t...themePresets,\n\t\t\t...( disableDefault ? EMPTY_ARRAY : defaultPresets ),\n\t\t],\n\t\t[ disableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function useHasFiltersPanel( settings ) {\n\treturn useHasDuotoneControl( settings );\n}\n\nfunction useHasDuotoneControl( settings ) {\n\treturn (\n\t\tsettings.color.customDuotone ||\n\t\tsettings.color.defaultDuotone ||\n\t\tsettings.color.duotone.length > 0\n\t);\n}\n\nfunction FiltersToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ _x( 'Filters', 'Name for applying graphical effects' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\tduotone: true,\n};\n\nconst popoverProps = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n\tclassName: 'block-editor-duotone-control__popover',\n\theaderTitle: __( 'Duotone' ),\n};\n\nconst LabeledColorIndicator = ( { indicator, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t<Flex expanded={ false }>\n\t\t\t\t{ indicator === 'unset' || ! indicator ? (\n\t\t\t\t\t<ColorIndicator className=\"block-editor-duotone-control__unset-indicator\" />\n\t\t\t\t) : (\n\t\t\t\t\t<DuotoneSwatch values={ indicator } />\n\t\t\t\t) }\n\t\t\t</Flex>\n\t\t</ZStack>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-duotone-settings__label\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\nconst renderToggle = ( duotone, resetConfig ) =>\n\tfunction Toggle( { onToggle, isOpen } ) {\n\t\tconst { hasLocalValue, hasLocalOverride, onReset } = resetConfig;\n\t\tconst duotoneButtonRef = useRef( undefined );\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx(\n\t\t\t\t'block-editor-global-styles-filters-panel__dropdown-toggle',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t\tref: duotoneButtonRef,\n\t\t};\n\n\t\tconst handleReset = () => {\n\t\t\tif ( isOpen ) {\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t\tonReset();\n\t\t\t// Return focus to parent button.\n\t\t\tduotoneButtonRef.current?.focus();\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button __next40pxDefaultSize { ...toggleProps }>\n\t\t\t\t\t<LabeledColorIndicator\n\t\t\t\t\t\tindicator={ duotone }\n\t\t\t\t\t\tlabel={ __( 'Duotone' ) }\n\t\t\t\t\t/>\n\t\t\t\t</Button>\n\t\t\t\t{ hasLocalValue &&\n\t\t\t\t\t( hasLocalOverride ? (\n\t\t\t\t\t\t<InheritanceResetButton\n\t\t\t\t\t\t\tclassName=\"block-editor-panel-duotone-settings__reset\"\n\t\t\t\t\t\t\tonResetToInherited={ handleReset }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Reset' ) }\n\t\t\t\t\t\t\tclassName=\"block-editor-panel-duotone-settings__reset\"\n\t\t\t\t\t\t\tonClick={ handleReset }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t</>\n\t\t);\n\t};\n\nexport default function FiltersPanel( {\n\tas: Wrapper = FiltersToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tshowInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),\n} ) {\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\t// Always keep the layout className (e.g. `single-column`); only the\n\t// inheritance treatment is gated on `showInheritanceLabelIndicators`.\n\tconst inheritanceProps = ( isInherited, hasLocalOverride, className ) =>\n\t\tgetInheritanceProps(\n\t\t\tshowInheritanceLabelIndicators && isInherited,\n\t\t\tshowInheritanceLabelIndicators && hasLocalOverride,\n\t\t\tclassName\n\t\t);\n\n\t// Duotone\n\tconst hasDuotoneEnabled = useHasDuotoneControl( settings );\n\tconst duotonePalette = useMultiOriginColorPresets( settings, {\n\t\tpresetSetting: 'duotone',\n\t\tdefaultSetting: 'defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginColorPresets( settings, {\n\t\tpresetSetting: 'palette',\n\t\tdefaultSetting: 'defaultPalette',\n\t} );\n\tconst localDuotone = decodeValue( value?.filter?.duotone );\n\tconst inheritedDuotone = decodeValue( inheritedValue?.filter?.duotone );\n\tconst duotone = localDuotone ?? inheritedDuotone;\n\tconst isDuotonePlaceholder =\n\t\tlocalDuotone === undefined && inheritedDuotone !== undefined;\n\tconst setDuotone = ( newValue ) => {\n\t\tconst duotonePreset = duotonePalette.find( ( { colors } ) => {\n\t\t\treturn colors === newValue;\n\t\t} );\n\t\tconst duotoneValue = duotonePreset\n\t\t\t? `var:preset|duotone|${ duotonePreset.slug }`\n\t\t\t: newValue;\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'filter', 'duotone' ], duotoneValue )\n\t\t);\n\t};\n\t// Commit the inherited value when the user clicks the active preset\n\t// while the picker is showing inherited duotone at rest.\n\tconst setDuotoneWithInheritedCommit = ( newValue ) => {\n\t\tif (\n\t\t\tnewValue === undefined &&\n\t\t\tisDuotonePlaceholder &&\n\t\t\tinheritedDuotone !== undefined\n\t\t) {\n\t\t\tsetDuotone( inheritedDuotone );\n\t\t\treturn;\n\t\t}\n\t\tsetDuotone( newValue );\n\t};\n\tconst hasDuotone = () => !! value?.filter?.duotone;\n\tconst resetDuotone = () => setDuotone( undefined );\n\t// Only a local value shadowing an inherited one shows the blue-dot reset.\n\tconst hasDuotoneLocalOverride =\n\t\tshowInheritanceLabelIndicators &&\n\t\thasDuotone() &&\n\t\tinheritedDuotone !== undefined;\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tfilter: {\n\t\t\t\t...previousValue.filter,\n\t\t\t\tduotone: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ hasDuotoneEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisDuotonePlaceholder,\n\t\t\t\t\t\tlocalDuotone !== undefined &&\n\t\t\t\t\t\t\tinheritedDuotone !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Duotone' ) }\n\t\t\t\t\thasValue={ hasDuotone }\n\t\t\t\t\tonDeselect={ resetDuotone }\n\t\t\t\t\tisShownByDefault={ defaultControls.duotone }\n\t\t\t\t\t// Toggle renders its own reset dot, so the item must not\n\t\t\t\t\t// add a second.\n\t\t\t\t\tshowLocalOverrideActionsInLabel={ false }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-filters-panel__dropdown\"\n\t\t\t\t\t\trenderToggle={ renderToggle( duotone, {\n\t\t\t\t\t\t\thasLocalValue: hasDuotone(),\n\t\t\t\t\t\t\thasLocalOverride: hasDuotoneLocalOverride,\n\t\t\t\t\t\t\tonReset: resetDuotone,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"small\">\n\t\t\t\t\t\t\t\t<MenuGroup label={ __( 'Duotone' ) }>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'Create a two-tone color effect without losing your original image.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\t\t\t\t\t// TODO: Re-enable both when custom colors are supported for block-level styles.\n\t\t\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\t\t\tdisableCustomDuotone\n\t\t\t\t\t\t\t\t\t\tvalue={ duotone }\n\t\t\t\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\t\t\t\tsetDuotoneWithInheritedCommit\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,wBAaO;AACP,kBAAuB;AACvB,qBAA6C;AAC7C,mBAAmC;AACnC,kCAAqC;AACrC,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalHStack as HStack, // eslint-disable-line @wordpress/use-recommended-components\n\t__experimentalZStack as ZStack, // eslint-disable-line @wordpress/use-recommended-components\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tMenuGroup,\n\tColorIndicator,\n\tDuotonePicker,\n\tDuotoneSwatch,\n\tDropdown,\n\tFlex,\n\tFlexItem,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useCallback, useMemo, useRef } from '@wordpress/element';\nimport { reset as resetIcon } from '@wordpress/icons';\nimport { getValueFromVariable } from '@wordpress/global-styles-engine';\nimport {\n\tuseToolsPanelDropdownMenuProps,\n\tgetDuotoneSlugFromPreset,\n} from './utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\tgetInheritanceProps,\n\tInheritanceToolsPanelItem,\n\tInheritanceResetButton,\n\tisGlobalStylesInheritanceEnabled,\n} from './inheritance';\n\nconst EMPTY_ARRAY = [];\nfunction useMultiOriginColorPresets(\n\tsettings,\n\t{ presetSetting, defaultSetting }\n) {\n\tconst disableDefault = ! settings?.color?.[ defaultSetting ];\n\tconst userPresets =\n\t\tsettings?.color?.[ presetSetting ]?.custom || EMPTY_ARRAY;\n\tconst themePresets =\n\t\tsettings?.color?.[ presetSetting ]?.theme || EMPTY_ARRAY;\n\tconst defaultPresets =\n\t\tsettings?.color?.[ presetSetting ]?.default || EMPTY_ARRAY;\n\treturn useMemo(\n\t\t() => [\n\t\t\t...userPresets,\n\t\t\t...themePresets,\n\t\t\t...( disableDefault ? EMPTY_ARRAY : defaultPresets ),\n\t\t],\n\t\t[ disableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function useHasFiltersPanel( settings ) {\n\treturn useHasDuotoneControl( settings );\n}\n\nfunction useHasDuotoneControl( settings ) {\n\treturn (\n\t\tsettings.color.customDuotone ||\n\t\tsettings.color.defaultDuotone ||\n\t\tsettings.color.duotone.length > 0\n\t);\n}\n\nfunction FiltersToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ _x( 'Filters', 'Name for applying graphical effects' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\tduotone: true,\n};\n\nconst popoverProps = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n\tclassName: 'block-editor-duotone-control__popover',\n\theaderTitle: __( 'Duotone' ),\n};\n\nconst LabeledColorIndicator = ( { indicator, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t<Flex expanded={ false }>\n\t\t\t\t{ indicator === 'unset' || ! indicator ? (\n\t\t\t\t\t<ColorIndicator className=\"block-editor-duotone-control__unset-indicator\" />\n\t\t\t\t) : (\n\t\t\t\t\t<DuotoneSwatch values={ indicator } />\n\t\t\t\t) }\n\t\t\t</Flex>\n\t\t</ZStack>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-duotone-settings__label\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\nconst renderToggle = ( duotone, resetConfig ) =>\n\tfunction Toggle( { onToggle, isOpen } ) {\n\t\tconst { hasLocalValue, hasLocalOverride, onReset } = resetConfig;\n\t\tconst duotoneButtonRef = useRef( undefined );\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx(\n\t\t\t\t'block-editor-global-styles-filters-panel__dropdown-toggle',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t\tref: duotoneButtonRef,\n\t\t};\n\n\t\tconst handleReset = () => {\n\t\t\tif ( isOpen ) {\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t\tonReset();\n\t\t\t// Return focus to parent button.\n\t\t\tduotoneButtonRef.current?.focus();\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button __next40pxDefaultSize { ...toggleProps }>\n\t\t\t\t\t<LabeledColorIndicator\n\t\t\t\t\t\tindicator={ duotone }\n\t\t\t\t\t\tlabel={ __( 'Duotone' ) }\n\t\t\t\t\t/>\n\t\t\t\t</Button>\n\t\t\t\t{ hasLocalValue &&\n\t\t\t\t\t( hasLocalOverride ? (\n\t\t\t\t\t\t<InheritanceResetButton\n\t\t\t\t\t\t\tclassName=\"block-editor-panel-duotone-settings__reset\"\n\t\t\t\t\t\t\tonResetToInherited={ handleReset }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Reset' ) }\n\t\t\t\t\t\t\tclassName=\"block-editor-panel-duotone-settings__reset\"\n\t\t\t\t\t\t\tonClick={ handleReset }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t</>\n\t\t);\n\t};\n\nexport default function FiltersPanel( {\n\tas: Wrapper = FiltersToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tshowInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),\n} ) {\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\t// Always keep the layout className (e.g. `single-column`); only the\n\t// inheritance treatment is gated on `showInheritanceLabelIndicators`.\n\tconst inheritanceProps = ( isInherited, hasLocalOverride, className ) =>\n\t\tgetInheritanceProps(\n\t\t\tshowInheritanceLabelIndicators && isInherited,\n\t\t\tshowInheritanceLabelIndicators && hasLocalOverride,\n\t\t\tclassName\n\t\t);\n\n\t// Duotone\n\tconst hasDuotoneEnabled = useHasDuotoneControl( settings );\n\tconst duotonePalette = useMultiOriginColorPresets( settings, {\n\t\tpresetSetting: 'duotone',\n\t\tdefaultSetting: 'defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginColorPresets( settings, {\n\t\tpresetSetting: 'palette',\n\t\tdefaultSetting: 'defaultPalette',\n\t} );\n\tconst localDuotone = decodeValue( value?.filter?.duotone );\n\tconst inheritedDuotone = decodeValue( inheritedValue?.filter?.duotone );\n\tconst duotone = localDuotone ?? inheritedDuotone;\n\t// Read from the raw value, since decoding resolves a preset reference to\n\t// its colors and two presets can hold the same pair.\n\tconst localDuotoneSlug = getDuotoneSlugFromPreset( value?.filter?.duotone );\n\tconst inheritedDuotoneSlug = getDuotoneSlugFromPreset(\n\t\tinheritedValue?.filter?.duotone\n\t);\n\tconst duotoneSlug =\n\t\tlocalDuotone !== undefined ? localDuotoneSlug : inheritedDuotoneSlug;\n\tconst isDuotonePlaceholder =\n\t\tlocalDuotone === undefined && inheritedDuotone !== undefined;\n\tconst setDuotone = ( newValue, slug ) => {\n\t\t// A slug identifies the picked preset exactly. Falling back to a value\n\t\t// match cannot tell two presets holding the same colors apart.\n\t\tconst presetSlug =\n\t\t\tslug ??\n\t\t\tduotonePalette.find( ( { colors } ) => colors === newValue )?.slug;\n\t\tconst duotoneValue = presetSlug\n\t\t\t? `var:preset|duotone|${ presetSlug }`\n\t\t\t: newValue;\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'filter', 'duotone' ], duotoneValue )\n\t\t);\n\t};\n\t// Commit the inherited value when the user clicks the active preset\n\t// while the picker is showing inherited duotone at rest.\n\tconst setDuotoneWithInheritedCommit = ( newValue, index, slug ) => {\n\t\tif (\n\t\t\tnewValue === undefined &&\n\t\t\tisDuotonePlaceholder &&\n\t\t\tinheritedDuotone !== undefined\n\t\t) {\n\t\t\tsetDuotone( inheritedDuotone, inheritedDuotoneSlug );\n\t\t\treturn;\n\t\t}\n\t\tsetDuotone( newValue, slug );\n\t};\n\tconst hasDuotone = () => !! value?.filter?.duotone;\n\tconst resetDuotone = () => setDuotone( undefined );\n\t// Only a local value shadowing an inherited one shows the blue-dot reset.\n\tconst hasDuotoneLocalOverride =\n\t\tshowInheritanceLabelIndicators &&\n\t\thasDuotone() &&\n\t\tinheritedDuotone !== undefined;\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tfilter: {\n\t\t\t\t...previousValue.filter,\n\t\t\t\tduotone: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ hasDuotoneEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisDuotonePlaceholder,\n\t\t\t\t\t\tlocalDuotone !== undefined &&\n\t\t\t\t\t\t\tinheritedDuotone !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Duotone' ) }\n\t\t\t\t\thasValue={ hasDuotone }\n\t\t\t\t\tonDeselect={ resetDuotone }\n\t\t\t\t\tisShownByDefault={ defaultControls.duotone }\n\t\t\t\t\t// Toggle renders its own reset dot, so the item must not\n\t\t\t\t\t// add a second.\n\t\t\t\t\tshowLocalOverrideActionsInLabel={ false }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-filters-panel__dropdown\"\n\t\t\t\t\t\trenderToggle={ renderToggle( duotone, {\n\t\t\t\t\t\t\thasLocalValue: hasDuotone(),\n\t\t\t\t\t\t\thasLocalOverride: hasDuotoneLocalOverride,\n\t\t\t\t\t\t\tonReset: resetDuotone,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"small\">\n\t\t\t\t\t\t\t\t<MenuGroup label={ __( 'Duotone' ) }>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'Create a two-tone color effect without losing your original image.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\t\t\t\t\t// TODO: Re-enable both when custom colors are supported for block-level styles.\n\t\t\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\t\t\tdisableCustomDuotone\n\t\t\t\t\t\t\t\t\t\tvalue={ duotone }\n\t\t\t\t\t\t\t\t\t\tselectedSlug={ duotoneSlug }\n\t\t\t\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\t\t\t\tsetDuotoneWithInheritedCommit\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,wBAaO;AACP,kBAAuB;AACvB,qBAA6C;AAC7C,mBAAmC;AACnC,kCAAqC;AACrC,mBAGO;AACP,oBAA6B;AAC7B,yBAKO;A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 -48,12 +48,21 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
48
48
|
var EMPTY_ARRAY = [];
|
|
49
49
|
function ShadowPopoverContainer({ shadow, onShadowChange, settings }) {
|
|
50
50
|
const shadows = useShadowPresets(settings);
|
|
51
|
+
const presets = (0, import_element.useMemo)(() => {
|
|
52
|
+
if (!shadows.length) {
|
|
53
|
+
return shadows;
|
|
54
|
+
}
|
|
55
|
+
return [
|
|
56
|
+
{ name: (0, import_i18n.__)("Unset"), slug: "unset", shadow: "none" },
|
|
57
|
+
...shadows
|
|
58
|
+
];
|
|
59
|
+
}, [shadows]);
|
|
51
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-editor-global-styles__shadow-popover-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
52
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHeading, { level: 5, children: (0, import_i18n.__)("Drop shadow") }),
|
|
53
62
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
63
|
ShadowPresets,
|
|
55
64
|
{
|
|
56
|
-
presets
|
|
65
|
+
presets,
|
|
57
66
|
activeShadow: shadow,
|
|
58
67
|
onSelect: onShadowChange
|
|
59
68
|
}
|
|
@@ -232,20 +241,16 @@ function useShadowPresets(settings) {
|
|
|
232
241
|
theme: themeShadows,
|
|
233
242
|
custom: customShadows
|
|
234
243
|
} = settings?.shadow?.presets ?? {};
|
|
235
|
-
const
|
|
236
|
-
name: (0, import_i18n.__)("Unset"),
|
|
237
|
-
slug: "unset",
|
|
238
|
-
shadow: "none"
|
|
239
|
-
};
|
|
240
|
-
const shadowPresets = [
|
|
244
|
+
const allPresets = [
|
|
241
245
|
...defaultPresetsEnabled && defaultShadows || EMPTY_ARRAY,
|
|
242
246
|
...themeShadows || EMPTY_ARRAY,
|
|
243
247
|
...customShadows || EMPTY_ARRAY
|
|
244
248
|
];
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
return allPresets.filter(
|
|
250
|
+
(preset, index) => allPresets.findLastIndex(
|
|
251
|
+
({ slug }) => slug === preset.slug
|
|
252
|
+
) === index
|
|
253
|
+
);
|
|
249
254
|
}, [settings]);
|
|
250
255
|
}
|
|
251
256
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/global-styles/shadow-panel-components.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tButton,\n\tFlexItem,\n\tDropdown,\n\tComposite,\n} from '@wordpress/components';\nimport { useMemo, useRef } from '@wordpress/element';\nimport { shadow as shadowIcon, Icon, check, reset } from '@wordpress/icons';\nimport clsx from 'clsx';\nimport { Tooltip } from '@wordpress/ui';\nimport { InheritanceResetButton } from './inheritance';\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {\n\tconst shadows = useShadowPresets( settings );\n\n\treturn (\n\t\t<div className=\"block-editor-global-styles__shadow-popover-container\">\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<Heading level={ 5 }>{ __( 'Drop shadow' ) }</Heading>\n\t\t\t\t<ShadowPresets\n\t\t\t\t\tpresets={
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBASO;AACP,qBAAgC;AAChC,mBAAyD;AACzD,kBAAiB;AACjB,gBAAwB;AACxB,yBAAuC;
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tButton,\n\tFlexItem,\n\tDropdown,\n\tComposite,\n} from '@wordpress/components';\nimport { useMemo, useRef } from '@wordpress/element';\nimport { shadow as shadowIcon, Icon, check, reset } from '@wordpress/icons';\nimport clsx from 'clsx';\nimport { Tooltip } from '@wordpress/ui';\nimport { InheritanceResetButton } from './inheritance';\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {\n\tconst shadows = useShadowPresets( settings );\n\tconst presets = useMemo( () => {\n\t\tif ( ! shadows.length ) {\n\t\t\treturn shadows;\n\t\t}\n\t\t// The entry that clears the shadow is a display-only affordance with no\n\t\t// counterpart in `theme.json`. It is added here rather than in\n\t\t// `useShadowPresets` so that callers mapping a value back to a preset\n\t\t// never mistake it for one and persist a reference to a CSS variable\n\t\t// that is never output.\n\t\treturn [\n\t\t\t{ name: __( 'Unset' ), slug: 'unset', shadow: 'none' },\n\t\t\t...shadows,\n\t\t];\n\t}, [ shadows ] );\n\n\treturn (\n\t\t<div className=\"block-editor-global-styles__shadow-popover-container\">\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<Heading level={ 5 }>{ __( 'Drop shadow' ) }</Heading>\n\t\t\t\t<ShadowPresets\n\t\t\t\t\tpresets={ presets }\n\t\t\t\t\tactiveShadow={ shadow }\n\t\t\t\t\tonSelect={ onShadowChange }\n\t\t\t\t/>\n\t\t\t\t<div className=\"block-editor-global-styles__clear-shadow\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => onShadowChange( undefined ) }\n\t\t\t\t\t\tdisabled={ ! shadow }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport function ShadowPresets( { presets, activeShadow, onSelect } ) {\n\treturn ! presets ? null : (\n\t\t<Composite\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-global-styles__shadow__list\"\n\t\t\taria-label={ __( 'Drop shadows' ) }\n\t\t>\n\t\t\t{ presets.map( ( { name, slug, shadow } ) => (\n\t\t\t\t<ShadowIndicator\n\t\t\t\t\tkey={ slug }\n\t\t\t\t\tlabel={ name }\n\t\t\t\t\tisActive={ shadow === activeShadow }\n\t\t\t\t\ttype={ slug === 'unset' ? 'unset' : 'preset' }\n\t\t\t\t\tonSelect={ () =>\n\t\t\t\t\t\tonSelect( shadow === activeShadow ? undefined : shadow )\n\t\t\t\t\t}\n\t\t\t\t\tshadow={ shadow }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nexport function ShadowIndicator( { type, label, isActive, onSelect, shadow } ) {\n\treturn (\n\t\t<Tooltip.Root>\n\t\t\t<Tooltip.Trigger\n\t\t\t\trender={\n\t\t\t\t\t<Composite.Item\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\taria-selected={ isActive }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-global-styles__shadow__item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'block-editor-global-styles__shadow-indicator',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset: type === 'unset',\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonClick={ onSelect }\n\t\t\t\t\t\t\t\tstyle={ { boxShadow: shadow } }\n\t\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ isActive && <Icon icon={ check } /> }\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<Tooltip.Popup>{ label }</Tooltip.Popup>\n\t\t</Tooltip.Root>\n\t);\n}\n\nexport function ShadowPopover( {\n\tshadow,\n\tonShadowChange,\n\tsettings,\n\tclassName,\n\thasLocalValue = !! shadow,\n\thasLocalOverride = false,\n\tonReset,\n} ) {\n\tconst popoverProps = {\n\t\tplacement: 'left-start',\n\t\toffset: 36,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-global-styles__shadow-dropdown',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ renderShadowToggle( shadow, onShadowChange, {\n\t\t\t\thasLocalValue,\n\t\t\t\thasLocalOverride,\n\t\t\t\tonReset: onReset ?? ( () => onShadowChange( undefined ) ),\n\t\t\t} ) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"medium\">\n\t\t\t\t\t<ShadowPopoverContainer\n\t\t\t\t\t\tshadow={ shadow }\n\t\t\t\t\t\tonShadowChange={ onShadowChange }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction renderShadowToggle( shadow, onShadowChange, resetConfig ) {\n\tconst { hasLocalValue, hasLocalOverride, onReset } = resetConfig;\n\treturn function ShadowToggle( { onToggle, isOpen } ) {\n\t\tconst shadowButtonRef = useRef( undefined );\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx(\n\t\t\t\t'block-editor-global-styles__shadow-dropdown-toggle',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t\tref: shadowButtonRef,\n\t\t};\n\n\t\tconst handleReset = () => {\n\t\t\tif ( isOpen ) {\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t\tonReset();\n\t\t\t// Return focus to parent button.\n\t\t\tshadowButtonRef.current?.focus();\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button __next40pxDefaultSize { ...toggleProps }>\n\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"block-editor-global-styles__toggle-icon\"\n\t\t\t\t\t\t\ticon={ shadowIcon }\n\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FlexItem>{ __( 'Drop shadow' ) }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</Button>\n\t\t\t\t{ hasLocalValue &&\n\t\t\t\t\t( hasLocalOverride ? (\n\t\t\t\t\t\t<InheritanceResetButton\n\t\t\t\t\t\t\tclassName=\"block-editor-global-styles__shadow-editor__remove-button\"\n\t\t\t\t\t\t\tonResetToInherited={ handleReset }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\t\tlabel={ __( 'Remove' ) }\n\t\t\t\t\t\t\tclassName=\"block-editor-global-styles__shadow-editor__remove-button\"\n\t\t\t\t\t\t\tonClick={ handleReset }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t</>\n\t\t);\n\t};\n}\n\n/**\n * Returns the available shadow presets, from every origin, in the order they\n * are presented to the user.\n *\n * This is the single source of truth for which presets exist: it backs both the\n * popover's preset list and the mapping of a chosen shadow back to the preset\n * it came from, so what is shown and what is stored cannot drift apart.\n *\n * @param {Object} settings Theme.json settings for the current context.\n *\n * @return {Array} The shadow presets.\n */\nexport function useShadowPresets( settings ) {\n\treturn useMemo( () => {\n\t\tif ( ! settings?.shadow ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\tconst defaultPresetsEnabled = settings?.shadow?.defaultPresets;\n\t\tconst {\n\t\t\tdefault: defaultShadows,\n\t\t\ttheme: themeShadows,\n\t\t\tcustom: customShadows,\n\t\t} = settings?.shadow?.presets ?? {};\n\n\t\tconst allPresets = [\n\t\t\t...( ( defaultPresetsEnabled && defaultShadows ) || EMPTY_ARRAY ),\n\t\t\t...( themeShadows || EMPTY_ARRAY ),\n\t\t\t...( customShadows || EMPTY_ARRAY ),\n\t\t];\n\n\t\t// More than one origin can define the same slug, but only the most\n\t\t// specific definition is output as a CSS variable. Keeping the ones it\n\t\t// overrides would offer swatches that apply a different shadow than\n\t\t// the one they show.\n\t\treturn allPresets.filter(\n\t\t\t( preset, index ) =>\n\t\t\t\tallPresets.findLastIndex(\n\t\t\t\t\t( { slug } ) => slug === preset.slug\n\t\t\t\t) === index\n\t\t);\n\t}, [ settings ] );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBASO;AACP,qBAAgC;AAChC,mBAAyD;AACzD,kBAAiB;AACjB,gBAAwB;AACxB,yBAAuC;AA6BpC;AArBH,IAAM,cAAc,CAAC;AAEd,SAAS,uBAAwB,EAAE,QAAQ,gBAAgB,SAAS,GAAI;AAC9E,QAAM,UAAU,iBAAkB,QAAS;AAC3C,QAAM,cAAU,wBAAS,MAAM;AAC9B,QAA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AAO,yBAAyB,kBAAoB;AAAA,MACpD,GAAK,gBAAgB;AAAA,MACrB,GAAK,iBAAiB;AAAA,IACvB;AAMA,WAAO,WAAW;AAAA,MACjB,CAAE,QAAQ,UACT,WAAW;AAAA,QACV,CAAE,EAAE,KAAK,MAAO,SAAS,OAAO;AAAA,MACjC,MAAM;AAAA,IACR;AAAA,EACD,GAAG,CAAE,QAAS,CAAE;AACjB;",
|
|
6
6
|
"names": ["VStack", "Heading", "clsx", "DropdownContentWrapper", "HStack", "shadowIcon"]
|
|
7
7
|
}
|
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// packages/block-editor/src/components/global-styles/utils.js
|
|
21
21
|
var utils_exports = {};
|
|
22
22
|
__export(utils_exports, {
|
|
23
|
+
getDuotoneSlugFromPreset: () => getDuotoneSlugFromPreset,
|
|
23
24
|
scopeSelector: () => scopeSelector,
|
|
24
25
|
useToolsPanelDropdownMenuProps: () => useToolsPanelDropdownMenuProps
|
|
25
26
|
});
|
|
@@ -49,8 +50,16 @@ function scopeSelector(scope, selector) {
|
|
|
49
50
|
});
|
|
50
51
|
return selectorsScoped.join(", ");
|
|
51
52
|
}
|
|
53
|
+
function getDuotoneSlugFromPreset(duotone) {
|
|
54
|
+
if (typeof duotone !== "string") {
|
|
55
|
+
return void 0;
|
|
56
|
+
}
|
|
57
|
+
const [, slug] = duotone.match(/^var:preset\|duotone\|(.+)$/) ?? [];
|
|
58
|
+
return slug;
|
|
59
|
+
}
|
|
52
60
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53
61
|
0 && (module.exports = {
|
|
62
|
+
getDuotoneSlugFromPreset,
|
|
54
63
|
scopeSelector,
|
|
55
64
|
useToolsPanelDropdownMenuProps
|
|
56
65
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/global-styles/utils.js"],
|
|
4
|
-
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\n\nexport function useToolsPanelDropdownMenuProps() {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n}\n\n/**\n * Function that scopes a selector with another one. This works a bit like\n * SCSS nesting except the `&` operator isn't supported.\n *\n * @example\n * ```js\n * const scope = '.a, .b .c';\n * const selector = '> .x, .y';\n * const merged = scopeSelector( scope, selector );\n * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'\n * ```\n *\n * @param {string} scope Selector to scope to.\n * @param {string} selector Original selector.\n *\n * @return {string} Scoped selector.\n */\nexport function scopeSelector( scope, selector ) {\n\tif ( ! scope || ! selector ) {\n\t\treturn selector;\n\t}\n\n\tconst scopes = scope.split( ',' );\n\tconst selectors = selector.split( ',' );\n\n\tconst selectorsScoped = [];\n\tscopes.forEach( ( outer ) => {\n\t\tselectors.forEach( ( inner ) => {\n\t\t\tselectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );\n\t\t} );\n\t} );\n\n\treturn selectorsScoped.join( ', ' );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiC;AAE1B,SAAS,iCAAiC;AAChD,QAAM,eAAW,iCAAkB,UAAU,GAAI;AACjD,SAAO,CAAE,WACN;AAAA,IACA,cAAc;AAAA,MACb,WAAW;AAAA;AAAA,MAEX,QAAQ;AAAA,IACT;AAAA,EACA,IACA,CAAC;AACL;AAmBO,SAAS,cAAe,OAAO,UAAW;AAChD,MAAK,CAAE,SAAS,CAAE,UAAW;AAC5B,WAAO;AAAA,EACR;AAEA,QAAM,SAAS,MAAM,MAAO,GAAI;AAChC,QAAM,YAAY,SAAS,MAAO,GAAI;AAEtC,QAAM,kBAAkB,CAAC;AACzB,SAAO,QAAS,CAAE,UAAW;AAC5B,cAAU,QAAS,CAAE,UAAW;AAC/B,sBAAgB,KAAM,GAAI,MAAM,KAAK,CAAE,IAAK,MAAM,KAAK,CAAE,EAAG;AAAA,IAC7D,CAAE;AAAA,EACH,CAAE;AAEF,SAAO,gBAAgB,KAAM,IAAK;AACnC;",
|
|
4
|
+
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\n\nexport function useToolsPanelDropdownMenuProps() {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n}\n\n/**\n * Function that scopes a selector with another one. This works a bit like\n * SCSS nesting except the `&` operator isn't supported.\n *\n * @example\n * ```js\n * const scope = '.a, .b .c';\n * const selector = '> .x, .y';\n * const merged = scopeSelector( scope, selector );\n * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'\n * ```\n *\n * @param {string} scope Selector to scope to.\n * @param {string} selector Original selector.\n *\n * @return {string} Scoped selector.\n */\nexport function scopeSelector( scope, selector ) {\n\tif ( ! scope || ! selector ) {\n\t\treturn selector;\n\t}\n\n\tconst scopes = scope.split( ',' );\n\tconst selectors = selector.split( ',' );\n\n\tconst selectorsScoped = [];\n\tscopes.forEach( ( outer ) => {\n\t\tselectors.forEach( ( inner ) => {\n\t\t\tselectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );\n\t\t} );\n\t} );\n\n\treturn selectorsScoped.join( ', ' );\n}\n\n/**\n * Reads the preset slug out of a duotone style value.\n *\n * Two presets can hold the same pair of colors, so the slug is the only thing\n * that identifies which one is applied. The colors alone do not.\n *\n * Lives here rather than beside its siblings in `hooks/duotone` because that\n * module imports the filters panel, so the panel cannot import back from it.\n *\n * @param {string|string[]|undefined} duotone A duotone style value.\n *\n * @return {string|undefined} The preset slug, if the value references one.\n */\nexport function getDuotoneSlugFromPreset( duotone ) {\n\tif ( typeof duotone !== 'string' ) {\n\t\treturn undefined;\n\t}\n\n\tconst [ , slug ] = duotone.match( /^var:preset\\|duotone\\|(.+)$/ ) ?? [];\n\n\treturn slug;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiC;AAE1B,SAAS,iCAAiC;AAChD,QAAM,eAAW,iCAAkB,UAAU,GAAI;AACjD,SAAO,CAAE,WACN;AAAA,IACA,cAAc;AAAA,MACb,WAAW;AAAA;AAAA,MAEX,QAAQ;AAAA,IACT;AAAA,EACA,IACA,CAAC;AACL;AAmBO,SAAS,cAAe,OAAO,UAAW;AAChD,MAAK,CAAE,SAAS,CAAE,UAAW;AAC5B,WAAO;AAAA,EACR;AAEA,QAAM,SAAS,MAAM,MAAO,GAAI;AAChC,QAAM,YAAY,SAAS,MAAO,GAAI;AAEtC,QAAM,kBAAkB,CAAC;AACzB,SAAO,QAAS,CAAE,UAAW;AAC5B,cAAU,QAAS,CAAE,UAAW;AAC/B,sBAAgB,KAAM,GAAI,MAAM,KAAK,CAAE,IAAK,MAAM,KAAK,CAAE,EAAG;AAAA,IAC7D,CAAE;AAAA,EACH,CAAE;AAEF,SAAO,gBAAgB,KAAM,IAAK;AACnC;AAeO,SAAS,yBAA0B,SAAU;AACnD,MAAK,OAAO,YAAY,UAAW;AAClC,WAAO;AAAA,EACR;AAEA,QAAM,CAAE,EAAE,IAAK,IAAI,QAAQ,MAAO,6BAA8B,KAAK,CAAC;AAEtE,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -104,7 +104,7 @@ function UncontrolledInnerBlocks(props) {
|
|
|
104
104
|
);
|
|
105
105
|
const defaultLayoutBlockSupport = (0, import_blocks.getBlockSupport)(name, "layout") || (0, import_blocks.getBlockSupport)(name, "__experimentalLayout") || EMPTY_OBJECT;
|
|
106
106
|
const { allowSizingOnChildren = false } = defaultLayoutBlockSupport;
|
|
107
|
-
const usedLayout = layout || defaultLayoutBlockSupport;
|
|
107
|
+
const usedLayout = layout || defaultLayoutBlockSupport.default || EMPTY_OBJECT;
|
|
108
108
|
const memoedLayout = (0, import_element.useMemo)(
|
|
109
109
|
() => ({
|
|
110
110
|
// Default layout will know about any content/wide size defined by the theme.
|
|
@@ -144,13 +144,15 @@ function useInnerBlocksProps(props = {}, options = {}) {
|
|
|
144
144
|
const {
|
|
145
145
|
__unstableDisableLayoutClassNames,
|
|
146
146
|
__unstableDisableDropZone,
|
|
147
|
-
dropZoneElement
|
|
147
|
+
dropZoneElement,
|
|
148
|
+
layout: layoutOverride
|
|
148
149
|
} = options;
|
|
149
150
|
const {
|
|
150
151
|
clientId,
|
|
151
|
-
layout = null,
|
|
152
|
+
layout: contextLayout = null,
|
|
152
153
|
__unstableLayoutClassNames: layoutClassNames = ""
|
|
153
154
|
} = (0, import_context.useBlockEditContext)();
|
|
155
|
+
const layout = layoutOverride ?? contextLayout;
|
|
154
156
|
const selected = (0, import_data.useSelect)(
|
|
155
157
|
(select) => {
|
|
156
158
|
const {
|