Refactor/reacrhitecture to fsd+ #49
+9
-8
@@ -11,22 +11,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type ControlId,
|
|
||||||
DEFAULT_FONT_SIZE,
|
DEFAULT_FONT_SIZE,
|
||||||
DEFAULT_FONT_WEIGHT,
|
DEFAULT_FONT_WEIGHT,
|
||||||
DEFAULT_LETTER_SPACING,
|
DEFAULT_LETTER_SPACING,
|
||||||
DEFAULT_LINE_HEIGHT,
|
DEFAULT_LINE_HEIGHT,
|
||||||
DEFAULT_TYPOGRAPHY_CONTROLS_DATA,
|
|
||||||
} from '$entities/Font';
|
} from '$entities/Font';
|
||||||
import {
|
import {
|
||||||
type ControlDataModel,
|
|
||||||
type ControlModel,
|
|
||||||
type PersistentStore,
|
type PersistentStore,
|
||||||
type TypographyControl,
|
|
||||||
createPersistentStore,
|
createPersistentStore,
|
||||||
createTypographyControl,
|
|
||||||
} from '$shared/lib';
|
} from '$shared/lib';
|
||||||
|
import type { NumericControl } from '$shared/ui';
|
||||||
import { SvelteMap } from 'svelte/reactivity';
|
import { SvelteMap } from 'svelte/reactivity';
|
||||||
|
import { DEFAULT_TYPOGRAPHY_CONTROLS_DATA } from '../../const/const';
|
||||||
|
import type {
|
||||||
|
ControlId,
|
||||||
|
ControlModel,
|
||||||
|
} from '../../types/typography';
|
||||||
|
import { createTypographyControl } from '../../typographyControl/createTypographyControl.svelte';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Epsilon for detecting "significant" base-size changes when reconciling
|
* Epsilon for detecting "significant" base-size changes when reconciling
|
||||||
@@ -36,7 +37,7 @@ import { SvelteMap } from 'svelte/reactivity';
|
|||||||
*/
|
*/
|
||||||
const BASE_SIZE_EPSILON = 0.01;
|
const BASE_SIZE_EPSILON = 0.01;
|
||||||
|
|
||||||
type ControlOnlyFields<T extends string = string> = Omit<ControlModel<T>, keyof ControlDataModel>;
|
type ControlOnlyFields<T extends string = string> = Omit<ControlModel<T>, 'value' | 'min' | 'max' | 'step'>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A control with its associated instance
|
* A control with its associated instance
|
||||||
@@ -45,7 +46,7 @@ export interface Control extends ControlOnlyFields<ControlId> {
|
|||||||
/**
|
/**
|
||||||
* The reactive typography control instance
|
* The reactive typography control instance
|
||||||
*/
|
*/
|
||||||
instance: TypographyControl;
|
instance: NumericControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,11 +5,6 @@
|
|||||||
Desktop: inline bar with combo controls.
|
Desktop: inline bar with combo controls.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
|
||||||
MULTIPLIER_L,
|
|
||||||
MULTIPLIER_M,
|
|
||||||
MULTIPLIER_S,
|
|
||||||
} from '$entities/Font';
|
|
||||||
import type { ResponsiveManager } from '$shared/lib';
|
import type { ResponsiveManager } from '$shared/lib';
|
||||||
import { cn } from '$shared/lib';
|
import { cn } from '$shared/lib';
|
||||||
import {
|
import {
|
||||||
@@ -24,7 +19,12 @@ import { Popover } from 'bits-ui';
|
|||||||
import { getContext } from 'svelte';
|
import { getContext } from 'svelte';
|
||||||
import { cubicOut } from 'svelte/easing';
|
import { cubicOut } from 'svelte/easing';
|
||||||
import { fly } from 'svelte/transition';
|
import { fly } from 'svelte/transition';
|
||||||
import { typographySettingsStore } from '../../model';
|
import {
|
||||||
|
MULTIPLIER_L,
|
||||||
|
MULTIPLIER_M,
|
||||||
|
MULTIPLIER_S,
|
||||||
|
typographySettingsStore,
|
||||||
|
} from '../../model';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,13 +11,15 @@
|
|||||||
import {
|
import {
|
||||||
type ComparisonResult,
|
type ComparisonResult,
|
||||||
DualFontLayout,
|
DualFontLayout,
|
||||||
|
findSplitIndex,
|
||||||
|
} from '$entities/Font';
|
||||||
|
import {
|
||||||
MULTIPLIER_L,
|
MULTIPLIER_L,
|
||||||
MULTIPLIER_M,
|
MULTIPLIER_M,
|
||||||
MULTIPLIER_S,
|
MULTIPLIER_S,
|
||||||
findSplitIndex,
|
TypographyMenu,
|
||||||
} from '$entities/Font';
|
typographySettingsStore,
|
||||||
import { TypographyMenu } from '$features/AdjustTypography';
|
} from '$features/AdjustTypography';
|
||||||
import { typographySettingsStore } from '$features/AdjustTypography/model';
|
|
||||||
import {
|
import {
|
||||||
type ResponsiveManager,
|
type ResponsiveManager,
|
||||||
debounce,
|
debounce,
|
||||||
|
|||||||
Reference in New Issue
Block a user