Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/block-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- Convert the store actions and private actions to TypeScript and add the store thunk arguments type ([#84672](https://github.com/WordPress/gutenberg/pull/84672)).
- Convert the block edit context, block context, block icon, block editing mode, `useSettings`, block refs, Global Styles utils and inheritance, and spacing size utils to TypeScript ([#84625](https://github.com/WordPress/gutenberg/pull/84625)).
- Convert the store defaults, `getBlockSettings` and the store index to TypeScript and type the theme.json settings the store reads ([#84677](https://github.com/WordPress/gutenberg/pull/84677)).
- Type `isValueSpacingPreset` as returning a boolean, since it returns `false` for custom values ([#84730](https://github.com/WordPress/gutenberg/pull/84730)).

## 18.1.0 (2026-10-07)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ export const VIEWS = {
*
* @return {boolean} Return true if value is string in format var:preset|spacing|.
*/
export function isValueSpacingPreset(
value: string | undefined
): value is string {
export function isValueSpacingPreset( value: string | undefined ): boolean {
return isValuePreset( value, SPACING_PRESET_TYPE );
}

Expand All @@ -86,7 +84,8 @@ export function getCustomValueFromPreset(
return value;
}

const slug = getPresetSlug( value, SPACING_PRESET_TYPE );
// Only a string can be a preset.
const slug = getPresetSlug( value!, SPACING_PRESET_TYPE );
const spacingSize = spacingSizes.find(
( size ) => String( size.slug ) === slug
);
Expand Down
Loading