Refactor/reacrhitecture to fsd+ #49
-2
@@ -13,8 +13,6 @@ const CHAR_PROXIMITY_RANGE_PCT = 5;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Default render size in px when callers omit the `size` arg on `layout()`.
|
* Default render size in px when callers omit the `size` arg on `layout()`.
|
||||||
* Kept as a local constant to avoid pulling `$entities/Font` into
|
|
||||||
* `$shared/lib` (would create an FSD-illegal upward import cycle).
|
|
||||||
*/
|
*/
|
||||||
const DEFAULT_RENDER_SIZE_PX = 16;
|
const DEFAULT_RENDER_SIZE_PX = 16;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,5 @@
|
|||||||
// @vitest-environment jsdom
|
// @vitest-environment jsdom
|
||||||
|
import { installCanvasMock } from '$shared/lib/helpers/__mocks__/canvas';
|
||||||
import { clearCache } from '@chenglou/pretext';
|
import { clearCache } from '@chenglou/pretext';
|
||||||
import {
|
import {
|
||||||
beforeEach,
|
beforeEach,
|
||||||
@@ -6,7 +7,6 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
it,
|
it,
|
||||||
} from 'vitest';
|
} from 'vitest';
|
||||||
import { installCanvasMock } from '../__mocks__/canvas';
|
|
||||||
import { CharacterComparisonEngine } from './CharacterComparisonEngine.svelte';
|
import { CharacterComparisonEngine } from './CharacterComparisonEngine.svelte';
|
||||||
|
|
||||||
// FontA: 10px per character. FontB: 15px per character.
|
// FontA: 10px per character. FontB: 15px per character.
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
export {
|
||||||
|
CharacterComparisonEngine,
|
||||||
|
type ComparisonLine,
|
||||||
|
type ComparisonResult,
|
||||||
|
} from './CharacterComparisonEngine/CharacterComparisonEngine.svelte';
|
||||||
|
|
||||||
export { getFontUrl } from './getFontUrl/getFontUrl';
|
export { getFontUrl } from './getFontUrl/getFontUrl';
|
||||||
|
|
||||||
// Mock data helpers for Storybook and testing
|
// Mock data helpers for Storybook and testing
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
* - Virtual scrolling for large lists
|
* - Virtual scrolling for large lists
|
||||||
* - Debounced state for search inputs
|
* - Debounced state for search inputs
|
||||||
* - Entity stores with O(1) lookups
|
* - Entity stores with O(1) lookups
|
||||||
* - Character-by-character font comparison
|
|
||||||
* - Persistent localStorage-backed state
|
* - Persistent localStorage-backed state
|
||||||
* - Responsive breakpoint tracking
|
* - Responsive breakpoint tracking
|
||||||
* - 3D perspective animations
|
* - 3D perspective animations
|
||||||
@@ -116,24 +115,6 @@ export {
|
|||||||
type EntityStore,
|
type EntityStore,
|
||||||
} from './createEntityStore/createEntityStore.svelte';
|
} from './createEntityStore/createEntityStore.svelte';
|
||||||
|
|
||||||
/**
|
|
||||||
* Comparison logic
|
|
||||||
*/
|
|
||||||
export {
|
|
||||||
/**
|
|
||||||
* Character-by-character comparison utility
|
|
||||||
*/
|
|
||||||
CharacterComparisonEngine,
|
|
||||||
/**
|
|
||||||
* Single line of comparison results
|
|
||||||
*/
|
|
||||||
type ComparisonLine,
|
|
||||||
/**
|
|
||||||
* Full comparison output
|
|
||||||
*/
|
|
||||||
type ComparisonResult,
|
|
||||||
} from './CharacterComparisonEngine/CharacterComparisonEngine.svelte';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Text layout
|
* Text layout
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export {
|
export {
|
||||||
CharacterComparisonEngine,
|
|
||||||
type ComparisonLine,
|
|
||||||
type ComparisonResult,
|
|
||||||
type ControlDataModel,
|
type ControlDataModel,
|
||||||
type ControlModel,
|
type ControlModel,
|
||||||
createDebouncedState,
|
createDebouncedState,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import {
|
||||||
|
CharacterComparisonEngine,
|
||||||
MULTIPLIER_L,
|
MULTIPLIER_L,
|
||||||
MULTIPLIER_M,
|
MULTIPLIER_M,
|
||||||
MULTIPLIER_S,
|
MULTIPLIER_S,
|
||||||
@@ -20,9 +21,6 @@ import {
|
|||||||
debounce,
|
debounce,
|
||||||
} from '$shared/lib';
|
} from '$shared/lib';
|
||||||
import { cn } from '$shared/lib';
|
import { cn } from '$shared/lib';
|
||||||
import {
|
|
||||||
CharacterComparisonEngine,
|
|
||||||
} from '$shared/lib/helpers/CharacterComparisonEngine/CharacterComparisonEngine.svelte';
|
|
||||||
import { Loader } from '$shared/ui';
|
import { Loader } from '$shared/ui';
|
||||||
import { getContext } from 'svelte';
|
import { getContext } from 'svelte';
|
||||||
import { Spring } from 'svelte/motion';
|
import { Spring } from 'svelte/motion';
|
||||||
|
|||||||
Reference in New Issue
Block a user