From 6ac7ae07d4144eaf312094ddb680e0a591d88ff1 Mon Sep 17 00:00:00 2001 From: Toberumono Date: Sun, 28 Dec 2025 17:36:56 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74278=20[@wordpres?= =?UTF-8?q?s/block-editor]=20Updated=20the=20useTypographyProps=20definiti?= =?UTF-8?q?on=20to=20allow=20newer=20options=20by=20@Toberumono?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wordpress__block-editor/hooks/use-typography-props.d.ts | 5 +++-- types/wordpress__block-editor/package.json | 1 + .../wordpress__block-editor-tests.tsx | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/wordpress__block-editor/hooks/use-typography-props.d.ts b/types/wordpress__block-editor/hooks/use-typography-props.d.ts index 7e70730d739149..b9980ea21007b8 100644 --- a/types/wordpress__block-editor/hooks/use-typography-props.d.ts +++ b/types/wordpress__block-editor/hooks/use-typography-props.d.ts @@ -1,4 +1,5 @@ import { BlockAttributes } from "@wordpress/blocks"; +import { GlobalStylesSettings } from "@wordpress/global-styles-engine"; /** * Provides the CSS class names and inline styles for a block's typography support @@ -6,11 +7,11 @@ import { BlockAttributes } from "@wordpress/blocks"; * * @param attributes Block attributes. * @param fluidTypographySettings If boolean, whether the function should try to convert font sizes to fluid values, - * otherwise an object containing theme fluid typography settings. + * otherwise an object containing theme (typography) settings. * * @return Typography block support derived CSS classes & styles. */ export function getTypographyClassesAndStyles( attributes: BlockAttributes, - fluidTypographySettings: { minFontSize?: string } | boolean, + fluidTypographySettings?: { minFontSize?: string } | GlobalStylesSettings | boolean, ): { className: string; style: Record }; diff --git a/types/wordpress__block-editor/package.json b/types/wordpress__block-editor/package.json index a6efe82a33da4f..1a383461ea76c3 100644 --- a/types/wordpress__block-editor/package.json +++ b/types/wordpress__block-editor/package.json @@ -11,6 +11,7 @@ "@wordpress/components": "^29.12.0", "@wordpress/data": "^10.26.0", "@wordpress/element": "^6.26.0", + "@wordpress/global-styles-engine": "^1.4.0", "@wordpress/keycodes": "^4.26.0", "react-autosize-textarea": "^7.1.0" }, diff --git a/types/wordpress__block-editor/wordpress__block-editor-tests.tsx b/types/wordpress__block-editor/wordpress__block-editor-tests.tsx index 92c27713fa770b..f1f965ad4f86f6 100644 --- a/types/wordpress__block-editor/wordpress__block-editor-tests.tsx +++ b/types/wordpress__block-editor/wordpress__block-editor-tests.tsx @@ -683,6 +683,9 @@ be.getTypographyClassesAndStyles({}, false).style; be.getTypographyClassesAndStyles({}, {}).style; be.getTypographyClassesAndStyles({}, { minFontSize: "33" }).style; +// $ExpectType string +be.getTypographyClassesAndStyles({}).className; + // $ExpectType "HELLO" be.useCachedTruthy("HELLO");