Skip to content

feat: size and spacing steps#3452

Merged
bfintal merged 109 commits into
developfrom
feat/size-control-steps
May 30, 2025
Merged

feat: size and spacing steps#3452
bfintal merged 109 commits into
developfrom
feat/size-control-steps

Conversation

@bfintal
Copy link
Copy Markdown
Contributor

@bfintal bfintal commented Mar 7, 2025

fixes #3474

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2025

🤖 Pull request artifacts

file commit
pr3452-stackable-3452-merge.zip f3d9cca

github-actions Bot added a commit that referenced this pull request Mar 7, 2025
github-actions Bot added a commit that referenced this pull request Mar 7, 2025
github-actions Bot added a commit that referenced this pull request Mar 18, 2025
github-actions Bot added a commit that referenced this pull request Mar 18, 2025
github-actions Bot added a commit that referenced this pull request Mar 20, 2025
github-actions Bot added a commit that referenced this pull request Mar 23, 2025
github-actions Bot added a commit that referenced this pull request Mar 25, 2025
github-actions Bot added a commit that referenced this pull request May 26, 2025
github-actions Bot added a commit that referenced this pull request May 26, 2025
github-actions Bot added a commit that referenced this pull request May 26, 2025
github-actions Bot added a commit that referenced this pull request May 26, 2025
github-actions Bot added a commit that referenced this pull request May 26, 2025
github-actions Bot added a commit that referenced this pull request May 26, 2025
github-actions Bot added a commit that referenced this pull request May 27, 2025
github-actions Bot added a commit that referenced this pull request May 27, 2025
github-actions Bot added a commit that referenced this pull request May 27, 2025
github-actions Bot added a commit that referenced this pull request May 28, 2025
github-actions Bot added a commit that referenced this pull request May 29, 2025
@bfintal bfintal requested a review from Copilot May 30, 2025 01:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances size and spacing controls by integrating preset controls, expanding unit support, deprecating old numeric attributes in favor of responsive string values, and refactoring style generators to use valueCallback.

  • Added usePresetControls hooks and marks to various range controls for height, spacing, borders, columns, alignment, and buttons.
  • Deprecated numeric size/spacing attributes and introduced string-based attributes with migration helpers.
  • Replaced format: '%spx' with valueCallback in style files for consistent CSS variable handling and appended px.

Reviewed Changes

Copilot reviewed 102 out of 102 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/block-components/helpers/size/edit.js Expanded units, added usePresetControls import and marks
src/block-components/helpers/size/deprecated.js Defined deprecation helper for numeric height attribute
src/block-components/helpers/size/attributes.js Invoked deprecation, added new string‐based height attribute
src/block-components/helpers/borders/style.js Replaced format with valueCallback for all corner radii
src/block-components/helpers/borders/edit.js Imported usePresetControls, added marks to BorderRadius
src/block-components/columns/style.js Swapped format for valueCallback on spacing style rules
src/block-components/columns/index.js Exported new deprecation helper deprecateColumnAndRowGap
src/block-components/columns/edit.js Added usePresetControls import and marks to range controls
src/block-components/columns/deprecated/index.js Defined deprecated attributes and migration for column/row gaps
src/block-components/columns/attributes.js Invoked column/row gap deprecation, added new string‐type attrs
src/block-components/button/edit.js Imported usePresetControls, added marks to button padding
src/block-components/block-div/index.js Exported new deprecateBlockHeight helper
src/block-components/block-div/deprecated.js Added deprecateBlockHeight migration
src/block-components/alignment/style.js Replaced format with valueCallback on innerBlock gaps
src/block-components/alignment/index.js Exported deprecateInnerBlockRowGapAndContainerHeight
src/block-components/alignment/edit.js Added usePresetControls, injected marks into range controls
src/block-components/alignment/deprecated/index.js Defined deprecation helper for inner block row gap
src/block-components/alignment/attributes.js Invoked deprecation, added new string‐type innerBlockRowGap
plugin.php Bumped plugin version to 3.16.0, required preset-controls
e2e/tests/global-settings.spec.ts Updated test for text-transform instead of font-size

Comment thread src/block-components/helpers/size/edit.js Outdated
Comment thread src/block-components/helpers/size/attributes.js
key: 'borderTopLeftRadius2',
attrNameTemplate,
format: '%spx',
valueCallback: value => {
Copy link

Copilot AI May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This valueCallback logic is duplicated for each corner. Extract a shared helper function (e.g., appendPxOrVar) to reduce repetition and improve readability.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +30
valueCallback: value => {
// Substitute with using format to work with preset controls
if ( typeof value === 'string' && value.startsWith( 'var' ) ) {
return value
}
return value + 'px'
},
Copy link

Copilot AI May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same valueCallback pattern is repeated across multiple style rules. Consider creating a utility to handle 'var' checks and 'px' suffixing to avoid duplication.

Suggested change
valueCallback: value => {
// Substitute with using format to work with preset controls
if ( typeof value === 'string' && value.startsWith( 'var' ) ) {
return value
}
return value + 'px'
},
valueCallback: formatValue,

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
github-actions Bot added a commit that referenced this pull request May 30, 2025
@bfintal bfintal merged commit a759fd9 into develop May 30, 2025
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global Preset Controls and Typography Type Scale

4 participants