'use client'; import { AnimatePresence, motion } from 'motion/react'; import { ChevronDown, ChevronUp } from 'lucide-react'; import { useI18n } from '@/lib/hooks/use-i18n'; import { useSettingsStore } from '@/lib/store/settings'; import { CHROME_EASE } from '@/lib/edit/transitions'; import type { InsertPaletteItem } from '@/lib/edit/scene-editor-surface'; import { cn } from '@/lib/utils'; import { InsertButton } from './InsertButton'; interface Props { readonly items: readonly InsertPaletteItem[]; } /** * Persistent floating insert toolbar — sits centered above the slide * canvas, ~12px from the top of the studio frame. Replaces the inline * insert slot in CommandBar so the global stage controls (back, undo * /redo, title, settings, Pro, Download) aren't visually mixed with * content-insertion affordances ("text box / image / shape ..." live * with the content, not with stage controls). * * Collapses to a small chevron handle at the same anchor position; * the collapsed flag persists in `settings.editInsertToolbarCollapsed`. */ export function FloatingInsertToolbar({ items }: Props) { const { t } = useI18n(); const collapsed = useSettingsStore((s) => s.editInsertToolbarCollapsed); const setCollapsed = useSettingsStore((s) => s.setEditInsertToolbarCollapsed); if (items.length === 0) return null; return (