diff --git a/src/features/FetchFontsByIds/model/store/fontsByIdsStore/fontsByIdsStore.svelte.ts b/src/entities/Font/model/store/fontsByIdsStore/fontsByIdsStore.svelte.ts similarity index 93% rename from src/features/FetchFontsByIds/model/store/fontsByIdsStore/fontsByIdsStore.svelte.ts rename to src/entities/Font/model/store/fontsByIdsStore/fontsByIdsStore.svelte.ts index 7285768..a2cb585 100644 --- a/src/features/FetchFontsByIds/model/store/fontsByIdsStore/fontsByIdsStore.svelte.ts +++ b/src/entities/Font/model/store/fontsByIdsStore/fontsByIdsStore.svelte.ts @@ -1,14 +1,14 @@ +import { fontKeys } from '$shared/api/queryKeys'; +import { BaseQueryStore } from '$shared/lib'; import { fetchFontsByIds, seedFontCache, -} from '$entities/Font/api/proxy/proxyFonts'; +} from '../../../api/proxy/proxyFonts'; import { FontNetworkError, FontResponseError, -} from '$entities/Font/lib/errors/errors'; -import type { UnifiedFont } from '$entities/Font/model/types'; -import { fontKeys } from '$shared/api/queryKeys'; -import { BaseQueryStore } from '$shared/lib'; +} from '../../../lib/errors/errors'; +import type { UnifiedFont } from '../../types'; /** * Internal fetcher that seeds the cache and handles error wrapping. diff --git a/src/features/FetchFontsByIds/model/store/fontsByIdsStore/fontsByIdsStore.test.ts b/src/entities/Font/model/store/fontsByIdsStore/fontsByIdsStore.test.ts similarity index 97% rename from src/features/FetchFontsByIds/model/store/fontsByIdsStore/fontsByIdsStore.test.ts rename to src/entities/Font/model/store/fontsByIdsStore/fontsByIdsStore.test.ts index 7849535..0acf5a9 100644 --- a/src/features/FetchFontsByIds/model/store/fontsByIdsStore/fontsByIdsStore.test.ts +++ b/src/entities/Font/model/store/fontsByIdsStore/fontsByIdsStore.test.ts @@ -1,8 +1,3 @@ -import * as api from '$entities/Font/api/proxy/proxyFonts'; -import { - FontNetworkError, - FontResponseError, -} from '$entities/Font/lib/errors/errors'; import { queryClient } from '$shared/api/queryClient'; import { fontKeys } from '$shared/api/queryKeys'; import { @@ -12,6 +7,11 @@ import { it, vi, } from 'vitest'; +import * as api from '../../../api/proxy/proxyFonts'; +import { + FontNetworkError, + FontResponseError, +} from '../../../lib/errors/errors'; import { FontsByIdsStore } from './fontsByIdsStore.svelte'; describe('FontsByIdsStore', () => { diff --git a/src/entities/Font/model/store/index.ts b/src/entities/Font/model/store/index.ts index 97ebad0..52dda36 100644 --- a/src/entities/Font/model/store/index.ts +++ b/src/entities/Font/model/store/index.ts @@ -7,3 +7,6 @@ export { FontCatalogStore, fontCatalogStore, } from './fontCatalogStore/fontCatalogStore.svelte'; + +// Batch fetch by IDs (detail-cache seeding) +export { FontsByIdsStore } from './fontsByIdsStore/fontsByIdsStore.svelte'; diff --git a/src/features/FetchFontsByIds/index.ts b/src/features/FetchFontsByIds/index.ts deleted file mode 100644 index 600c651..0000000 --- a/src/features/FetchFontsByIds/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { FontsByIdsStore } from './model'; diff --git a/src/features/FetchFontsByIds/model/index.ts b/src/features/FetchFontsByIds/model/index.ts deleted file mode 100644 index c449f87..0000000 --- a/src/features/FetchFontsByIds/model/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { FontsByIdsStore } from './store/fontsByIdsStore/fontsByIdsStore.svelte'; diff --git a/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts b/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts index f43cce4..54b6ab3 100644 --- a/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts +++ b/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts @@ -15,13 +15,13 @@ import { type FontLoadRequestConfig, + FontsByIdsStore, type UnifiedFont, fontCatalogStore, fontLifecycleManager, getFontUrl, } from '$entities/Font'; import { typographySettingsStore } from '$features/AdjustTypography/model'; -import { FontsByIdsStore } from '$features/FetchFontsByIds'; import { createPersistentStore } from '$shared/lib'; import { untrack } from 'svelte'; import { getPretextFontString } from '../../lib';