"use client"; import { Textarea } from "@/components/ui/textarea"; import { FontPicker } from "@/components/ui/font-picker"; import type { TextElement } from "@/timeline"; import { NumberField } from "@/components/ui/number-field"; import { useRef } from "react"; import { Section, SectionContent, SectionField, SectionFields, SectionHeader, SectionTitle, } from "@/components/section"; import { ColorPicker } from "@/components/ui/color-picker"; import { Button } from "@/components/ui/button"; import { uppercase } from "@/utils/string"; import { clamp, formatNumberForDisplay } from "@/utils/math"; import { useEditor } from "@/editor/use-editor"; import { CORNER_RADIUS_MAX, CORNER_RADIUS_MIN } from "@/text/background"; import { DEFAULT_TEXT_COLOR, MAX_FONT_SIZE, MIN_FONT_SIZE, } from "@/text/typography"; import { usePropertyDraft } from "@/components/editor/panels/properties/hooks/use-property-draft"; import { useKeyframedColorProperty } from "@/components/editor/panels/properties/hooks/use-keyframed-color-property"; import { useKeyframedNumberProperty } from "@/components/editor/panels/properties/hooks/use-keyframed-number-property"; import { useElementPlayhead } from "@/components/editor/panels/properties/hooks/use-element-playhead"; import { KeyframeToggle } from "@/components/editor/panels/properties/components/keyframe-toggle"; import { isPropertyAtDefault } from "@/rendering/components/transform-tab"; import { resolveColorAtTime, resolveNumberAtTime } from "@/animation"; import { HugeiconsIcon } from "@hugeicons/react"; import { MinusSignIcon, PlusSignIcon, TextFontIcon, } from "@hugeicons/core-free-icons"; import { OcTextHeightIcon, OcTextWidthIcon } from "@/components/icons"; import { DEFAULTS } from "@/timeline/defaults"; import { cn } from "@/utils/ui"; export function TextTab({ element, trackId, }: { element: TextElement; trackId: string; }) { return (