@wordpress/block-editor 16.0.0 → 16.1.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 +18 -0
- package/README.md +8 -0
- package/build/components/alignment-control/ui.cjs +2 -4
- package/build/components/alignment-control/ui.cjs.map +2 -2
- package/build/components/background-image-control/index.cjs +40 -10
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-alignment-control/ui.cjs +5 -3
- package/build/components/block-alignment-control/ui.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +73 -46
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-list/block-html.cjs +4 -1
- package/build/components/block-list/block-html.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +5 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-handler.cjs +2 -3
- package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs +48 -0
- package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +7 -0
- package/build/components/block-parent-selector/index.cjs +2 -2
- package/build/components/block-parent-selector/index.cjs.map +2 -2
- package/build/components/block-toolbar/switch-section-style.cjs +4 -2
- package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
- package/build/components/block-tools/empty-block-inserter.cjs +2 -7
- package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
- package/build/components/block-vertical-alignment-control/ui.cjs +3 -5
- package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
- package/build/components/border-radius-control/utils.cjs +8 -58
- package/build/components/border-radius-control/utils.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +5 -3
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/dimension-control/index.cjs +30 -20
- package/build/components/dimension-control/index.cjs.map +3 -3
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs +9 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
- package/build/components/editor-styles/index.cjs +9 -1
- package/build/components/editor-styles/index.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +66 -25
- package/build/components/global-styles/background-panel.cjs.map +3 -3
- package/build/components/global-styles/border-panel.cjs +153 -55
- package/build/components/global-styles/border-panel.cjs.map +3 -3
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +46 -14
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +3 -3
- package/build/components/global-styles/color-panel.cjs +63 -17
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +242 -64
- package/build/components/global-styles/dimensions-panel.cjs.map +3 -3
- package/build/components/global-styles/filters-panel.cjs +59 -20
- package/build/components/global-styles/filters-panel.cjs.map +3 -3
- package/build/components/global-styles/hooks.cjs +4 -1
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/inheritance/index.cjs +142 -0
- package/build/components/global-styles/inheritance/index.cjs.map +7 -0
- package/build/components/global-styles/inherited-value-context.cjs +173 -0
- package/build/components/global-styles/inherited-value-context.cjs.map +7 -0
- package/build/components/global-styles/shadow-panel-components.cjs +38 -20
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/global-styles/state-control.cjs +1 -1
- package/build/components/global-styles/state-control.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +271 -78
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs +10 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/line-height-control/index.cjs +1 -1
- package/build/components/line-height-control/index.cjs.map +2 -2
- package/build/components/link-control/index.cjs +3 -1
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/preset-input-control/index.cjs +2 -1
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/provider/block-refs-provider.cjs +8 -2
- package/build/components/provider/block-refs-provider.cjs.map +2 -2
- package/build/components/provider/index.cjs +1 -1
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/use-block-sync.cjs +18 -6
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/provider/use-media-upload-settings.cjs +3 -1
- package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +23 -13
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/spacing-sizes-control/utils.cjs +6 -19
- package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
- package/build/components/text-indent-control/index.cjs +8 -2
- package/build/components/text-indent-control/index.cjs.map +2 -2
- package/build/components/url-input/index.cjs +303 -344
- package/build/components/url-input/index.cjs.map +3 -3
- package/build/components/writing-flow/index.cjs +2 -0
- package/build/components/writing-flow/index.cjs.map +3 -3
- package/build/components/writing-flow/use-arrow-nav.cjs +24 -1
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-click-selection.cjs +28 -2
- package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-editable-root-event-handlers.cjs +179 -0
- package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +7 -0
- package/build/components/writing-flow/use-editable-root.cjs +5 -42
- package/build/components/writing-flow/use-editable-root.cjs.map +2 -2
- package/build/components/writing-flow/use-home-end.cjs +1 -1
- package/build/components/writing-flow/use-home-end.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +17 -13
- package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
- package/build/components/writing-flow/utils.cjs +3 -14
- package/build/components/writing-flow/utils.cjs.map +2 -2
- package/build/hooks/background.cjs +13 -10
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-style-variation.cjs +4 -45
- package/build/hooks/block-style-variation.cjs.map +3 -3
- package/build/hooks/border.cjs +19 -4
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +6 -2
- package/build/hooks/custom-css.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +15 -4
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/duotone.cjs +26 -14
- package/build/hooks/duotone.cjs.map +3 -3
- package/build/hooks/elements.cjs +14 -4
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/line-height.cjs +1 -2
- package/build/hooks/line-height.cjs.map +2 -2
- package/build/hooks/typography.cjs +13 -4
- package/build/hooks/typography.cjs.map +2 -2
- package/build/private-apis.cjs +9 -5
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +9 -4
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +28 -1
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +6 -6
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +23 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/native-undo.cjs +55 -0
- package/build/utils/native-undo.cjs.map +7 -0
- package/build-module/components/alignment-control/ui.mjs +2 -4
- package/build-module/components/alignment-control/ui.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +43 -10
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-alignment-control/ui.mjs +5 -3
- package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +74 -46
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block-html.mjs +4 -1
- package/build-module/components/block-list/block-html.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +5 -2
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +2 -3
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs +28 -0
- package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +7 -0
- package/build-module/components/block-parent-selector/index.mjs +2 -2
- package/build-module/components/block-parent-selector/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs +4 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
- package/build-module/components/block-tools/empty-block-inserter.mjs +2 -7
- package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
- package/build-module/components/block-vertical-alignment-control/ui.mjs +4 -6
- package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/border-radius-control/utils.mjs +11 -53
- package/build-module/components/border-radius-control/utils.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +5 -3
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/dimension-control/index.mjs +30 -20
- package/build-module/components/dimension-control/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +10 -6
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/editor-styles/index.mjs +9 -1
- package/build-module/components/editor-styles/index.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +71 -29
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +157 -56
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +51 -15
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs +63 -17
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +248 -66
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +64 -21
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +4 -1
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs +108 -0
- package/build-module/components/global-styles/inheritance/index.mjs.map +7 -0
- package/build-module/components/global-styles/inherited-value-context.mjs +141 -0
- package/build-module/components/global-styles/inherited-value-context.mjs.map +7 -0
- package/build-module/components/global-styles/shadow-panel-components.mjs +38 -20
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/global-styles/state-control.mjs +1 -1
- package/build-module/components/global-styles/state-control.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +276 -79
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +6 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/line-height-control/index.mjs +1 -1
- package/build-module/components/line-height-control/index.mjs.map +2 -2
- package/build-module/components/link-control/index.mjs +4 -2
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs +2 -1
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/provider/block-refs-provider.mjs +8 -2
- package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +1 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs +18 -6
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/provider/use-media-upload-settings.mjs +3 -1
- package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +28 -14
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/spacing-sizes-control/utils.mjs +6 -18
- package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
- package/build-module/components/text-indent-control/index.mjs +8 -2
- package/build-module/components/text-indent-control/index.mjs.map +2 -2
- package/build-module/components/url-input/index.mjs +306 -353
- package/build-module/components/url-input/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +2 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +24 -1
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-click-selection.mjs +28 -2
- package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs +154 -0
- package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +7 -0
- package/build-module/components/writing-flow/use-editable-root.mjs +5 -37
- package/build-module/components/writing-flow/use-editable-root.mjs.map +2 -2
- package/build-module/components/writing-flow/use-home-end.mjs +1 -1
- package/build-module/components/writing-flow/use-home-end.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +18 -14
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/components/writing-flow/utils.mjs +2 -11
- package/build-module/components/writing-flow/utils.mjs.map +2 -2
- package/build-module/hooks/background.mjs +13 -10
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-style-variation.mjs +8 -44
- package/build-module/hooks/block-style-variation.mjs.map +2 -2
- package/build-module/hooks/border.mjs +19 -4
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +7 -3
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +15 -4
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/duotone.mjs +20 -9
- package/build-module/hooks/duotone.mjs.map +2 -2
- package/build-module/hooks/elements.mjs +14 -4
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/line-height.mjs +1 -2
- package/build-module/hooks/line-height.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +13 -4
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/private-apis.mjs +7 -3
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +9 -4
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +29 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +6 -6
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +23 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/native-undo.mjs +29 -0
- package/build-module/utils/native-undo.mjs.map +7 -0
- package/build-style/content-rtl.css +10 -18
- package/build-style/content.css +10 -18
- package/build-style/style-rtl.css +150 -7
- package/build-style/style.css +150 -7
- package/package.json +40 -41
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +1 -1
- package/src/components/alignment-control/ui.js +2 -4
- package/src/components/background-image-control/index.js +74 -37
- package/src/components/background-image-control/style.scss +13 -4
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/block-alignment-control/test/index.js +1 -1
- package/src/components/block-alignment-control/ui.js +4 -2
- package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
- package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-inspector/index.js +60 -31
- package/src/components/block-list/block-html.js +5 -0
- package/src/components/block-list/content.scss +1 -11
- package/src/components/block-list/use-block-props/index.js +5 -1
- package/src/components/block-list/use-block-props/use-focus-handler.js +9 -8
- package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
- package/src/components/block-parent-selector/index.js +5 -2
- package/src/components/block-toolbar/switch-section-style.js +5 -2
- package/src/components/block-tools/empty-block-inserter.js +3 -7
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/block-vertical-alignment-control/test/index.js +18 -2
- package/src/components/block-vertical-alignment-control/ui.js +3 -5
- package/src/components/border-radius-control/test/utils.js +0 -41
- package/src/components/border-radius-control/utils.js +16 -107
- package/src/components/button-block-appender/content.scss +6 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/colors-gradients/control.js +6 -3
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +1 -1
- package/src/components/dimension-control/index.js +13 -1
- package/src/components/dimensions-tool/aspect-ratio-tool.js +13 -6
- package/src/components/editor-styles/index.js +16 -1
- package/src/components/global-styles/background-panel.js +107 -34
- package/src/components/global-styles/border-panel.js +219 -48
- package/src/components/global-styles/color-gradient-dropdown-item.js +93 -28
- package/src/components/global-styles/color-panel.js +92 -11
- package/src/components/global-styles/dimensions-panel.js +422 -71
- package/src/components/global-styles/filters-panel.js +88 -28
- package/src/components/global-styles/hooks.js +8 -1
- package/src/components/global-styles/inheritance/index.js +204 -0
- package/src/components/global-styles/inheritance/style.scss +184 -0
- package/src/components/global-styles/inheritance/test/index.js +281 -0
- package/src/components/global-styles/inherited-value-context.js +271 -0
- package/src/components/global-styles/shadow-panel-components.js +48 -26
- package/src/components/global-styles/state-control.js +2 -2
- package/src/components/global-styles/test/background-panel.js +338 -1
- package/src/components/global-styles/test/border-panel.js +441 -0
- package/src/components/global-styles/test/color-panel.js +182 -2
- package/src/components/global-styles/test/dimensions-panel.js +753 -0
- package/src/components/global-styles/test/filters-panel.js +194 -0
- package/src/components/global-styles/test/inherited-value-context-core.js +98 -0
- package/src/components/global-styles/test/inherited-value-context.js +454 -0
- package/src/components/global-styles/test/typography-panel-core.js +185 -0
- package/src/components/global-styles/test/typography-panel.js +849 -12
- package/src/components/global-styles/typography-panel.js +449 -100
- package/src/components/image-editor/style.scss +33 -0
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
- package/src/components/line-height-control/index.js +1 -1
- package/src/components/link-control/index.js +7 -2
- package/src/components/preset-input-control/index.js +4 -1
- package/src/components/provider/block-refs-provider.js +12 -2
- package/src/components/provider/index.js +2 -2
- package/src/components/provider/use-block-sync.js +18 -6
- package/src/components/provider/use-media-upload-settings.js +2 -0
- package/src/components/rich-text/index.js +37 -16
- package/src/components/spacing-sizes-control/test/utils.js +16 -5
- package/src/components/spacing-sizes-control/utils.js +11 -28
- package/src/components/text-indent-control/index.js +8 -0
- package/src/components/url-input/index.js +363 -431
- package/src/components/url-input/test/index.js +592 -0
- package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
- package/src/components/writing-flow/index.js +2 -0
- package/src/components/writing-flow/use-arrow-nav.js +51 -1
- package/src/components/writing-flow/use-click-selection.js +54 -3
- package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
- package/src/components/writing-flow/use-editable-root.js +7 -77
- package/src/components/writing-flow/use-home-end.js +17 -9
- package/src/components/writing-flow/use-selection-observer.js +32 -15
- package/src/components/writing-flow/utils.js +3 -24
- package/src/hooks/background.js +26 -21
- package/src/hooks/block-fields/rich-text/styles.scss +1 -1
- package/src/hooks/block-style-variation.js +8 -74
- package/src/hooks/border.js +19 -4
- package/src/hooks/custom-css.js +15 -6
- package/src/hooks/dimensions.js +17 -4
- package/src/hooks/duotone.js +26 -8
- package/src/hooks/elements.js +14 -3
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/test/inherited-value-wiring.js +411 -0
- package/src/hooks/test/preset-round-trip.js +456 -0
- package/src/hooks/typography.js +35 -23
- package/src/private-apis.js +11 -2
- package/src/store/actions.js +10 -4
- package/src/store/private-selectors.js +57 -1
- package/src/store/reducer.js +9 -9
- package/src/store/selectors.js +56 -8
- package/src/store/test/private-selectors.js +160 -1
- package/src/style.scss +2 -0
- package/src/utils/native-undo.js +56 -0
- package/build/components/duotone/utils.cjs +0 -87
- package/build/components/duotone/utils.cjs.map +0 -7
- package/build-module/components/duotone/utils.mjs +0 -59
- package/build-module/components/duotone/utils.mjs.map +0 -7
- package/src/components/duotone/utils.js +0 -90
- package/src/hooks/test/get-variation-styles-with-ref-values.js +0 -91
|
@@ -34,7 +34,6 @@ __export(dimensions_panel_exports, {
|
|
|
34
34
|
useHasDimensionsPanel: () => useHasDimensionsPanel
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(dimensions_panel_exports);
|
|
37
|
-
var import_clsx = __toESM(require("clsx"));
|
|
38
37
|
var import_i18n = require("@wordpress/i18n");
|
|
39
38
|
var import_components = require("@wordpress/components");
|
|
40
39
|
var import_icons = require("@wordpress/icons");
|
|
@@ -48,8 +47,19 @@ var import_aspect_ratio_tool = __toESM(require("../dimensions-tool/aspect-ratio-
|
|
|
48
47
|
var import_utils2 = require("../../hooks/utils.cjs");
|
|
49
48
|
var import_object = require("../../utils/object.cjs");
|
|
50
49
|
var import_block_style_state = require("../../hooks/block-style-state.cjs");
|
|
50
|
+
var import_inheritance = require("./inheritance/index.cjs");
|
|
51
51
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
52
|
var AXIAL_SIDES = ["horizontal", "vertical"];
|
|
53
|
+
function hasSpacingToggle(sides, isPresetsControl) {
|
|
54
|
+
if (sides?.length === 1) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
if (isPresetsControl) {
|
|
58
|
+
const hasOnlyAxialSides = sides?.includes("horizontal") && sides?.includes("vertical") && sides?.length === 2;
|
|
59
|
+
return !hasOnlyAxialSides;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
53
63
|
function useHasDimensionsPanel(settings, styleState = import_block_style_state.DEFAULT_BLOCK_STYLE_STATE) {
|
|
54
64
|
return hasContentSize(settings) || hasWideSize(settings) || hasPadding(settings) || hasMargin(settings) || hasGap(settings) || hasHeight(settings) || hasMinHeight(settings) || hasMinWidth(settings) || hasWidth(settings) || hasAspectRatio(settings, styleState) || hasChildLayout(settings, styleState);
|
|
55
65
|
}
|
|
@@ -117,8 +127,19 @@ function filterValuesBySides(values, sides) {
|
|
|
117
127
|
});
|
|
118
128
|
return filteredValues;
|
|
119
129
|
}
|
|
130
|
+
var EMPTY_VALUES = [void 0, null, ""];
|
|
131
|
+
function hasValue(value) {
|
|
132
|
+
return !EMPTY_VALUES.includes(value);
|
|
133
|
+
}
|
|
134
|
+
function getNumericPlaceholder(rawValue) {
|
|
135
|
+
if (!hasValue(rawValue)) {
|
|
136
|
+
return void 0;
|
|
137
|
+
}
|
|
138
|
+
const [quantity] = (0, import_components.__experimentalParseQuantityAndUnitFromRawValue)(rawValue);
|
|
139
|
+
return quantity;
|
|
140
|
+
}
|
|
120
141
|
function splitStyleValue(value) {
|
|
121
|
-
if (value && typeof value === "string") {
|
|
142
|
+
if (hasValue(value) && typeof value === "string") {
|
|
122
143
|
return {
|
|
123
144
|
top: value,
|
|
124
145
|
right: value,
|
|
@@ -128,8 +149,41 @@ function splitStyleValue(value) {
|
|
|
128
149
|
}
|
|
129
150
|
return value;
|
|
130
151
|
}
|
|
152
|
+
function getCommonSidesValue(sidesValue) {
|
|
153
|
+
if (!hasValue(sidesValue)) {
|
|
154
|
+
return void 0;
|
|
155
|
+
}
|
|
156
|
+
if (typeof sidesValue === "string") {
|
|
157
|
+
return sidesValue !== "" ? sidesValue : void 0;
|
|
158
|
+
}
|
|
159
|
+
if (typeof sidesValue !== "object") {
|
|
160
|
+
return void 0;
|
|
161
|
+
}
|
|
162
|
+
const sideKeys = ["top", "right", "bottom", "left"];
|
|
163
|
+
const values = sideKeys.map((k) => sidesValue[k]);
|
|
164
|
+
const allDefined = values.every(hasValue);
|
|
165
|
+
if (!allDefined) {
|
|
166
|
+
return void 0;
|
|
167
|
+
}
|
|
168
|
+
const first = values[0];
|
|
169
|
+
return values.every((v) => v === first) ? first : void 0;
|
|
170
|
+
}
|
|
171
|
+
function hasAnySideValue(sidesValue) {
|
|
172
|
+
if (!hasValue(sidesValue)) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
if (typeof sidesValue === "string") {
|
|
176
|
+
return sidesValue !== "";
|
|
177
|
+
}
|
|
178
|
+
if (typeof sidesValue !== "object") {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
return ["top", "right", "bottom", "left"].some(
|
|
182
|
+
(side) => hasValue(sidesValue[side])
|
|
183
|
+
);
|
|
184
|
+
}
|
|
131
185
|
function splitGapValue(value, isAxialGap) {
|
|
132
|
-
if (!value) {
|
|
186
|
+
if (!hasValue(value)) {
|
|
133
187
|
return value;
|
|
134
188
|
}
|
|
135
189
|
if (typeof value === "string") {
|
|
@@ -190,7 +244,8 @@ function DimensionsPanel({
|
|
|
190
244
|
// Special case because the layout controls are not part of the dimensions panel
|
|
191
245
|
// in global styles but not in block inspector.
|
|
192
246
|
includeLayoutControls = false,
|
|
193
|
-
styleState = import_block_style_state.DEFAULT_BLOCK_STYLE_STATE
|
|
247
|
+
styleState = import_block_style_state.DEFAULT_BLOCK_STYLE_STATE,
|
|
248
|
+
showInheritanceLabelIndicators = (0, import_inheritance.isGlobalStylesInheritanceEnabled)()
|
|
194
249
|
}) {
|
|
195
250
|
const { dimensions, spacing } = settings;
|
|
196
251
|
const decodeValue = (rawValue) => {
|
|
@@ -210,6 +265,11 @@ function DimensionsPanel({
|
|
|
210
265
|
rawValue
|
|
211
266
|
);
|
|
212
267
|
};
|
|
268
|
+
const inheritanceProps = (isInherited, hasLocalOverride, className) => (0, import_inheritance.getInheritanceProps)(
|
|
269
|
+
showInheritanceLabelIndicators && isInherited,
|
|
270
|
+
showInheritanceLabelIndicators && hasLocalOverride,
|
|
271
|
+
className
|
|
272
|
+
);
|
|
213
273
|
const showSpacingPresetsControl = hasSpacingPresets(settings);
|
|
214
274
|
const units = (0, import_components.__experimentalUseCustomUnits)({
|
|
215
275
|
availableUnits: settings?.spacing?.units || [
|
|
@@ -253,67 +313,100 @@ function DimensionsPanel({
|
|
|
253
313
|
};
|
|
254
314
|
}, []);
|
|
255
315
|
const showContentSizeControl = hasContentSize(settings) && includeLayoutControls;
|
|
256
|
-
const
|
|
316
|
+
const localContentSizeValue = decodeValue(value?.layout?.contentSize);
|
|
317
|
+
const inheritedContentSizeValue = decodeValue(
|
|
318
|
+
inheritedValue?.layout?.contentSize
|
|
319
|
+
);
|
|
320
|
+
const isContentSizePlaceholder = !hasValue(value?.layout?.contentSize) && hasValue(inheritedContentSizeValue);
|
|
257
321
|
const setContentSizeValue = (newValue) => {
|
|
258
322
|
onChange(
|
|
259
323
|
(0, import_object.setImmutably)(
|
|
260
324
|
value,
|
|
261
325
|
["layout", "contentSize"],
|
|
262
|
-
newValue
|
|
326
|
+
hasValue(newValue) ? newValue : void 0
|
|
263
327
|
)
|
|
264
328
|
);
|
|
265
329
|
};
|
|
266
|
-
const hasUserSetContentSizeValue = () =>
|
|
330
|
+
const hasUserSetContentSizeValue = () => hasValue(value?.layout?.contentSize);
|
|
267
331
|
const resetContentSizeValue = () => setContentSizeValue(void 0);
|
|
268
332
|
const showWideSizeControl = hasWideSize(settings) && includeLayoutControls;
|
|
269
|
-
const
|
|
333
|
+
const localWideSizeValue = decodeValue(value?.layout?.wideSize);
|
|
334
|
+
const inheritedWideSizeValue = decodeValue(
|
|
335
|
+
inheritedValue?.layout?.wideSize
|
|
336
|
+
);
|
|
337
|
+
const isWideSizePlaceholder = !hasValue(value?.layout?.wideSize) && hasValue(inheritedWideSizeValue);
|
|
270
338
|
const setWideSizeValue = (newValue) => {
|
|
271
339
|
onChange(
|
|
272
340
|
(0, import_object.setImmutably)(
|
|
273
341
|
value,
|
|
274
342
|
["layout", "wideSize"],
|
|
275
|
-
newValue
|
|
343
|
+
hasValue(newValue) ? newValue : void 0
|
|
276
344
|
)
|
|
277
345
|
);
|
|
278
346
|
};
|
|
279
|
-
const hasUserSetWideSizeValue = () =>
|
|
347
|
+
const hasUserSetWideSizeValue = () => hasValue(value?.layout?.wideSize);
|
|
280
348
|
const resetWideSizeValue = () => setWideSizeValue(void 0);
|
|
281
349
|
const showPaddingControl = hasPadding(settings);
|
|
282
|
-
const
|
|
283
|
-
|
|
350
|
+
const inheritedPaddingValues = splitStyleValue(
|
|
351
|
+
decodeValue(inheritedValue?.spacing?.padding)
|
|
352
|
+
);
|
|
353
|
+
const localPaddingValues = splitStyleValue(
|
|
354
|
+
decodeValue(value?.spacing?.padding)
|
|
355
|
+
);
|
|
356
|
+
const paddingValues = hasValue(value?.spacing?.padding) ? localPaddingValues : inheritedPaddingValues;
|
|
357
|
+
const inheritedPaddingPlaceholder = getCommonSidesValue(
|
|
358
|
+
inheritedPaddingValues
|
|
359
|
+
);
|
|
360
|
+
const isPaddingPlaceholder = !hasValue(value?.spacing?.padding) && inheritedPaddingPlaceholder !== void 0;
|
|
361
|
+
const hasInheritedPadding = hasAnySideValue(inheritedPaddingValues);
|
|
362
|
+
const isPaddingInherited = !hasValue(value?.spacing?.padding) && hasInheritedPadding;
|
|
284
363
|
const paddingSides = Array.isArray(settings?.spacing?.padding) ? settings?.spacing?.padding : settings?.spacing?.padding?.sides;
|
|
285
364
|
const isAxialPadding = paddingSides && paddingSides.some((side) => AXIAL_SIDES.includes(side));
|
|
286
365
|
const setPaddingValues = (newPaddingValues) => {
|
|
287
366
|
const padding = filterValuesBySides(newPaddingValues, paddingSides);
|
|
288
367
|
onChange((0, import_object.setImmutably)(value, ["spacing", "padding"], padding));
|
|
289
368
|
};
|
|
290
|
-
const hasPaddingValue = () =>
|
|
369
|
+
const hasPaddingValue = () => hasValue(value?.spacing?.padding) && Object.keys(value?.spacing?.padding).length;
|
|
291
370
|
const resetPaddingValue = () => setPaddingValues(void 0);
|
|
292
371
|
const onMouseOverPadding = () => onVisualize("padding");
|
|
293
372
|
const showMarginControl = hasMargin(settings);
|
|
294
|
-
const
|
|
295
|
-
|
|
373
|
+
const inheritedMarginValues = splitStyleValue(
|
|
374
|
+
decodeValue(inheritedValue?.spacing?.margin)
|
|
375
|
+
);
|
|
376
|
+
const localMarginValues = splitStyleValue(
|
|
377
|
+
decodeValue(value?.spacing?.margin)
|
|
378
|
+
);
|
|
379
|
+
const marginValues = hasValue(value?.spacing?.margin) ? localMarginValues : inheritedMarginValues;
|
|
380
|
+
const inheritedMarginPlaceholder = getCommonSidesValue(
|
|
381
|
+
inheritedMarginValues
|
|
382
|
+
);
|
|
383
|
+
const isMarginPlaceholder = !hasValue(value?.spacing?.margin) && inheritedMarginPlaceholder !== void 0;
|
|
384
|
+
const hasInheritedMargin = hasAnySideValue(inheritedMarginValues);
|
|
385
|
+
const isMarginInherited = !hasValue(value?.spacing?.margin) && hasInheritedMargin;
|
|
296
386
|
const marginSides = Array.isArray(settings?.spacing?.margin) ? settings?.spacing?.margin : settings?.spacing?.margin?.sides;
|
|
297
387
|
const isAxialMargin = marginSides && marginSides.some((side) => AXIAL_SIDES.includes(side));
|
|
298
388
|
const setMarginValues = (newMarginValues) => {
|
|
299
389
|
const margin = filterValuesBySides(newMarginValues, marginSides);
|
|
300
390
|
onChange((0, import_object.setImmutably)(value, ["spacing", "margin"], margin));
|
|
301
391
|
};
|
|
302
|
-
const hasMarginValue = () =>
|
|
392
|
+
const hasMarginValue = () => hasValue(value?.spacing?.margin) && Object.keys(value?.spacing?.margin).length;
|
|
303
393
|
const resetMarginValue = () => setMarginValues(void 0);
|
|
304
394
|
const onMouseOverMargin = () => onVisualize("margin");
|
|
305
395
|
const showGapControl = hasGap(settings);
|
|
306
396
|
const gapSides = Array.isArray(settings?.spacing?.blockGap) ? settings?.spacing?.blockGap : settings?.spacing?.blockGap?.sides;
|
|
307
397
|
const isAxialGap = gapSides && gapSides.some((side) => AXIAL_SIDES.includes(side));
|
|
308
|
-
const
|
|
309
|
-
const
|
|
398
|
+
const localGapRaw = decodeValue(value?.spacing?.blockGap);
|
|
399
|
+
const inheritedGapRaw = decodeValue(inheritedValue?.spacing?.blockGap);
|
|
400
|
+
const gapRawForDisplay = hasValue(value?.spacing?.blockGap) ? localGapRaw : inheritedGapRaw;
|
|
401
|
+
const gapValues = splitGapValue(gapRawForDisplay, isAxialGap);
|
|
402
|
+
const isGapPlaceholder = !hasValue(value?.spacing?.blockGap) && typeof inheritedGapRaw === "string" && inheritedGapRaw !== "";
|
|
310
403
|
const setGapValue = (newGapValue) => {
|
|
311
404
|
onChange(
|
|
312
405
|
(0, import_object.setImmutably)(value, ["spacing", "blockGap"], newGapValue)
|
|
313
406
|
);
|
|
314
407
|
};
|
|
315
408
|
const setGapValues = (nextBoxGapValue) => {
|
|
316
|
-
if (!nextBoxGapValue) {
|
|
409
|
+
if (!hasValue(nextBoxGapValue)) {
|
|
317
410
|
setGapValue(null);
|
|
318
411
|
}
|
|
319
412
|
if (!isAxialGap && nextBoxGapValue?.hasOwnProperty("top")) {
|
|
@@ -326,9 +419,13 @@ function DimensionsPanel({
|
|
|
326
419
|
}
|
|
327
420
|
};
|
|
328
421
|
const resetGapValue = () => setGapValue(void 0);
|
|
329
|
-
const hasGapValue = () =>
|
|
422
|
+
const hasGapValue = () => hasValue(value?.spacing?.blockGap);
|
|
330
423
|
const showMinHeightControl = hasMinHeight(settings);
|
|
331
|
-
const
|
|
424
|
+
const localMinHeightValue = decodeValue(value?.dimensions?.minHeight);
|
|
425
|
+
const inheritedMinHeightValue = decodeValue(
|
|
426
|
+
inheritedValue?.dimensions?.minHeight
|
|
427
|
+
);
|
|
428
|
+
const isMinHeightPlaceholder = !hasValue(value?.dimensions?.minHeight) && hasValue(inheritedMinHeightValue);
|
|
332
429
|
const setMinHeightValue = (newValue) => {
|
|
333
430
|
const tempValue = (0, import_object.setImmutably)(
|
|
334
431
|
value,
|
|
@@ -346,9 +443,13 @@ function DimensionsPanel({
|
|
|
346
443
|
const resetMinHeightValue = () => {
|
|
347
444
|
setMinHeightValue(void 0);
|
|
348
445
|
};
|
|
349
|
-
const hasMinHeightValue = () =>
|
|
446
|
+
const hasMinHeightValue = () => hasValue(value?.dimensions?.minHeight);
|
|
350
447
|
const showHeightControl = hasHeight(settings);
|
|
351
|
-
const
|
|
448
|
+
const localHeightValue = decodeValue(value?.dimensions?.height);
|
|
449
|
+
const inheritedHeightValue = decodeValue(
|
|
450
|
+
inheritedValue?.dimensions?.height
|
|
451
|
+
);
|
|
452
|
+
const isHeightPlaceholder = !hasValue(value?.dimensions?.height) && hasValue(inheritedHeightValue);
|
|
352
453
|
const setHeightValue = (newValue) => {
|
|
353
454
|
const tempValue = (0, import_object.setImmutably)(
|
|
354
455
|
value,
|
|
@@ -366,9 +467,13 @@ function DimensionsPanel({
|
|
|
366
467
|
const resetHeightValue = () => {
|
|
367
468
|
setHeightValue(void 0);
|
|
368
469
|
};
|
|
369
|
-
const hasHeightValue = () =>
|
|
470
|
+
const hasHeightValue = () => hasValue(value?.dimensions?.height);
|
|
370
471
|
const showMinWidthControl = hasMinWidth(settings);
|
|
371
|
-
const
|
|
472
|
+
const localMinWidthValue = decodeValue(value?.dimensions?.minWidth);
|
|
473
|
+
const inheritedMinWidthValue = decodeValue(
|
|
474
|
+
inheritedValue?.dimensions?.minWidth
|
|
475
|
+
);
|
|
476
|
+
const isMinWidthPlaceholder = !hasValue(value?.dimensions?.minWidth) && hasValue(inheritedMinWidthValue);
|
|
372
477
|
const setMinWidthValue = (newValue) => {
|
|
373
478
|
onChange(
|
|
374
479
|
(0, import_object.setImmutably)(value, ["dimensions", "minWidth"], newValue)
|
|
@@ -377,20 +482,27 @@ function DimensionsPanel({
|
|
|
377
482
|
const resetMinWidthValue = () => {
|
|
378
483
|
setMinWidthValue(void 0);
|
|
379
484
|
};
|
|
380
|
-
const hasMinWidthValue = () =>
|
|
485
|
+
const hasMinWidthValue = () => hasValue(value?.dimensions?.minWidth);
|
|
381
486
|
const showWidthControl = hasWidth(settings);
|
|
382
|
-
const
|
|
487
|
+
const localWidthValue = decodeValue(value?.dimensions?.width);
|
|
488
|
+
const inheritedWidthValue = decodeValue(
|
|
489
|
+
inheritedValue?.dimensions?.width
|
|
490
|
+
);
|
|
491
|
+
const isWidthPlaceholder = !hasValue(value?.dimensions?.width) && hasValue(inheritedWidthValue);
|
|
383
492
|
const setWidthValue = (newValue) => {
|
|
384
493
|
onChange((0, import_object.setImmutably)(value, ["dimensions", "width"], newValue));
|
|
385
494
|
};
|
|
386
495
|
const resetWidthValue = () => {
|
|
387
496
|
setWidthValue(void 0);
|
|
388
497
|
};
|
|
389
|
-
const hasWidthValue = () =>
|
|
498
|
+
const hasWidthValue = () => hasValue(value?.dimensions?.width);
|
|
390
499
|
const showAspectRatioControl = hasAspectRatio(settings, styleState);
|
|
391
|
-
const
|
|
500
|
+
const localAspectRatioValue = decodeValue(value?.dimensions?.aspectRatio);
|
|
501
|
+
const inheritedAspectRatioValue = decodeValue(
|
|
392
502
|
inheritedValue?.dimensions?.aspectRatio
|
|
393
503
|
);
|
|
504
|
+
const aspectRatioValue = localAspectRatioValue ?? inheritedAspectRatioValue;
|
|
505
|
+
const isAspectRatioPlaceholder = !hasValue(value?.dimensions?.aspectRatio) && hasValue(inheritedAspectRatioValue);
|
|
394
506
|
const setAspectRatioValue = (newValue) => {
|
|
395
507
|
const tempValue = (0, import_object.setImmutably)(
|
|
396
508
|
value,
|
|
@@ -401,9 +513,9 @@ function DimensionsPanel({
|
|
|
401
513
|
(0, import_object.setImmutably)(tempValue, ["dimensions", "minHeight"], void 0)
|
|
402
514
|
);
|
|
403
515
|
};
|
|
404
|
-
const hasAspectRatioValue = () =>
|
|
516
|
+
const hasAspectRatioValue = () => hasValue(value?.dimensions?.aspectRatio);
|
|
405
517
|
const showChildLayoutControl = hasChildLayout(settings, styleState);
|
|
406
|
-
const childLayout =
|
|
518
|
+
const childLayout = value?.layout;
|
|
407
519
|
const setChildLayout = (newChildLayout) => {
|
|
408
520
|
onChange({
|
|
409
521
|
...value,
|
|
@@ -424,8 +536,12 @@ function DimensionsPanel({
|
|
|
424
536
|
children: [
|
|
425
537
|
(showContentSizeControl || showWideSizeControl) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "span-columns", children: (0, import_i18n.__)("Set the width of the main content area.") }),
|
|
426
538
|
showContentSizeControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
427
|
-
|
|
539
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
428
540
|
{
|
|
541
|
+
...inheritanceProps(
|
|
542
|
+
isContentSizePlaceholder,
|
|
543
|
+
hasUserSetContentSizeValue() && inheritedContentSizeValue !== void 0
|
|
544
|
+
),
|
|
429
545
|
label: (0, import_i18n.__)("Content width"),
|
|
430
546
|
hasValue: hasUserSetContentSizeValue,
|
|
431
547
|
onDeselect: resetContentSizeValue,
|
|
@@ -436,7 +552,10 @@ function DimensionsPanel({
|
|
|
436
552
|
{
|
|
437
553
|
label: (0, import_i18n.__)("Content width"),
|
|
438
554
|
labelPosition: "top",
|
|
439
|
-
value:
|
|
555
|
+
value: localContentSizeValue ?? inheritedContentSizeValue,
|
|
556
|
+
placeholder: isContentSizePlaceholder ? getNumericPlaceholder(
|
|
557
|
+
inheritedContentSizeValue
|
|
558
|
+
) : void 0,
|
|
440
559
|
onChange: (nextContentSize) => {
|
|
441
560
|
setContentSizeValue(nextContentSize);
|
|
442
561
|
},
|
|
@@ -447,8 +566,12 @@ function DimensionsPanel({
|
|
|
447
566
|
}
|
|
448
567
|
),
|
|
449
568
|
showWideSizeControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
450
|
-
|
|
569
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
451
570
|
{
|
|
571
|
+
...inheritanceProps(
|
|
572
|
+
isWideSizePlaceholder,
|
|
573
|
+
hasUserSetWideSizeValue() && inheritedWideSizeValue !== void 0
|
|
574
|
+
),
|
|
452
575
|
label: (0, import_i18n.__)("Wide width"),
|
|
453
576
|
hasValue: hasUserSetWideSizeValue,
|
|
454
577
|
onDeselect: resetWideSizeValue,
|
|
@@ -459,7 +582,10 @@ function DimensionsPanel({
|
|
|
459
582
|
{
|
|
460
583
|
label: (0, import_i18n.__)("Wide width"),
|
|
461
584
|
labelPosition: "top",
|
|
462
|
-
value:
|
|
585
|
+
value: localWideSizeValue ?? inheritedWideSizeValue,
|
|
586
|
+
placeholder: isWideSizePlaceholder ? getNumericPlaceholder(
|
|
587
|
+
inheritedWideSizeValue
|
|
588
|
+
) : void 0,
|
|
463
589
|
onChange: (nextWideSize) => {
|
|
464
590
|
setWideSizeValue(nextWideSize);
|
|
465
591
|
},
|
|
@@ -470,21 +596,29 @@ function DimensionsPanel({
|
|
|
470
596
|
}
|
|
471
597
|
),
|
|
472
598
|
showPaddingControl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
473
|
-
|
|
599
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
474
600
|
{
|
|
475
601
|
hasValue: hasPaddingValue,
|
|
476
602
|
label: (0, import_i18n.__)("Padding"),
|
|
603
|
+
hasInlineEndToggle: hasSpacingToggle(
|
|
604
|
+
paddingSides,
|
|
605
|
+
showSpacingPresetsControl
|
|
606
|
+
),
|
|
477
607
|
onDeselect: resetPaddingValue,
|
|
478
608
|
isShownByDefault: defaultControls.padding ?? DEFAULT_CONTROLS.padding,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
609
|
+
...inheritanceProps(
|
|
610
|
+
isPaddingInherited,
|
|
611
|
+
hasPaddingValue() && hasInheritedPadding,
|
|
612
|
+
{
|
|
613
|
+
"tools-panel-item-spacing": showSpacingPresetsControl
|
|
614
|
+
}
|
|
615
|
+
),
|
|
482
616
|
panelId,
|
|
483
617
|
children: [
|
|
484
618
|
!showSpacingPresetsControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
485
619
|
import_components.BoxControl,
|
|
486
620
|
{
|
|
487
|
-
values:
|
|
621
|
+
values: localPaddingValues,
|
|
488
622
|
onChange: setPaddingValues,
|
|
489
623
|
label: (0, import_i18n.__)("Padding"),
|
|
490
624
|
sides: paddingSides,
|
|
@@ -493,7 +627,8 @@ function DimensionsPanel({
|
|
|
493
627
|
splitOnAxis: isAxialPadding,
|
|
494
628
|
inputProps: {
|
|
495
629
|
onMouseOver: onMouseOverPadding,
|
|
496
|
-
onMouseOut: onMouseLeaveControls
|
|
630
|
+
onMouseOut: onMouseLeaveControls,
|
|
631
|
+
placeholder: isPaddingPlaceholder ? inheritedPaddingPlaceholder : void 0
|
|
497
632
|
}
|
|
498
633
|
}
|
|
499
634
|
),
|
|
@@ -514,21 +649,29 @@ function DimensionsPanel({
|
|
|
514
649
|
}
|
|
515
650
|
),
|
|
516
651
|
showMarginControl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
517
|
-
|
|
652
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
518
653
|
{
|
|
519
654
|
hasValue: hasMarginValue,
|
|
520
655
|
label: (0, import_i18n.__)("Margin"),
|
|
656
|
+
hasInlineEndToggle: hasSpacingToggle(
|
|
657
|
+
marginSides,
|
|
658
|
+
showSpacingPresetsControl
|
|
659
|
+
),
|
|
521
660
|
onDeselect: resetMarginValue,
|
|
522
661
|
isShownByDefault: defaultControls.margin ?? DEFAULT_CONTROLS.margin,
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
662
|
+
...inheritanceProps(
|
|
663
|
+
isMarginInherited,
|
|
664
|
+
hasMarginValue() && hasInheritedMargin,
|
|
665
|
+
{
|
|
666
|
+
"tools-panel-item-spacing": showSpacingPresetsControl
|
|
667
|
+
}
|
|
668
|
+
),
|
|
526
669
|
panelId,
|
|
527
670
|
children: [
|
|
528
671
|
!showSpacingPresetsControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
529
672
|
import_components.BoxControl,
|
|
530
673
|
{
|
|
531
|
-
values:
|
|
674
|
+
values: localMarginValues,
|
|
532
675
|
onChange: setMarginValues,
|
|
533
676
|
inputProps: {
|
|
534
677
|
min: minMarginValue,
|
|
@@ -539,7 +682,8 @@ function DimensionsPanel({
|
|
|
539
682
|
setMinMarginValue(minimumMargin);
|
|
540
683
|
},
|
|
541
684
|
onMouseOver: onMouseOverMargin,
|
|
542
|
-
onMouseOut: onMouseLeaveControls
|
|
685
|
+
onMouseOut: onMouseLeaveControls,
|
|
686
|
+
placeholder: isMarginPlaceholder ? inheritedMarginPlaceholder : void 0
|
|
543
687
|
},
|
|
544
688
|
label: (0, import_i18n.__)("Margin"),
|
|
545
689
|
sides: marginSides,
|
|
@@ -566,19 +710,24 @@ function DimensionsPanel({
|
|
|
566
710
|
}
|
|
567
711
|
),
|
|
568
712
|
showGapControl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
569
|
-
|
|
713
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
570
714
|
{
|
|
571
715
|
hasValue: hasGapValue,
|
|
572
716
|
label: (0, import_i18n.__)("Block spacing"),
|
|
717
|
+
hasInlineEndToggle: isAxialGap,
|
|
573
718
|
onDeselect: resetGapValue,
|
|
574
719
|
isShownByDefault: defaultControls.blockGap ?? DEFAULT_CONTROLS.blockGap,
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
720
|
+
...inheritanceProps(
|
|
721
|
+
isGapPlaceholder,
|
|
722
|
+
hasGapValue() && inheritedGapRaw !== void 0,
|
|
723
|
+
{
|
|
724
|
+
"tools-panel-item-spacing": showSpacingPresetsControl,
|
|
725
|
+
"single-column": (
|
|
726
|
+
// If UnitControl is used, should be single-column.
|
|
727
|
+
!showSpacingPresetsControl && !isAxialGap
|
|
728
|
+
)
|
|
729
|
+
}
|
|
730
|
+
),
|
|
582
731
|
panelId,
|
|
583
732
|
children: [
|
|
584
733
|
!showSpacingPresetsControl && (isAxialGap ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -600,7 +749,8 @@ function DimensionsPanel({
|
|
|
600
749
|
min: 0,
|
|
601
750
|
onChange: setGapValue,
|
|
602
751
|
units,
|
|
603
|
-
value:
|
|
752
|
+
value: localGapRaw ?? void 0,
|
|
753
|
+
placeholder: isGapPlaceholder ? inheritedGapRaw : void 0
|
|
604
754
|
}
|
|
605
755
|
)),
|
|
606
756
|
showSpacingPresetsControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -630,8 +780,12 @@ function DimensionsPanel({
|
|
|
630
780
|
}
|
|
631
781
|
),
|
|
632
782
|
showMinHeightControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
633
|
-
|
|
783
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
634
784
|
{
|
|
785
|
+
...inheritanceProps(
|
|
786
|
+
isMinHeightPlaceholder,
|
|
787
|
+
hasMinHeightValue() && inheritedMinHeightValue !== void 0
|
|
788
|
+
),
|
|
635
789
|
hasValue: hasMinHeightValue,
|
|
636
790
|
label: (0, import_i18n.__)("Minimum height"),
|
|
637
791
|
onDeselect: resetMinHeightValue,
|
|
@@ -641,16 +795,23 @@ function DimensionsPanel({
|
|
|
641
795
|
import_dimension_control.default,
|
|
642
796
|
{
|
|
643
797
|
label: (0, import_i18n.__)("Minimum height"),
|
|
644
|
-
value:
|
|
798
|
+
value: localMinHeightValue ?? inheritedMinHeightValue,
|
|
645
799
|
onChange: setMinHeightValue,
|
|
800
|
+
placeholder: isMinHeightPlaceholder ? getNumericPlaceholder(
|
|
801
|
+
inheritedMinHeightValue
|
|
802
|
+
) : void 0,
|
|
646
803
|
dimensionSizes: dimensions?.dimensionSizes
|
|
647
804
|
}
|
|
648
805
|
)
|
|
649
806
|
}
|
|
650
807
|
),
|
|
651
808
|
showMinWidthControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
652
|
-
|
|
809
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
653
810
|
{
|
|
811
|
+
...inheritanceProps(
|
|
812
|
+
isMinWidthPlaceholder,
|
|
813
|
+
hasMinWidthValue() && inheritedMinWidthValue !== void 0
|
|
814
|
+
),
|
|
654
815
|
hasValue: hasMinWidthValue,
|
|
655
816
|
label: (0, import_i18n.__)("Minimum width"),
|
|
656
817
|
onDeselect: resetMinWidthValue,
|
|
@@ -660,16 +821,23 @@ function DimensionsPanel({
|
|
|
660
821
|
import_dimension_control.default,
|
|
661
822
|
{
|
|
662
823
|
label: (0, import_i18n.__)("Minimum width"),
|
|
663
|
-
value:
|
|
824
|
+
value: localMinWidthValue ?? inheritedMinWidthValue,
|
|
664
825
|
onChange: setMinWidthValue,
|
|
826
|
+
placeholder: isMinWidthPlaceholder ? getNumericPlaceholder(
|
|
827
|
+
inheritedMinWidthValue
|
|
828
|
+
) : void 0,
|
|
665
829
|
dimensionSizes: dimensions?.dimensionSizes
|
|
666
830
|
}
|
|
667
831
|
)
|
|
668
832
|
}
|
|
669
833
|
),
|
|
670
834
|
showHeightControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
671
|
-
|
|
835
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
672
836
|
{
|
|
837
|
+
...inheritanceProps(
|
|
838
|
+
isHeightPlaceholder,
|
|
839
|
+
hasHeightValue() && inheritedHeightValue !== void 0
|
|
840
|
+
),
|
|
673
841
|
hasValue: hasHeightValue,
|
|
674
842
|
label: (0, import_i18n.__)("Height"),
|
|
675
843
|
onDeselect: resetHeightValue,
|
|
@@ -679,16 +847,21 @@ function DimensionsPanel({
|
|
|
679
847
|
import_dimension_control.default,
|
|
680
848
|
{
|
|
681
849
|
label: (0, import_i18n.__)("Height"),
|
|
682
|
-
value:
|
|
850
|
+
value: localHeightValue,
|
|
683
851
|
onChange: setHeightValue,
|
|
852
|
+
placeholder: isHeightPlaceholder ? inheritedHeightValue : void 0,
|
|
684
853
|
dimensionSizes: dimensions?.dimensionSizes
|
|
685
854
|
}
|
|
686
855
|
)
|
|
687
856
|
}
|
|
688
857
|
),
|
|
689
858
|
showWidthControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
690
|
-
|
|
859
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
691
860
|
{
|
|
861
|
+
...inheritanceProps(
|
|
862
|
+
isWidthPlaceholder,
|
|
863
|
+
hasWidthValue() && inheritedWidthValue !== void 0
|
|
864
|
+
),
|
|
692
865
|
hasValue: hasWidthValue,
|
|
693
866
|
label: (0, import_i18n.__)("Width"),
|
|
694
867
|
onDeselect: resetWidthValue,
|
|
@@ -698,8 +871,9 @@ function DimensionsPanel({
|
|
|
698
871
|
import_dimension_control.default,
|
|
699
872
|
{
|
|
700
873
|
label: (0, import_i18n.__)("Width"),
|
|
701
|
-
value:
|
|
874
|
+
value: localWidthValue,
|
|
702
875
|
onChange: setWidthValue,
|
|
876
|
+
placeholder: isWidthPlaceholder ? inheritedWidthValue : void 0,
|
|
703
877
|
dimensionSizes: dimensions?.dimensionSizes
|
|
704
878
|
}
|
|
705
879
|
)
|
|
@@ -712,6 +886,10 @@ function DimensionsPanel({
|
|
|
712
886
|
value: aspectRatioValue,
|
|
713
887
|
onChange: setAspectRatioValue,
|
|
714
888
|
panelId,
|
|
889
|
+
...inheritanceProps(
|
|
890
|
+
isAspectRatioPlaceholder,
|
|
891
|
+
hasAspectRatioValue() && inheritedAspectRatioValue !== void 0
|
|
892
|
+
),
|
|
715
893
|
isShownByDefault: defaultControls.aspectRatio ?? DEFAULT_CONTROLS.aspectRatio
|
|
716
894
|
}
|
|
717
895
|
)
|