@wordpress/block-editor 16.0.1-next.v.202607070741.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 +27 -1
- 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-canvas/index.cjs +6 -1
- package/build/components/block-canvas/index.cjs.map +2 -2
- package/build/components/block-controls/groups.cjs +3 -1
- package/build/components/block-controls/groups.cjs.map +2 -2
- package/build/components/block-edit/edit.cjs +10 -18
- package/build/components/block-edit/edit.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/block.cjs +9 -3
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/index.cjs +1 -3
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +7 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs +9 -4
- 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-focus-handler.cjs +11 -4
- 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/index.cjs +43 -24
- package/build/components/block-toolbar/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-tools/index.cjs +7 -2
- package/build/components/block-tools/index.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/block-visibility/modal.cjs +20 -6
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/use-block-visibility.cjs +16 -6
- package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
- package/build/components/block-visibility/utils.cjs +15 -2
- package/build/components/block-visibility/utils.cjs.map +3 -3
- package/build/components/block-visibility/viewport-menu-item.cjs +7 -1
- package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
- package/build/components/block-visibility/viewport-toolbar.cjs +5 -0
- package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +5 -1
- package/build/components/block-visibility/viewport-visibility-info.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/child-layout-control/index.cjs +0 -4
- package/build/components/child-layout-control/index.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-badges.cjs +39 -3
- package/build/components/global-styles/state-control-badges.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 -79
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/image-size-control/index.cjs +2 -4
- package/build/components/image-size-control/index.cjs.map +2 -2
- package/build/components/inserter/media-tab/hooks.cjs +33 -6
- package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-panel.cjs +78 -16
- package/build/components/inserter/media-tab/media-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/keyboard-shortcuts/index.cjs +19 -11
- package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
- package/build/components/line-height-control/index.cjs +1 -2
- 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/list-view/block.cjs +13 -4
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/media-placeholder/index.cjs +0 -1
- package/build/components/media-placeholder/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/event-listeners/before-input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/delete.cjs +2 -3
- package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +3 -2
- package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/paste-handler.cjs +2 -1
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
- package/build/components/rich-text/index.cjs +76 -17
- 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/typewriter/index.cjs +129 -136
- package/build/components/typewriter/index.cjs.map +3 -3
- package/build/components/url-input/index.cjs +303 -344
- package/build/components/url-input/index.cjs.map +3 -3
- package/build/components/use-block-commands/index.cjs +21 -17
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/use-on-block-drop/index.cjs +1 -1
- package/build/components/use-on-block-drop/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +14 -1
- package/build/components/writing-flow/index.cjs.map +3 -3
- package/build/components/writing-flow/use-arrow-nav.cjs +42 -6
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-click-selection.cjs +29 -3
- package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-clipboard-handler.cjs +4 -1
- package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
- package/build/components/writing-flow/use-drag-selection.cjs +3 -8
- package/build/components/writing-flow/use-drag-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 +75 -0
- package/build/components/writing-flow/use-editable-root.cjs.map +7 -0
- package/build/components/writing-flow/use-home-end.cjs +64 -0
- package/build/components/writing-flow/use-home-end.cjs.map +7 -0
- package/build/components/writing-flow/use-input.cjs +15 -5
- package/build/components/writing-flow/use-input.cjs.map +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-select-all.cjs +14 -2
- package/build/components/writing-flow/use-select-all.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +132 -22
- package/build/components/writing-flow/use-selection-observer.cjs.map +3 -3
- package/build/components/writing-flow/utils.cjs +28 -2
- package/build/components/writing-flow/utils.cjs.map +2 -2
- package/build/hooks/background.cjs +14 -10
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-fields/rich-text/index.cjs +2 -3
- package/build/hooks/block-fields/rich-text/index.cjs.map +3 -3
- 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 +15 -5
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +5 -3
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +22 -12
- package/build/hooks/layout-child.cjs.map +3 -3
- package/build/hooks/layout.cjs +28 -13
- package/build/hooks/layout.cjs.map +3 -3
- package/build/hooks/line-height.cjs +1 -2
- package/build/hooks/line-height.cjs.map +2 -2
- package/build/hooks/states.cjs +27 -7
- package/build/hooks/states.cjs.map +3 -3
- package/build/hooks/style.cjs +31 -9
- package/build/hooks/style.cjs.map +3 -3
- package/build/hooks/text-align.cjs +36 -6
- package/build/hooks/text-align.cjs.map +3 -3
- package/build/hooks/typography.cjs +14 -5
- package/build/hooks/typography.cjs.map +2 -2
- package/build/layouts/constrained.cjs +14 -6
- package/build/layouts/constrained.cjs.map +2 -2
- package/build/layouts/flex.cjs +27 -19
- package/build/layouts/flex.cjs.map +2 -2
- package/build/layouts/grid.cjs +0 -2
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +9 -5
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +11 -6
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +41 -3
- package/build/store/private-selectors.cjs.map +3 -3
- 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/block-bindings.cjs +29 -0
- package/build/utils/block-bindings.cjs.map +2 -2
- package/build/utils/dom.cjs +14 -0
- package/build/utils/dom.cjs.map +2 -2
- package/build/{components/rich-text/input-event.cjs → utils/native-undo.cjs} +29 -24
- 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-canvas/index.mjs +7 -2
- package/build-module/components/block-canvas/index.mjs.map +2 -2
- package/build-module/components/block-controls/groups.mjs +3 -1
- package/build-module/components/block-controls/groups.mjs.map +2 -2
- package/build-module/components/block-edit/edit.mjs +11 -18
- package/build-module/components/block-edit/edit.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/block.mjs +9 -3
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/index.mjs +1 -3
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +7 -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-first-element.mjs +9 -4
- 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-focus-handler.mjs +11 -4
- 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/index.mjs +43 -24
- package/build-module/components/block-toolbar/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-tools/index.mjs +7 -2
- package/build-module/components/block-tools/index.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/block-visibility/modal.mjs +22 -10
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +17 -7
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/block-visibility/utils.mjs +18 -3
- package/build-module/components/block-visibility/utils.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-menu-item.mjs +7 -1
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-toolbar.mjs +5 -0
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +5 -1
- package/build-module/components/block-visibility/viewport-visibility-info.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/child-layout-control/index.mjs +0 -4
- package/build-module/components/child-layout-control/index.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-badges.mjs +41 -5
- package/build-module/components/global-styles/state-control-badges.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 -80
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/image-size-control/index.mjs +2 -4
- package/build-module/components/image-size-control/index.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
- package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-panel.mjs +86 -18
- package/build-module/components/inserter/media-tab/media-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/keyboard-shortcuts/index.mjs +19 -11
- package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/components/line-height-control/index.mjs +1 -2
- 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/list-view/block.mjs +13 -4
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/media-placeholder/index.mjs +0 -1
- package/build-module/components/media-placeholder/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/event-listeners/before-input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/delete.mjs +7 -4
- package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +8 -3
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +79 -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/typewriter/index.mjs +129 -136
- package/build-module/components/typewriter/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/use-block-commands/index.mjs +21 -17
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/use-on-block-drop/index.mjs +2 -2
- package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +14 -1
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +43 -7
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-click-selection.mjs +29 -3
- package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs +5 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
- package/build-module/components/writing-flow/use-drag-selection.mjs +1 -6
- package/build-module/components/writing-flow/use-drag-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 +54 -0
- package/build-module/components/writing-flow/use-editable-root.mjs.map +7 -0
- package/build-module/components/writing-flow/use-home-end.mjs +43 -0
- package/build-module/components/writing-flow/use-home-end.mjs.map +7 -0
- package/build-module/components/writing-flow/use-input.mjs +15 -5
- package/build-module/components/writing-flow/use-input.mjs.map +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-select-all.mjs +19 -3
- package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +134 -21
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/components/writing-flow/utils.mjs +26 -1
- package/build-module/components/writing-flow/utils.mjs.map +2 -2
- package/build-module/hooks/background.mjs +14 -10
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-fields/rich-text/index.mjs +2 -6
- package/build-module/hooks/block-fields/rich-text/index.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 +15 -5
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +5 -3
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +22 -12
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +28 -13
- package/build-module/hooks/layout.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/states.mjs +27 -7
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +40 -11
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/text-align.mjs +39 -10
- package/build-module/hooks/text-align.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +14 -5
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/constrained.mjs +14 -6
- package/build-module/layouts/constrained.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +27 -19
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +0 -2
- package/build-module/layouts/grid.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 +12 -7
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +42 -3
- 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/block-bindings.mjs +28 -0
- package/build-module/utils/block-bindings.mjs.map +2 -2
- package/build-module/utils/dom.mjs +13 -0
- package/build-module/utils/dom.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 +14 -27
- package/build-style/content.css +14 -27
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +191 -61
- package/build-style/style.css +191 -61
- package/build-types/components/block-context/index.d.ts +7 -0
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/block-bindings.d.ts +19 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts +11 -0
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/get-px-from-css-unit.d.ts +2 -2
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -1
- package/build-types/utils/pasting.d.ts +1 -1
- package/build-types/utils/pasting.d.ts.map +1 -1
- package/package.json +43 -44
- 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-canvas/index.js +9 -2
- package/src/components/block-card/style.scss +1 -1
- package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
- package/src/components/block-controls/groups.js +2 -0
- package/src/components/block-edit/edit.js +13 -31
- 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/block.js +6 -0
- package/src/components/block-list/content.scss +1 -11
- package/src/components/block-list/index.js +0 -2
- package/src/components/block-list/use-block-props/index.js +7 -1
- package/src/components/block-list/use-block-props/use-focus-first-element.js +23 -4
- package/src/components/block-list/use-block-props/use-focus-handler.js +35 -9
- package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
- package/src/components/block-lock/style.scss +1 -1
- package/src/components/block-manager/style.scss +1 -1
- package/src/components/block-navigation/style.scss +1 -1
- package/src/components/block-parent-selector/index.js +5 -2
- package/src/components/block-quick-navigation/style.scss +1 -3
- package/src/components/block-styles/style.scss +2 -2
- package/src/components/block-toolbar/index.js +41 -18
- 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-tools/index.js +7 -0
- package/src/components/block-types-list/style.scss +0 -1
- 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/block-visibility/modal.js +24 -10
- package/src/components/block-visibility/style.scss +1 -1
- package/src/components/block-visibility/test/use-block-visibility.js +128 -35
- package/src/components/block-visibility/test/utils.js +11 -0
- package/src/components/block-visibility/use-block-visibility.js +33 -11
- package/src/components/block-visibility/utils.js +31 -6
- package/src/components/block-visibility/viewport-menu-item.js +10 -1
- package/src/components/block-visibility/viewport-toolbar.js +6 -0
- package/src/components/block-visibility/viewport-visibility-info.js +5 -1
- 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 +7 -9
- package/src/components/child-layout-control/index.js +0 -4
- package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -3
- 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/font-family/stories/index.story.jsx +1 -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-badges.js +45 -6
- package/src/components/global-styles/state-control.js +2 -2
- package/src/components/global-styles/style.scss +5 -0
- 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/state-control-badges.js +65 -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 -101
- package/src/components/image-editor/style.scss +33 -0
- package/src/components/image-size-control/index.js +0 -2
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
- package/src/components/inserter/media-tab/hooks.js +55 -7
- package/src/components/inserter/media-tab/media-panel.js +117 -21
- package/src/components/inserter/media-tab/test/hooks.js +63 -0
- package/src/components/inserter/media-tab/test/media-panel.js +127 -0
- package/src/components/inserter/style.scss +19 -16
- package/src/components/inserter-list-item/style.scss +0 -15
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
- package/src/components/keyboard-shortcuts/index.js +28 -11
- package/src/components/line-height-control/index.js +1 -2
- package/src/components/link-control/index.js +7 -2
- package/src/components/link-control/style.scss +2 -2
- package/src/components/link-control/test/index.js +6 -6
- package/src/components/link-picker/style.scss +1 -2
- package/src/components/list-view/block.js +13 -4
- package/src/components/list-view/style.scss +4 -5
- package/src/components/media-placeholder/index.js +0 -1
- package/src/components/multi-selection-inspector/style.scss +1 -1
- 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/responsive-block-control/style.scss +1 -1
- package/src/components/rich-text/event-listeners/before-input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/delete.js +7 -4
- package/src/components/rich-text/event-listeners/enter.js +10 -4
- package/src/components/rich-text/event-listeners/input-events.js +4 -3
- package/src/components/rich-text/event-listeners/input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +4 -3
- package/src/components/rich-text/event-listeners/paste-handler.js +15 -3
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +4 -3
- package/src/components/rich-text/index.js +116 -26
- package/src/components/skip-to-selected-block/style.scss +1 -1
- 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/typewriter/index.js +228 -224
- package/src/components/url-input/index.js +363 -431
- package/src/components/url-input/test/index.js +592 -0
- package/src/components/use-block-commands/index.js +27 -17
- package/src/components/use-on-block-drop/index.js +2 -2
- package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
- package/src/components/writing-flow/index.js +17 -1
- package/src/components/writing-flow/use-arrow-nav.js +90 -13
- package/src/components/writing-flow/use-click-selection.js +55 -5
- package/src/components/writing-flow/use-clipboard-handler.js +5 -2
- package/src/components/writing-flow/use-drag-selection.js +1 -14
- package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
- package/src/components/writing-flow/use-editable-root.js +112 -0
- package/src/components/writing-flow/use-home-end.js +71 -0
- package/src/components/writing-flow/use-input.js +25 -8
- package/src/components/writing-flow/use-multi-selection.js +2 -3
- package/src/components/writing-flow/use-select-all.js +33 -3
- package/src/components/writing-flow/use-selection-observer.js +218 -42
- package/src/components/writing-flow/utils.js +62 -0
- package/src/hooks/background.js +27 -24
- package/src/hooks/block-fields/link/styles.scss +1 -6
- package/src/hooks/block-fields/media/styles.scss +1 -6
- package/src/hooks/block-fields/rich-text/index.js +6 -9
- 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 -4
- package/src/hooks/grid-visualizer.js +40 -36
- package/src/hooks/layout-child.js +19 -9
- package/src/hooks/layout.js +48 -31
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/states.js +38 -9
- package/src/hooks/style.js +67 -17
- package/src/hooks/test/inherited-value-wiring.js +411 -0
- package/src/hooks/test/preset-round-trip.js +456 -0
- package/src/hooks/test/style.js +29 -0
- package/src/hooks/test/text-align.js +34 -1
- package/src/hooks/text-align.js +41 -10
- package/src/hooks/typography.js +35 -24
- package/src/layouts/constrained.js +5 -1
- package/src/layouts/flex.js +5 -1
- package/src/layouts/grid.js +0 -2
- package/src/private-apis.js +11 -2
- package/src/store/actions.js +53 -19
- package/src/store/private-selectors.js +82 -6
- package/src/store/reducer.js +9 -9
- package/src/store/selectors.js +56 -8
- package/src/store/test/actions.js +1 -1
- package/src/store/test/private-selectors.js +271 -1
- package/src/style.scss +2 -0
- package/src/utils/block-bindings.ts +50 -0
- package/src/utils/dom.ts +33 -0
- package/src/utils/native-undo.js +56 -0
- package/src/utils/test/block-bindings.js +181 -0
- package/build/components/duotone/utils.cjs +0 -87
- package/build/components/duotone/utils.cjs.map +0 -7
- package/build/components/rich-text/input-event.cjs.map +0 -7
- package/build/components/rich-text/shortcut.cjs +0 -51
- package/build/components/rich-text/shortcut.cjs.map +0 -7
- package/build-module/components/duotone/utils.mjs +0 -59
- package/build-module/components/duotone/utils.mjs.map +0 -7
- package/build-module/components/rich-text/input-event.mjs +0 -25
- package/build-module/components/rich-text/input-event.mjs.map +0 -7
- package/build-module/components/rich-text/shortcut.mjs +0 -26
- package/build-module/components/rich-text/shortcut.mjs.map +0 -7
- package/src/components/duotone/utils.js +0 -90
- package/src/components/rich-text/input-event.js +0 -31
- package/src/components/rich-text/shortcut.js +0 -32
- 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
|
)
|