feat(proxyFonts): add fetchFontsById function that fetches batch of fonts

This commit is contained in:
Ilia Mashkov
2026-02-01 16:12:37 +03:00
parent 5bb41c7e4c
commit 0ac6acd174
2 changed files with 38 additions and 3 deletions

View File

@@ -9,7 +9,8 @@ import {
FontVirtualList,
unifiedFontStore,
} from '$entities/Font';
import { cn } from '$shared/shadcn/utils/shadcn-utils';
import { displayedFontsStore } from '$features/DisplayFont';
import FontSampler from '$features/DisplayFont/ui/FontSampler/FontSampler.svelte';
/**
* Load more fonts by moving to the next page
@@ -57,8 +58,11 @@ const displayRange = $derived.by(() => {
items={unifiedFontStore.fonts}
total={unifiedFontStore.pagination.total}
onNearBottom={handleNearBottom}
itemHeight={280}
>
{#snippet children({ item: font, isVisible, proximity })}
<FontListItem {font} {isVisible} {proximity} />
{#snippet children({ item: font, isVisible, proximity, index })}
<FontListItem {font} {isVisible} {proximity}>
<FontSampler font={font} bind:text={displayedFontsStore.text} index={index} />
</FontListItem>
{/snippet}
</FontVirtualList>