From e49148008bf836d40755dd2470772d746b439c2a Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Sun, 31 May 2026 17:08:48 +0300 Subject: [PATCH] refactor(Font): remove typography-control config, keep render defaults --- src/entities/Font/model/const/const.ts | 57 ------------------- src/entities/Font/model/types/index.ts | 1 - src/entities/Font/model/types/typography.ts | 1 - .../typographySettingsStore.test.ts | 2 +- 4 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 src/entities/Font/model/types/typography.ts diff --git a/src/entities/Font/model/const/const.ts b/src/entities/Font/model/const/const.ts index 971dca4..9503e20 100644 --- a/src/entities/Font/model/const/const.ts +++ b/src/entities/Font/model/const/const.ts @@ -1,6 +1,3 @@ -import type { ControlModel } from '$shared/lib'; -import type { ControlId } from '../types/typography'; - /** * Font size constants */ @@ -33,60 +30,6 @@ export const MIN_LETTER_SPACING = -0.1; export const MAX_LETTER_SPACING = 0.5; export const LETTER_SPACING_STEP = 0.01; -export const DEFAULT_TYPOGRAPHY_CONTROLS_DATA: ControlModel[] = [ - { - id: 'font_size', - value: DEFAULT_FONT_SIZE, - max: MAX_FONT_SIZE, - min: MIN_FONT_SIZE, - step: FONT_SIZE_STEP, - - increaseLabel: 'Increase Font Size', - decreaseLabel: 'Decrease Font Size', - controlLabel: 'Size', - }, - { - id: 'font_weight', - value: DEFAULT_FONT_WEIGHT, - max: MAX_FONT_WEIGHT, - min: MIN_FONT_WEIGHT, - step: FONT_WEIGHT_STEP, - - increaseLabel: 'Increase Font Weight', - decreaseLabel: 'Decrease Font Weight', - controlLabel: 'Weight', - }, - { - id: 'line_height', - value: DEFAULT_LINE_HEIGHT, - max: MAX_LINE_HEIGHT, - min: MIN_LINE_HEIGHT, - step: LINE_HEIGHT_STEP, - - increaseLabel: 'Increase Line Height', - decreaseLabel: 'Decrease Line Height', - controlLabel: 'Leading', - }, - { - id: 'letter_spacing', - value: DEFAULT_LETTER_SPACING, - max: MAX_LETTER_SPACING, - min: MIN_LETTER_SPACING, - step: LETTER_SPACING_STEP, - - increaseLabel: 'Increase Letter Spacing', - decreaseLabel: 'Decrease Letter Spacing', - controlLabel: 'Tracking', - }, -]; - -/** - * Font size multipliers - */ -export const MULTIPLIER_S = 0.5; -export const MULTIPLIER_M = 0.75; -export const MULTIPLIER_L = 1; - /** * Index value for items not yet loaded in a virtualized list. * Treated as being at the very bottom of the infinite scroll. diff --git a/src/entities/Font/model/types/index.ts b/src/entities/Font/model/types/index.ts index b23390c..fd43b4d 100644 --- a/src/entities/Font/model/types/index.ts +++ b/src/entities/Font/model/types/index.ts @@ -24,4 +24,3 @@ export type { } from './store'; export * from './store/fontLifecycle'; -export * from './typography'; diff --git a/src/entities/Font/model/types/typography.ts b/src/entities/Font/model/types/typography.ts deleted file mode 100644 index 19104a2..0000000 --- a/src/entities/Font/model/types/typography.ts +++ /dev/null @@ -1 +0,0 @@ -export type ControlId = 'font_size' | 'font_weight' | 'line_height' | 'letter_spacing'; diff --git a/src/features/AdjustTypography/model/store/typographySettingsStore/typographySettingsStore.test.ts b/src/features/AdjustTypography/model/store/typographySettingsStore/typographySettingsStore.test.ts index 094bf75..5d99eb5 100644 --- a/src/features/AdjustTypography/model/store/typographySettingsStore/typographySettingsStore.test.ts +++ b/src/features/AdjustTypography/model/store/typographySettingsStore/typographySettingsStore.test.ts @@ -6,7 +6,6 @@ import { DEFAULT_FONT_WEIGHT, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, - DEFAULT_TYPOGRAPHY_CONTROLS_DATA, } from '$entities/Font'; import { beforeEach, @@ -15,6 +14,7 @@ import { it, vi, } from 'vitest'; +import { DEFAULT_TYPOGRAPHY_CONTROLS_DATA } from '../../const/const'; import { type TypographySettings, TypographySettingsStore,