Repository navigation
Block Editor: PR 30: Convert BorderRadiusControl and DimensionControl to TypeScript #84880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
manzoorwanijk
merged 8 commits into
refactor/block-editor-typescript-link-ui
from
refactor/block-editor-typescript-border-radius-control
Oct 16, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aa6ffd1
Block Editor: Convert BorderRadiusControl to TypeScript
manzoorwanijk fa7e0e8
Block Editor: Convert the BorderRadiusControl tests to TypeScript
manzoorwanijk 23178f5
Block Editor: Convert the BorderRadiusControl story to TypeScript
manzoorwanijk 7aaf137
Block Editor: Convert DimensionControl to TypeScript
manzoorwanijk 02fd206
Block Editor: Convert the DimensionControl story to TypeScript
manzoorwanijk 4d043af
Block Editor: Update the ESLint suppressions of the converted border …
manzoorwanijk c446c3c
Block Editor: Add the CHANGELOG entry for #84880
manzoorwanijk c215100
Block Editor: Accept numeric values in BorderRadiusControl and Dimens…
manzoorwanijk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...s/border-radius-control/linked-button.jsx → ...s/border-radius-control/linked-button.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
packages/block-editor/src/components/border-radius-control/types.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import type { ComponentProps } from 'react'; | ||
| import type { Button } from '@wordpress/components'; | ||
| import type { Preset } from '../preset-input-control/types'; | ||
|
|
||
| /** | ||
| * A corner of the border radius. | ||
| */ | ||
| export type BorderRadiusCorner = | ||
| 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'; | ||
|
|
||
| /** | ||
| * The radius of each corner. | ||
| */ | ||
| export type BorderRadiusCornerValues = Partial< | ||
| Record< BorderRadiusCorner, string > | ||
| >; | ||
|
|
||
| /** | ||
| * Corner values whose presets are converted to their sizes. | ||
| */ | ||
| export type BorderRadiusConvertedValues = Partial< | ||
| Record< BorderRadiusCorner, string | number > | ||
| >; | ||
|
|
||
| /** | ||
| * Border radius values, either a shorthand value or one per corner, where a | ||
| * stored corner may be the number `0`. Global styles also pass the shared | ||
| * radius of an inherited value as `all`. | ||
| */ | ||
| export type BorderRadiusValues = | ||
| string | ( BorderRadiusConvertedValues & { all?: string } ); | ||
|
|
||
| /** | ||
| * The selected units of the flat radius and each corner. | ||
| */ | ||
| export type BorderRadiusUnits = Partial< | ||
| Record< BorderRadiusCorner | 'flat', string > | ||
| >; | ||
|
|
||
| /** | ||
| * Border radius presets, by origin. | ||
| */ | ||
| export interface BorderRadiusPresets { | ||
| default?: Preset[]; | ||
| theme?: Preset[]; | ||
| custom?: Preset[]; | ||
| } | ||
|
|
||
| /** | ||
| * Props of `BorderRadiusControl`. | ||
| */ | ||
| export interface BorderRadiusControlProps { | ||
| /** | ||
| * Callback to handle onChange. Corners the change leaves alone keep their | ||
| * stored values, which may be the number `0`. | ||
| */ | ||
| onChange: ( values: BorderRadiusConvertedValues ) => void; | ||
| /** | ||
| * Border radius values. | ||
| */ | ||
| values?: BorderRadiusValues; | ||
| /** | ||
| * Border radius presets. | ||
| */ | ||
| presets?: BorderRadiusPresets; | ||
| } | ||
|
|
||
| /** | ||
| * Props of the `LinkedButton` of `BorderRadiusControl`. | ||
| */ | ||
| export type BorderRadiusLinkedButtonProps = ComponentProps< typeof Button > & { | ||
| isLinked: boolean; | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.