import { ease } from "@unom/style"; import { motion } from "framer-motion"; import { AnimatedTextEntity, AnimatedRectEntity, AnimatedStaggeredTextEntity, AnimatedEllipseEntity, } from "primitives/AnimatedEntities"; import { Paint, PaintStyle, PaintStyleType } from "primitives/Paint"; import { FC } from "react"; import { z } from "zod"; import { ColorProperties } from "./Values"; import { PropertiesProps } from "./common"; import { useFontsStore } from "stores/fonts.store"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "components/Inputs/Select"; type TextPropertiesProps = PropertiesProps>; type StaggeredTextPropertiesProps = PropertiesProps< z.input >; type PaintPropertiesProps = PropertiesProps>; type RectPropertiesProps = PropertiesProps>; type EllipsePropertiesProps = PropertiesProps< z.input >; export const PaintProperties: FC = ({ entity, onUpdate, }) => { return (
{entity.style.color && ( onUpdate({ ...entity, style: { ...entity.style, color } }) } entity={entity.style.color} /> )}
); }; export const TextProperties: FC = ({ entity, onUpdate, }) => { const { fonts } = useFontsStore(); return (
onUpdate({ ...entity, text: e.target.value })} />
onUpdate({ ...entity, paint: { ...entity.paint, size: Number(e.target.value) }, }) } />
); }; export const StaggeredTextProperties: FC = ({ entity, onUpdate, }) => { const { fonts } = useFontsStore(); return (
onUpdate({ ...entity, text: e.target.value, cache: { valid: false }, }) } />
onUpdate({ ...entity, cache: { valid: false }, letter: { ...entity.letter, paint: { ...entity.letter.paint, size: Number(e.target.value), }, }, }) } />
onUpdate({ ...entity, letter: { ...entity.letter, paint: { ...entity.letter.paint, ...paint }, }, }) } />
); }; export const RectProperties: FC = ({ entity, onUpdate, }) => { return (
onUpdate({ ...entity, paint: { ...entity.paint, ...paint } }) } />
); }; export const EllipseProperties: FC = ({ entity, onUpdate, }) => { return (
onUpdate({ ...entity, paint: { ...entity.paint, ...paint } }) } />
); };