refactor(Font): consolidate API layer and update type structure
This commit is contained in:
@@ -16,19 +16,20 @@ import {
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
* Applied font
|
||||
* Font to apply
|
||||
*/
|
||||
font: UnifiedFont;
|
||||
/**
|
||||
* Font weight
|
||||
* @default 400
|
||||
*/
|
||||
weight?: number;
|
||||
/**
|
||||
* Additional classes
|
||||
* CSS classes
|
||||
*/
|
||||
className?: string;
|
||||
/**
|
||||
* Children
|
||||
* Content snippet
|
||||
*/
|
||||
children?: Snippet;
|
||||
}
|
||||
@@ -44,7 +45,7 @@ const status = $derived(
|
||||
appliedFontsManager.getFontStatus(
|
||||
font.id,
|
||||
weight,
|
||||
font.features.isVariable,
|
||||
font.features?.isVariable,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ interface Props extends
|
||||
>
|
||||
{
|
||||
/**
|
||||
* Callback for when visible items change
|
||||
* Visible items callback
|
||||
*/
|
||||
onVisibleItemsChange?: (items: UnifiedFont[]) => void;
|
||||
/**
|
||||
* Weight of the font
|
||||
* Font weight
|
||||
*/
|
||||
weight: number;
|
||||
/**
|
||||
@@ -69,6 +69,7 @@ function handleInternalVisibleChange(visibleItems: UnifiedFont[]) {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Auto-register fonts with the manager
|
||||
appliedFontsManager.touch(configs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user