CanvasAnvil is an open source AI diagram maker and flowchart generator - an infinite-canvas diagram editor and self-hosted drawio alternative that writes editable .drawio files. Text to diagram, then fix nodes, layout and labels in place. Also AI presentations, interior design CAD/BOM, posters and infographics.
TypeScript ai-agentsai-diagramai-presentationbomcadcanvasdiagramdiagram-generatordrawioflowchartinfographicspptppt-generatorpresentation-generatorreactsvgedittext-to-diagramtypescriptworkflow
feat(ui): lay the Claude visual language over the shell and the portal
codingFeng1018f9da245665c
diff --git a/client/app/App.tsx b/client/app/App.tsxindex 82f0a45..4202fbd 100644--- a/client/app/App.tsx+++ b/client/app/App.tsx@@ -1,5 +1,6 @@import { Suspense, useEffect, useState } from "react";-import { Loader2 } from "lucide-react";+import { Loader2, Monitor, Moon, Sun } from "lucide-react";+import { AnimatePresence, MotionConfig, motion } from "motion/react";import { Toaster } from "sonner";import { BrandIcon } from "@/app/BrandIcon";import { ErrorBoundary } from "@/app/ErrorBoundary";@@ -8,6 +9,9 @@ import { SettingsDialog } from "@/app/SettingsDialog";import { LandingPage } from "@/pages/LandingPage";import { cn } from "@/shared/lib/utils";import { t, useUiLanguage } from "@/shared/i18n";+import { SPRING, TWEEN } from "@/shared/motion";+import { applyTheme, useTheme, type Theme } from "@/shared/theme";+import { Tooltip, TooltipContent, TooltipTrigger } from "@/shared/ui/tooltip";const APP_VIEW_STORAGE_KEY = "CanvasAnvil-app-view-v1";const APP_WORKSPACE_STORAGE_KEY = "CanvasAnvil-active-workspace-v1";@@ -26,14 +30,103 @@ function WorkspaceFallback() {);}-export default function App() {+const THEME_ORDER: Theme[] = ["light", "dark", "system"];+const THEME_ICON = { light: Sun, dark: Moon, system: Monitor } as const;++function ThemeToggle() {+ const uiLang = useUiLanguage();+ const { theme, setTheme } = useTheme();+ const Icon = THEME_ICON[theme];++ const label =+ uiLang === "zh"+ ? { light: "浅色", dark: "深色", system: "跟随系统" }[theme]+ : { light: "Light", dark: "Dark", system: "System" }[theme];++ return (+ <Tooltip>+ <TooltipTrigger asChild>+ <button+ type="button"+ aria-label={label}+ onClick={() => setTheme(THEME_ORDER[(THEME_ORDER.indexOf(theme) + 1) % THEME_ORDER.length])}+ className="flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-[background-color,color] duration-fast ease-out-soft hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/30"+ >+ {/* The icon swaps rather than cross-dissolving in place, so the+ three-way cycle stays legible at a glance. */}+ <AnimatePresence mode="wait" initial={false}>+ <motion.span+ key={theme}+ initial={{ opacity: 0, rotate: -70, scale: 0.7 }}+ animate={{ opacity: 1, rotate: 0, scale: 1 }}+ exit={{ opacity: 0, rotate: 70, scale: 0.7 }}+ transition={TWEEN.fast}+ className="flex items-center justify-center"+ >+ <Icon className="size-[18px]" />+ </motion.span>+ </AnimatePresence>+ </button>+ </TooltipTrigger>+ <TooltipContent side="bottom">{label}</TooltipContent>+ </Tooltip>+ );+}++function WorkspaceSwitcher({+ active,+ onSelect,+}: {+ active: WorkspaceId;+ onSelect: (id: WorkspaceId) => void;+}) {const uiLang = useUiLanguage();++ return (+ <div className="flex min-w-max items-center gap-0.5 rounded-xl border border-border/60 bg-sunken p-1">+ {WORKSPACES.map(({ id, labelKey, icon: Icon }) => {+ const isActive = active === id;+ return (+ <button+ key={id}+ onClick={() => onSelect(id)}+ className={cn(+ "relative flex items-center gap-2 rounded-lg px-3.5 py-1.5 text-sm font-medium",+ "transition-colors duration-fast ease-out-soft focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/30",+ isActive ? "text-foreground" : "text-muted-foreground hover:text-foreground",+ )}+ >+ {/* One shared element slides between tabs instead of three+ independent backgrounds fading in and out. */}+ {isActive && (+ <motion.span+ layoutId="workspace-tab"+ transition={SPRING.snap}+ className="absolute inset-0 rounded-lg bg-card shadow-xs ring-1 ring-border/60"+ />+ )}+ <Icon className="relative z-10 size-4" />+ <span className="relative z-10">{t(uiLang, labelKey)}</span>+ </button>+ );+ })}+ </div>+ );+}++export default function App() {const [showLanding, setShowLanding] = useState(() => {if (typeof window === "undefined") return true;return localStorage.getItem(APP_VIEW_STORAGE_KEY) !== "workspace";});const [activeWorkspace, setActiveWorkspace] = useState<WorkspaceId>(readStoredWorkspace);+ // The inline script in index.html sets the class before first paint; this+ // keeps it correct across a hot reload that drops the class.+ useEffect(() => {+ applyTheme();+ }, []);+useEffect(() => {localStorage.setItem(APP_VIEW_STORAGE_KEY, showLanding ? "landing" : "workspace");}, [showLanding]);@@ -44,12 +137,14 @@ export default function App() {if (showLanding) {return (- <LandingPage- onStart={(workspace) => {- if (workspace) setActiveWorkspace(workspace);- setShowLanding(false);- }}- />+ <MotionConfig reducedMotion="user">+ <LandingPage+ onStart={(workspace) => {+ if (workspace) setActiveWorkspace(workspace);+ setShowLanding(false);+ }}+ />+ </MotionConfig>);}@@ -57,52 +152,51 @@ export default function App() {const ActiveWorkspace = active.Component;return (- <div className="h-screen w-screen flex flex-col bg-background overflow-hidden font-sans">- <Toaster position="top-center" richColors />+ // `reducedMotion="user"` is the single gate for the JS side; index.css+ // carries the equivalent for CSS transitions.+ <MotionConfig reducedMotion="user">+ <div className="h-screen w-screen flex flex-col bg-background overflow-hidden font-sans">+ <Toaster position="top-center" richColors />- <header className="h-16 border-b border-border/40 grid grid-cols-[1fr_auto_1fr] items-center gap-4 px-6 bg-background/80 backdrop-blur-md supports-[backdrop-filter]:bg-background/60 z-50 shadow-sm">- <div- className="flex items-center gap-2.5 font-semibold text-lg tracking-tight text-foreground/90 cursor-pointer justify-self-start"- onClick={() => setShowLanding(true)}- >- <BrandIcon className="h-10 w-10" />- <span>CanvasAnvil</span>- </div>+ <header className="h-14 shrink-0 border-b border-border/60 grid grid-cols-[1fr_auto_1fr] items-center gap-4 px-4 bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/70 z-50">+ <button+ type="button"+ className="group flex items-center gap-2 justify-self-start rounded-lg px-1.5 py-1 transition-colors duration-fast ease-out-soft hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/30"+ onClick={() => setShowLanding(true)}+ >+ <BrandIcon className="h-7 w-7 transition-transform duration-base ease-out-soft group-hover:-rotate-6" />+ <span className="font-display text-[17px] font-semibold tracking-[-0.015em]">CanvasAnvil</span>+ </button>- <div className="justify-self-center max-w-full overflow-x-auto">- <div className="flex min-w-max items-center bg-muted/50 p-1 rounded-xl border border-border/50 shadow-inner">- {WORKSPACES.map(({ id, labelKey, icon: Icon }) => (- <button- key={id}- onClick={() => setActiveWorkspace(id)}- className={cn(- "flex items-center gap-2 px-4 py-1.5 rounded-lg text-sm font-medium transition-all duration-300 ease-out",- activeWorkspace === id- ? "bg-background text-foreground shadow-sm ring-1 ring-border/50 scale-100"- : "text-muted-foreground hover:text-foreground hover:bg-background/50",- )}- >- <Icon className="w-4 h-4" />- {t(uiLang, labelKey)}- </button>- ))}+ <div className="justify-self-center max-w-full overflow-x-auto">+ <WorkspaceSwitcher active={activeWorkspace} onSelect={setActiveWorkspace} /></div>- </div>- <div className="w-48 flex justify-end justify-self-end">- <SettingsDialog />+ <div className="flex items-center gap-1 justify-self-end">+ <ThemeToggle />+ <SettingsDialog />+ </div>+ </header>++ <div className="flex-1 overflow-hidden relative">+ <ErrorBoundary>+ {/* Keyed so switching canvases unmounts the previous one rather than+ reusing its state under a different workspace. Entrance only —+ an exit animation would hold two heavy canvases alive at once. */}+ <Suspense fallback={<WorkspaceFallback />}>+ <motion.div+ key={active.id}+ initial={{ opacity: 0, y: 6 }}+ animate={{ opacity: 1, y: 0 }}+ transition={TWEEN.base}+ className="h-full w-full"+ >+ <ActiveWorkspace />+ </motion.div>+ </Suspense>+ </ErrorBoundary></div>- </header>-- <div className="flex-1 overflow-hidden relative">- <ErrorBoundary>- {/* Keyed so switching canvases unmounts the previous one rather than- reusing its state under a different workspace. */}- <Suspense fallback={<WorkspaceFallback />}>- <ActiveWorkspace key={active.id} />- </Suspense>- </ErrorBoundary></div>- </div>+ </MotionConfig>);}diff --git a/client/app/BrandIcon.tsx b/client/app/BrandIcon.tsxindex 937b47b..5204fd6 100644--- a/client/app/BrandIcon.tsx+++ b/client/app/BrandIcon.tsx@@ -1,5 +1,10 @@import { cn } from "@/shared/lib/utils";+/**+ * The mark is a fixed clay ramp rather than themed tokens: a logo that shifts+ * hue with the interface stops reading as a logo. These shades hold up on both+ * the ivory and the dark ground.+ */export function BrandIcon({ className }: { className?: string }) {return (<span className={cn("inline-flex h-10 w-10 shrink-0 items-center justify-center", className)}>@@ -7,14 +12,14 @@ export function BrandIcon({ className }: { className?: string }) {viewBox="0 0 48 48"role="img"aria-label="CanvasAnvil"- className="h-full w-full drop-shadow-[0_8px_18px_rgba(35,108,255,0.22)]"+ className="h-full w-full drop-shadow-[0_6px_14px_rgba(122,53,32,0.18)]">- <path d="M24 3.8 42 12.8 24 21.8 6 12.8 24 3.8Z" fill="#236CFF" />- <path d="M24 8.6 32.4 12.8 24 17 15.6 12.8 24 8.6Z" fill="#8EC1FF" />- <path d="M8.8 17.5 24 25.1l15.2-7.6v5.7L24 30.8 8.8 23.2v-5.7Z" fill="#0B77F4" />- <path d="M16.5 29.3h15l-2.7 4.4h-9.6l-2.7-4.4Z" fill="#053EA8" />- <path d="M13.3 36.6h21.4v4.2H13.3v-4.2Z" fill="#236CFF" />- <path d="M10 41.4h28v3.4H10v-3.4Z" fill="#053EA8" />+ <path d="M24 3.8 42 12.8 24 21.8 6 12.8 24 3.8Z" fill="#C96442" />+ <path d="M24 8.6 32.4 12.8 24 17 15.6 12.8 24 8.6Z" fill="#EFB8A2" />+ <path d="M8.8 17.5 24 25.1l15.2-7.6v5.7L24 30.8 8.8 23.2v-5.7Z" fill="#B4522F" />+ <path d="M16.5 29.3h15l-2.7 4.4h-9.6l-2.7-4.4Z" fill="#7A3520" />+ <path d="M13.3 36.6h21.4v4.2H13.3v-4.2Z" fill="#C96442" />+ <path d="M10 41.4h28v3.4H10v-3.4Z" fill="#7A3520" /></svg></span>);diff --git a/client/index.css b/client/index.cssindex d986176..9a24790 100644--- a/client/index.css+++ b/client/index.css@@ -2,91 +2,177 @@@tailwind components;@tailwind utilities;+/* ---------------------------------------------------------------------------+ Design tokens.++ Everything visual resolves through these variables. Components must never+ hardcode a colour: a literal hex bypasses this layer, and that is exactly+ why dark mode used to be half-broken. If a shade is missing here, add it+ here rather than inlining it at the call site.+ --------------------------------------------------------------------------- */+@layer base {:root {- --background: 0 0% 100%;- --foreground: 222.2 84% 4.9%;+ /* Warm ivory ground with white cards floating on top of it. */+ --background: 48 33% 97%;+ --foreground: 30 4% 10%;--card: 0 0% 100%;- --card-foreground: 222.2 84% 4.9%;+ --card-foreground: 30 4% 10%;--popover: 0 0% 100%;- --popover-foreground: 222.2 84% 4.9%;+ --popover-foreground: 30 4% 10%;++ /* Clay — the one saturated colour in the system. Used sparingly. */+ --primary: 15 63% 60%;+ --primary-foreground: 48 33% 98%;++ --secondary: 45 20% 93%;+ --secondary-foreground: 30 6% 20%;++ --muted: 45 20% 94%;+ --muted-foreground: 35 6% 42%;- --primary: 222.2 47.4% 11.2%;- --primary-foreground: 210 40% 98%;+ --accent: 45 24% 91%;+ --accent-foreground: 30 6% 18%;- --secondary: 210 40% 96.1%;- --secondary-foreground: 222.2 47.4% 11.2%;+ --destructive: 5 58% 50%;+ --destructive-foreground: 48 33% 98%;- --muted: 210 40% 96.1%;- --muted-foreground: 215.4 16.3% 46.9%;+ --border: 42 15% 88%;+ --input: 42 15% 86%;+ --ring: 15 63% 60%;- --accent: 210 40% 96.1%;- --accent-foreground: 222.2 47.4% 11.2%;+ /* Surfaces beyond shadcn's set. */+ --elevated: 0 0% 100%;+ --sunken: 45 24% 95%;+ --overlay: 30 8% 8%;- --destructive: 0 84.2% 60.2%;- --destructive-foreground: 210 40% 98%;+ /* Warm shadow base. The old shadows were cool slate-blue, which reads as+ grey haze against an ivory ground. */+ --shadow-hue: 30 20% 12%;- --border: 214.3 31.8% 91.4%;- --input: 214.3 31.8% 91.4%;- --ring: 222.2 84% 4.9%;-- --radius: 0.5rem;+ --radius: 0.75rem;++ /* Motion. Shared by CSS utilities and the JS motion system so a tween+ written in either place lands on the same curve. */+ --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);+ --ease-in-out-soft: cubic-bezier(0.65, 0, 0.35, 1);+ --dur-fast: 150ms;+ --dur-base: 220ms;+ --dur-slow: 340ms;}-+.dark {- --background: 222.2 84% 4.9%;- --foreground: 210 40% 98%;-- --card: 222.2 84% 4.9%;- --card-foreground: 210 40% 98%;-- --popover: 222.2 84% 4.9%;- --popover-foreground: 210 40% 98%;-- --primary: 210 40% 98%;- --primary-foreground: 222.2 47.4% 11.2%;-- --secondary: 217.2 32.6% 17.5%;- --secondary-foreground: 210 40% 98%;-- --muted: 217.2 32.6% 17.5%;- --muted-foreground: 215 20.2% 65.1%;-- --accent: 217.2 32.6% 17.5%;- --accent-foreground: 210 40% 98%;-- --destructive: 0 62.8% 30.6%;- --destructive-foreground: 210 40% 98%;-- --border: 217.2 32.6% 17.5%;- --input: 217.2 32.6% 17.5%;- --ring: 212.7 26.8% 83.9%;+ --background: 30 3% 12%;+ --foreground: 45 15% 92%;++ --card: 60 3% 15%;+ --card-foreground: 45 15% 92%;++ --popover: 50 3% 17%;+ --popover-foreground: 45 15% 92%;++ --primary: 15 63% 62%;+ --primary-foreground: 30 5% 10%;++ --secondary: 48 3% 21%;+ --secondary-foreground: 45 12% 90%;++ --muted: 48 3% 20%;+ --muted-foreground: 42 8% 62%;++ --accent: 48 4% 24%;+ --accent-foreground: 45 12% 92%;++ --destructive: 5 52% 52%;+ --destructive-foreground: 45 15% 94%;++ --border: 45 4% 24%;+ --input: 45 4% 26%;+ --ring: 15 63% 62%;++ --elevated: 50 3% 18%;+ --sunken: 30 3% 10%;+ --overlay: 30 6% 4%;++ --shadow-hue: 30 30% 2%;}}-+@layer base {* {@apply border-border;}+body {@apply bg-background text-foreground;+ font-feature-settings: "cv02", "cv03", "cv04", "cv11";+ text-rendering: optimizeLegibility;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+ }++ /* Display face carries headings; UI text stays on the sans. */+ h1, h2, h3 {+ font-family: theme("fontFamily.display");+ letter-spacing: -0.015em;+ }+}++/* ---------------------------------------------------------------------------+ Reduced motion.++ One global gate rather than per-component checks. Transforms still resolve+ to their final position — animations collapse to ~0 rather than being+ cancelled, so nothing gets stranded mid-tween.+ --------------------------------------------------------------------------- */++@media (prefers-reduced-motion: reduce) {+ *,+ *::before,+ *::after {+ animation-duration: 0.01ms !important;+ animation-iteration-count: 1 !important;+ transition-duration: 0.01ms !important;+ scroll-behavior: auto !important;}}@layer utilities {+ /* Warm, layered shadows. Three stops so the falloff reads as depth rather+ than a single grey band. */.shadow-soft {box-shadow:- 0 1px 2px rgba(15, 23, 42, 0.05),- 0 4px 12px rgba(15, 23, 42, 0.08),- 0 8px 24px rgba(15, 23, 42, 0.06);+ 0 1px 2px hsl(var(--shadow-hue) / 0.04),+ 0 4px 12px hsl(var(--shadow-hue) / 0.06),+ 0 8px 24px hsl(var(--shadow-hue) / 0.05);}.shadow-soft-lg {box-shadow:- 0 2px 4px rgba(15, 23, 42, 0.06),- 0 8px 20px rgba(15, 23, 42, 0.1),- 0 16px 40px rgba(15, 23, 42, 0.08);+ 0 2px 4px hsl(var(--shadow-hue) / 0.05),+ 0 8px 20px hsl(var(--shadow-hue) / 0.08),+ 0 16px 40px hsl(var(--shadow-hue) / 0.07);+ }++ .shadow-soft-xl {+ box-shadow:+ 0 4px 8px hsl(var(--shadow-hue) / 0.06),+ 0 16px 36px hsl(var(--shadow-hue) / 0.10),+ 0 32px 72px hsl(var(--shadow-hue) / 0.09);+ }++ /* Hairline that survives both themes without going invisible. */+ .ring-hairline {+ box-shadow: inset 0 0 0 1px hsl(var(--border) / 0.7);+ }++ /* Paper grain for the landing ground. Cheap: one repeating gradient pair,+ no image request. */+ .bg-paper {+ background-image:+ radial-gradient(circle at 1px 1px, hsl(var(--foreground) / 0.035) 1px, transparent 0);+ background-size: 22px 22px;}}diff --git a/client/main.tsx b/client/main.tsxindex e01727f..001bb19 100644--- a/client/main.tsx+++ b/client/main.tsx@@ -1,5 +1,10 @@import { StrictMode } from 'react'import { createRoot } from 'react-dom/client'+// Self-hosted so the first paint does not wait on a font CDN. Each face ships+// per-subset files gated by unicode-range, so only the scripts actually on the+// page get fetched.+import '@fontsource-variable/source-serif-4'+import '@fontsource-variable/inter'import App from '@/app/App'import './index.css'diff --git a/client/pages/portal/PortalPage.tsx b/client/pages/portal/PortalPage.tsxindex 274d29d..11074dc 100644--- a/client/pages/portal/PortalPage.tsx+++ b/client/pages/portal/PortalPage.tsx@@ -22,6 +22,7 @@ import {import { Button } from "@/shared/ui/button";import { cn } from "@/shared/lib/utils";import { getUiLanguage, setUiLanguage, useUiLanguage, type UiLanguage } from "@/shared/i18n";+import { SPRING, Stagger, StaggerItem, TWEEN, liftOnHover } from "@/shared/motion";import { portalCanvasItems, type PortalCanvasItem, type PortalWorkspace } from "./data";type PortalPageProps = {@@ -65,9 +66,9 @@ function OrbitNode({ angle, radius, delay }: { angle: number; radius: number; deconst point = polarPosition(angle, radius);return (<g style={{ animation: `portal-node-pulse 3.2s ease-in-out ${delay}s infinite` }}>- <circle cx={360 + point.x} cy={360 + point.y} r="17" fill="rgba(35,108,255,0.12)" />- <circle cx={360 + point.x} cy={360 + point.y} r="8" fill="#236CFF" />- <circle cx={360 + point.x} cy={360 + point.y} r="3" fill="#FFFFFF" />+ <circle cx={360 + point.x} cy={360 + point.y} r="15" fill="hsl(var(--primary) / 0.10)" />+ <circle cx={360 + point.x} cy={360 + point.y} r="6.5" fill="hsl(var(--primary))" />+ <circle cx={360 + point.x} cy={360 + point.y} r="2.5" fill="hsl(var(--card))" /></g>);}@@ -75,14 +76,14 @@ function OrbitNode({ angle, radius, delay }: { angle: number; radius: number; defunction BrandIcon({ className }: { className?: string }) {return (<span className={cn("inline-flex h-11 w-11 shrink-0 items-center justify-center", className)}>- <svg viewBox="0 0 48 48" role="img" aria-label="CanvasAnvil" className="h-full w-full drop-shadow-[0_8px_18px_rgba(35,108,255,0.22)]">- <path d="M24 3.8 42 12.8 24 21.8 6 12.8 24 3.8Z" fill="#236CFF" />- <path d="M24 8.6 32.4 12.8 24 17 15.6 12.8 24 8.6Z" fill="#8EC1FF" />- <path d="M8.8 17.5 24 25.1l15.2-7.6v5.7L24 30.8 8.8 23.2v-5.7Z" fill="#0B77F4" />- <path d="M16.5 29.3h15l-2.7 4.4h-9.6l-2.7-4.4Z" fill="#053EA8" />- <path d="M18.8 33.1h10.4v5.1H18.8v-5.1Z" fill="#236CFF" />- <path d="M13.2 38.1h21.6l3 5.4H10.2l3-5.4Z" fill="#0758D8" />- <path d="M19.5 39.4h9" stroke="#A9D0FF" strokeWidth="2" strokeLinecap="round" />+ <svg viewBox="0 0 48 48" role="img" aria-label="CanvasAnvil" className="h-full w-full drop-shadow-[0_6px_14px_rgba(122,53,32,0.18)]">+ <path d="M24 3.8 42 12.8 24 21.8 6 12.8 24 3.8Z" fill="#C96442" />+ <path d="M24 8.6 32.4 12.8 24 17 15.6 12.8 24 8.6Z" fill="#EFB8A2" />+ <path d="M8.8 17.5 24 25.1l15.2-7.6v5.7L24 30.8 8.8 23.2v-5.7Z" fill="#B4522F" />+ <path d="M16.5 29.3h15l-2.7 4.4h-9.6l-2.7-4.4Z" fill="#7A3520" />+ <path d="M18.8 33.1h10.4v5.1H18.8v-5.1Z" fill="#C96442" />+ <path d="M13.2 38.1h21.6l3 5.4H10.2l3-5.4Z" fill="#A0472A" />+ <path d="M19.5 39.4h9" stroke="#F5D3C4" strokeWidth="2" strokeLinecap="round" /></svg></span>);@@ -258,11 +259,11 @@ function OrbitCard({}}><motion.button- whileHover={{ y: -5, scale: 1.02 }}- transition={{ type: "spring", stiffness: 280, damping: 22 }}+ {...liftOnHover}className={cn(- "group w-[160px] overflow-hidden rounded-2xl border bg-white p-2.5 text-left shadow-[0_16px_36px_rgba(19,55,120,0.13)]",- active ? "border-[#8CB3FF] shadow-[0_24px_54px_rgba(35,108,255,0.22)]" : "border-[#E7EEFB]",+ "group w-[160px] overflow-hidden rounded-2xl border bg-card p-2.5 text-left shadow-soft",+ "transition-[border-color,box-shadow] duration-base ease-out-soft",+ active ? "border-primary/40 shadow-soft-lg" : "border-border/70",)}onMouseEnter={onActive}onFocus={onActive}@@ -270,20 +271,20 @@ function OrbitCard({><div className="mb-2 flex items-center justify-between gap-2"><div className="flex min-w-0 items-center gap-2">- <span className="flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[#EEF4FF] text-[#236CFF]">+ <span className="flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-accent text-foreground/70"><Icon className="h-4 w-4" /></span>- <div className="line-clamp-2 text-[13px] font-bold leading-4 text-slate-900">+ <div className="line-clamp-2 text-[13px] font-semibold leading-4 text-foreground">{uiLang === "zh" ? item.zhTitle : item.enTitle}</div></div>- <span className="h-2.5 w-2.5 shrink-0 rounded-full" style={{ backgroundColor: item.accent }} />+ <span className="h-2 w-2 shrink-0 rounded-full" style={{ backgroundColor: item.accent }} /></div>- <div className="overflow-hidden rounded-xl border border-[#EEF3FE] bg-[#F7FAFF]">+ <div className="overflow-hidden rounded-xl border border-border/60 bg-sunken"><imgsrc={item.image}alt={uiLang === "zh" ? item.zhTitle : item.enTitle}- className="h-[96px] w-full object-cover object-top transition duration-500 group-hover:scale-[1.04]"+ className="h-[96px] w-full object-cover object-top transition-transform duration-slow ease-out-soft group-hover:scale-[1.04]"/></div></motion.button>@@ -310,71 +311,69 @@ function Header({const isChinese = uiLang === "zh";return (- <header className="rounded-2xl border border-white bg-white/94 px-4 py-2.5 shadow-[0_14px_38px_rgba(34,76,150,0.09)] backdrop-blur-xl lg:px-6">+ <header className="rounded-2xl border border-border/60 bg-card/85 px-4 py-2.5 shadow-soft backdrop-blur-xl lg:px-6"><div className="flex flex-col gap-3 xl:grid xl:grid-cols-[220px_minmax(0,1fr)_132px] xl:items-center"><button- className="flex items-center gap-4 text-left"+ className="group flex items-center gap-3 text-left"onClick={() => {setActiveSection("home");setActiveCanvas("flow");scrollToPortalSection("home");}}>- <BrandIcon className="h-10 w-10" />- <span className="text-[22px] font-black text-slate-950">CanvasAnvil</span>+ <BrandIcon className="h-9 w-9 transition-transform duration-base ease-out-soft group-hover:-rotate-6" />+ <span className="font-display text-[21px] font-semibold tracking-[-0.015em] text-foreground">CanvasAnvil</span></button><nav className="overflow-x-auto">- <div className="flex min-w-max items-center justify-center gap-3 2xl:gap-5">- <button- className={cn(- "border-b-3 px-2 py-2 font-bold leading-tight transition",- isChinese ? "text-[16px] 2xl:text-[17px]" : "text-[14px] 2xl:text-[15px]",- activeSection === "home" ? "border-[#236CFF] text-[#236CFF]" : "border-transparent text-slate-800 hover:text-[#236CFF]",- )}- onClick={() => {- setActiveSection("home");- scrollToPortalSection("home");- }}- >- {copy.home}- </button>- {portalCanvasItems.map((item) => (- <button- key={item.id}- className={cn(- "whitespace-normal border-b-3 px-1 py-2 text-center font-bold leading-tight transition 2xl:max-w-none",- isChinese ? "max-w-[118px] text-[16px] 2xl:text-[17px]" : "max-w-[112px] text-[13px] 2xl:text-[15px]",- activeSection === item.id- ? "border-[#236CFF] text-[#236CFF]"- : "border-transparent text-slate-800 hover:text-[#236CFF]",- )}- onMouseEnter={() => setActiveCanvas(item.id)}- onFocus={() => setActiveCanvas(item.id)}- onClick={() => {- setActiveCanvas(item.id);- setActiveSection(item.id);- scrollToPortalSection(item.id);- }}- >- {uiLang === "zh" ? item.zhTitle : item.enTitle}- </button>- ))}+ <div className="flex min-w-max items-center justify-center gap-2 2xl:gap-4">+ {[{ id: "home" as const, label: copy.home }, ...portalCanvasItems.map((item) => ({+ id: item.id,+ label: uiLang === "zh" ? item.zhTitle : item.enTitle,+ }))].map(({ id, label }) => {+ const isActive = activeSection === id;+ return (+ <button+ key={id}+ className={cn(+ "relative whitespace-normal px-2.5 pb-2.5 pt-2 text-center font-medium leading-tight 2xl:max-w-none",+ "transition-colors duration-fast ease-out-soft",+ isChinese ? "max-w-[118px] text-[15px] 2xl:text-[16px]" : "max-w-[112px] text-[13px] 2xl:text-[14px]",+ isActive ? "text-primary" : "text-foreground/70 hover:text-foreground",+ )}+ onMouseEnter={() => id !== "home" && setActiveCanvas(id)}+ onFocus={() => id !== "home" && setActiveCanvas(id)}+ onClick={() => {+ if (id !== "home") setActiveCanvas(id);+ setActiveSection(id);+ scrollToPortalSection(id);+ }}+ >+ {label}+ {/* One rule slides between items rather than four borders+ blinking on and off. */}+ {isActive && (+ <motion.span+ layoutId="portal-nav-underline"+ transition={SPRING.snap}+ className="absolute inset-x-1.5 bottom-0 h-[2px] rounded-full bg-primary"+ />+ )}+ </button>+ );+ })}</div></nav><div className="flex justify-end gap-2"><Buttonvariant="outline"- className="h-9 rounded-full border-[#D7E5FF] bg-white px-4 text-slate-700"+ className="h-9 rounded-full px-4"onClick={() => setUiLang((prev) => (prev === "zh" ? "en" : "zh"))}>{uiLang === "zh" ? "EN" : "\u4e2d\u6587"}</Button>- <Button- asChild- className="h-9 rounded-full bg-[#236CFF] px-4 text-white shadow-[0_10px_26px_rgba(35,108,255,0.24)] hover:bg-[#1857D8]"- >+ <Button asChild size="icon" className="h-9 w-9 rounded-full"><a href="https://github.com/CodingFeng101/CanvasAnvil" target="_blank" rel="noreferrer" aria-label={copy.openRepo}><Github className="h-4 w-4" /></a>@@ -387,19 +386,19 @@ function Header({function Footer({ copy }: { copy: { footerLicense: string; footerContact: string } }) {return (- <footer className="min-h-12 rounded-t-[22px] border border-b-0 border-white/80 bg-white/78 shadow-[0_-14px_42px_rgba(34,76,150,0.08),inset_0_1px_0_rgba(255,255,255,0.9)] backdrop-blur-xl">- <div className="mx-auto flex min-h-12 max-w-[1180px] flex-wrap items-center justify-center gap-x-4 gap-y-1 px-4 py-1.5 text-xs font-semibold text-slate-500">- <a href="https://github.com/CodingFeng101/CanvasAnvil" target="_blank" rel="noreferrer" className="flex items-center gap-2 rounded-full px-2.5 py-1.5 transition hover:bg-[#EEF4FF] hover:text-[#236CFF]">+ <footer className="min-h-12 rounded-t-[22px] border border-b-0 border-border/50 bg-card/75 shadow-[0_-10px_32px_hsl(var(--shadow-hue)/0.05)] backdrop-blur-xl">+ <div className="mx-auto flex min-h-12 max-w-[1180px] flex-wrap items-center justify-center gap-x-4 gap-y-1 px-4 py-1.5 text-xs font-medium text-muted-foreground">+ <a href="https://github.com/CodingFeng101/CanvasAnvil" target="_blank" rel="noreferrer" className="flex items-center gap-2 rounded-full px-2.5 py-1.5 transition-colors duration-fast ease-out-soft hover:bg-accent hover:text-foreground"><Github className="h-4 w-4" />GitHub</a>- <span className="h-4 w-px bg-[#DDE8FA]" />+ <span className="h-4 w-px bg-border" /><span className="flex items-center gap-2 rounded-full px-2.5 py-1.5"><Scale className="h-4 w-4" />{copy.footerLicense}</span>- <span className="h-4 w-px bg-[#DDE8FA]" />- <a href="mailto:[email protected]" className="flex items-center gap-2 rounded-full px-2.5 py-1.5 transition hover:bg-[#EEF4FF] hover:text-[#236CFF]">+ <span className="h-4 w-px bg-border" />+ <a href="mailto:[email protected]" className="flex items-center gap-2 rounded-full px-2.5 py-1.5 transition-colors duration-fast ease-out-soft hover:bg-accent hover:text-foreground"><Mail className="h-4 w-4" />{copy.footerContact}: [email protected]</a>@@ -426,81 +425,94 @@ function SimpleCanvasDetailPage({<section id={`portal-${canvas}`} className={cn("flex h-full items-center overflow-hidden", isEnglish ? "py-3" : "py-4")}><divclassName={cn(- "grid w-full rounded-[30px] border border-[#D6E7FF]/70 bg-white/32 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.62),0_24px_70px_rgba(34,76,150,0.08)] xl:grid-cols-[0.78fr_1.22fr]",+ "grid w-full rounded-[30px] border border-border/60 bg-card/40 shadow-soft backdrop-blur-sm xl:grid-cols-[0.78fr_1.22fr]",isEnglish ? "gap-6 p-6 2xl:gap-8 2xl:p-8" : "gap-7 p-7 2xl:gap-9 2xl:p-9",)}>- <div className="self-center">- <h1 className={cn("font-black text-slate-950", isEnglish ? "text-[clamp(34px,3.5vw,50px)] leading-[1.03]" : "text-[clamp(42px,4.7vw,68px)] leading-[1.04]")}>{config.title}</h1>- <h2 className={cn("font-black leading-tight text-[#236CFF]", isEnglish ? "mt-2 text-[clamp(18px,1.75vw,23px)]" : "mt-2.5 text-[clamp(23px,2.35vw,32px)]")}>{config.subtitle}</h2>- <p className={cn("max-w-[620px] text-slate-600", isEnglish ? "mt-4 text-[clamp(15px,1.2vw,16px)] leading-7" : "mt-5 text-[18px] leading-8")}>{config.intro}</p>-- <div className={cn("flex flex-wrap", isEnglish ? "mt-5 gap-2.5" : "mt-6 gap-3")}>+ <Stagger className="self-center" stagger={0.055}>+ <StaggerItem>+ <h1 className={cn("font-display font-semibold text-foreground", isEnglish ? "text-[clamp(34px,3.5vw,50px)] leading-[1.05]" : "text-[clamp(40px,4.4vw,62px)] leading-[1.08]")}>{config.title}</h1>+ </StaggerItem>+ <StaggerItem>+ <h2 className={cn("font-display font-semibold leading-tight text-primary", isEnglish ? "mt-2 text-[clamp(18px,1.75vw,23px)]" : "mt-2.5 text-[clamp(22px,2.2vw,30px)]")}>{config.subtitle}</h2>+ </StaggerItem>+ <StaggerItem>+ <p className={cn("max-w-[620px] text-muted-foreground", isEnglish ? "mt-4 text-[clamp(15px,1.2vw,16px)] leading-7" : "mt-5 text-[17px] leading-8")}>{config.intro}</p>+ </StaggerItem>++ <StaggerItem className={cn("flex flex-wrap", isEnglish ? "mt-5 gap-2.5" : "mt-6 gap-3")}>{config.tags.map((tag) => (<spankey={tag}className={cn(- "inline-flex max-w-full items-center gap-2 rounded-full border border-[#E6EEFC] bg-white font-bold leading-tight text-slate-700 shadow-[0_12px_28px_rgba(34,76,150,0.08)] transition duration-300 ease-out hover:-translate-y-1 hover:scale-[1.03] hover:border-[#BFD6FF] hover:shadow-[0_16px_34px_rgba(35,108,255,0.14)]",- isEnglish ? "px-4 py-2.5 text-[14px]" : "px-5 py-3 text-[16px]",+ "inline-flex max-w-full items-center gap-2 rounded-full border border-border/70 bg-card font-medium leading-tight text-foreground/80 shadow-xs",+ "transition-[transform,border-color,box-shadow] duration-base ease-out-soft hover:-translate-y-0.5 hover:border-primary/35 hover:shadow-soft",+ isEnglish ? "px-4 py-2.5 text-[14px]" : "px-4 py-2.5 text-[15px]",)}>- <Icon className="h-4 w-4 text-[#236CFF]" />+ <Icon className="h-4 w-4 text-primary" /><span className="whitespace-normal">{tag}</span></span>))}- </div>+ </StaggerItem>- <div className={cn(isEnglish ? "mt-5 space-y-2.5" : "mt-6 space-y-3")}>+ <StaggerItem className={cn(isEnglish ? "mt-5 space-y-2.5" : "mt-6 space-y-3")}>{config.bullets.map((bullet) => (- <div key={bullet} className={cn("flex items-start gap-3 text-slate-600", isEnglish ? "text-[15px] leading-6" : "text-[18px] leading-7")}>- <CheckCircle2 className="mt-1 h-5 w-5 shrink-0 text-[#236CFF]" />+ <div key={bullet} className={cn("flex items-start gap-3 text-muted-foreground", isEnglish ? "text-[15px] leading-6" : "text-[16px] leading-7")}>+ <CheckCircle2 className="mt-1 h-[18px] w-[18px] shrink-0 text-primary" /><span>{bullet}</span></div>))}- </div>+ </StaggerItem>- <div className={cn(isEnglish ? "mt-6" : "mt-7")}>- <div className={cn("max-w-[540px] font-semibold tracking-[0.03em] text-[#236CFF]", isEnglish ? "mb-1.5 text-[16px] leading-6" : "mb-2 text-[20px] leading-7")}>{config.slogan}</div>+ <StaggerItem className={cn(isEnglish ? "mt-6" : "mt-7")}>+ <div className={cn("max-w-[540px] font-display font-semibold text-primary", isEnglish ? "mb-2 text-[16px] leading-6" : "mb-2.5 text-[19px] leading-7")}>{config.slogan}</div>+ {/* The brush-stroke plate stays — a hand-made mark suits the brand.+ Only the palette moves from blueprint blue to clay. */}<buttonclassName={cn(- "group relative max-w-full overflow-visible px-12 font-black tracking-[0.08em] text-white transition duration-300 hover:-translate-y-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#236CFF]/40",- isEnglish ? "h-[64px] min-w-[340px] text-[clamp(19px,2vw,24px)]" : "h-[72px] min-w-[380px] text-[clamp(26px,2.55vw,32px)]",+ "group relative max-w-full overflow-visible px-12 font-semibold tracking-[0.04em] text-primary-foreground",+ "transition-transform duration-base ease-out-soft hover:-translate-y-1 active:translate-y-0",+ "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40",+ isEnglish ? "h-[60px] min-w-[320px] text-[clamp(18px,1.85vw,22px)]" : "h-[66px] min-w-[350px] text-[clamp(23px,2.3vw,29px)]",)}onClick={() => onEnterWorkspace(canvas)}>- <svg viewBox="0 0 380 84" preserveAspectRatio="none" className="absolute inset-0 h-full w-full overflow-visible drop-shadow-[0_22px_34px_rgba(35,108,255,0.30)] transition duration-300 group-hover:scale-[1.035]" aria-hidden="true">- <path d="M12 44 C42 17 96 19 150 26 C203 33 244 17 300 23 C342 27 370 39 374 48 C346 65 294 62 241 65 C181 69 127 73 72 64 C34 58 17 51 12 44Z" fill="#0758D8" />- <path d="M32 47 C86 31 142 37 191 36 C250 34 304 31 356 46 C307 59 250 57 192 62 C130 67 71 60 32 47Z" fill="#236CFF" />- <path d="M50 31 C105 21 161 29 211 26 C260 23 302 22 342 32" fill="none" stroke="#A9D0FF" strokeWidth="5" strokeLinecap="round" opacity="0.72" />- <path d="M7 46 C26 52 41 59 56 72" fill="none" stroke="#0B77F4" strokeWidth="3.6" strokeLinecap="round" opacity="0.65" />- <path d="M331 64 C350 60 367 55 379 47" fill="none" stroke="#8EC1FF" strokeWidth="3.6" strokeLinecap="round" opacity="0.78" />+ <svg viewBox="0 0 380 84" preserveAspectRatio="none" className="absolute inset-0 h-full w-full overflow-visible drop-shadow-[0_14px_26px_rgba(122,53,32,0.22)] transition-transform duration-base ease-out-soft group-hover:scale-[1.03]" aria-hidden="true">+ <path d="M12 44 C42 17 96 19 150 26 C203 33 244 17 300 23 C342 27 370 39 374 48 C346 65 294 62 241 65 C181 69 127 73 72 64 C34 58 17 51 12 44Z" fill="#A0472A" />+ <path d="M32 47 C86 31 142 37 191 36 C250 34 304 31 356 46 C307 59 250 57 192 62 C130 67 71 60 32 47Z" fill="#C96442" />+ <path d="M50 31 C105 21 161 29 211 26 C260 23 302 22 342 32" fill="none" stroke="#F5D3C4" strokeWidth="5" strokeLinecap="round" opacity="0.62" />+ <path d="M7 46 C26 52 41 59 56 72" fill="none" stroke="#B4522F" strokeWidth="3.6" strokeLinecap="round" opacity="0.6" />+ <path d="M331 64 C350 60 367 55 379 47" fill="none" stroke="#EFB8A2" strokeWidth="3.6" strokeLinecap="round" opacity="0.72" /></svg>- <span className="relative z-10 drop-shadow-[0_2px_4px_rgba(5,62,168,0.45)]">{config.cta}</span>+ <span className="relative z-10 drop-shadow-[0_1px_3px_rgba(90,38,22,0.4)]">{config.cta}</span></button>- </div>- </div>+ </StaggerItem>+ </Stagger>- <div className={cn("grid content-center md:grid-cols-2", isEnglish ? "gap-x-5 gap-y-3" : "gap-x-7 gap-y-5")}>+ <Stagger className={cn("grid content-center md:grid-cols-2", isEnglish ? "gap-x-5 gap-y-3" : "gap-x-7 gap-y-5")} stagger={0.06} delay={0.12}>{config.previews.map((preview, index) => (- <div key={preview.title}>- <div className={cn("pl-2 font-black leading-tight text-slate-900", isEnglish ? "mb-1.5 text-[15px]" : "mb-2 text-[18px]")}>{preview.title}</div>+ <StaggerItem key={preview.title}>+ <div className={cn("pl-2 font-medium leading-tight text-foreground", isEnglish ? "mb-1.5 text-[15px]" : "mb-2 text-[16px]")}>{preview.title}</div><buttonclassName={cn(- "relative block w-full rounded-[18px] border border-[#DDE8FA] bg-white/94 text-left shadow-[0_16px_40px_rgba(34,76,150,0.12)] transition duration-300 hover:-translate-y-1 hover:shadow-[0_22px_52px_rgba(34,76,150,0.16)]",+ "relative block w-full rounded-[18px] border border-border/70 bg-card text-left shadow-soft",+ "transition-[transform,box-shadow] duration-base ease-out-soft hover:-translate-y-1 hover:shadow-soft-lg active:-translate-y-0.5",isEnglish ? "p-3" : "p-4",)}onClick={() => onPreviewImage(preview)}>- <span className="absolute -left-2 -top-2 h-5 w-5 rounded-full bg-[#236CFF] shadow-[0_6px_16px_rgba(35,108,255,0.35)]" />- <span className={cn("absolute -top-4 h-8 w-20 rotate-6 bg-[#C9E0F8]/70 shadow-sm", index % 2 === 0 ? "right-14" : "right-24")} />- <span className="absolute right-3 top-3 h-8 w-8 rounded-bl-2xl border-b border-l border-[#DDE8FA] bg-gradient-to-br from-white/20 to-[#EEF4FF]" />- <span className="block overflow-hidden rounded-xl border border-[#EEF3FE] bg-[#F7FAFF]">+ {/* Pin and tape — the board metaphor, warmed up. */}+ <span className="absolute -left-2 -top-2 h-4 w-4 rounded-full bg-primary shadow-soft" />+ <span className={cn("absolute -top-3 h-7 w-20 rotate-6 bg-primary/12", index % 2 === 0 ? "right-14" : "right-24")} />+ <span className="absolute right-3 top-3 h-8 w-8 rounded-bl-2xl border-b border-l border-border/60 bg-gradient-to-br from-transparent to-accent/60" />+ <span className="block overflow-hidden rounded-xl border border-border/50 bg-sunken"><img src={preview.image} alt={preview.title} className={cn("w-full object-contain", isEnglish ? "h-[150px] 2xl:h-[168px]" : "h-[170px] 2xl:h-[204px]")} /></span></button>- </div>+ </StaggerItem>))}- </div>+ </Stagger></div></section>);@@ -581,7 +593,7 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {};return (- <div className="h-screen overflow-hidden bg-[#F6FAFF] text-slate-950" style={{ cursor: brushCursor }}>+ <div className="h-screen overflow-hidden bg-background text-foreground font-sans" style={{ cursor: brushCursor }}><style>{`.portal-brush-cursor,.portal-brush-cursor * {@@ -605,30 +617,33 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {}`}</style>+ {/* Ground layer. The old blueprint grid was the loudest thing on the+ page; this keeps the drafting-paper idea at roughly a third of the+ contrast so the content sits on top of it rather than inside it. */}<div className="pointer-events-none fixed inset-0"><div- className="absolute inset-0 opacity-70"+ className="absolute inset-0"style={{backgroundImage:- "linear-gradient(rgba(35,108,255,0.10) 1px, transparent 1px), linear-gradient(90deg, rgba(35,108,255,0.10) 1px, transparent 1px), radial-gradient(circle at 1px 1px, rgba(35,108,255,0.14) 1px, transparent 0)",- backgroundSize: "96px 96px, 96px 96px, 22px 22px",+ "linear-gradient(hsl(var(--foreground) / 0.035) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--foreground) / 0.035) 1px, transparent 1px), radial-gradient(circle at 1px 1px, hsl(var(--foreground) / 0.05) 1px, transparent 0)",+ backgroundSize: "112px 112px, 112px 112px, 24px 24px",}}/>- <div className="absolute left-8 right-8 top-6 h-px bg-[#236CFF]/20" />- <div className="absolute bottom-8 left-8 right-8 h-px bg-[#236CFF]/16" />- <div className="absolute bottom-8 left-8 top-6 w-px bg-[#236CFF]/18" />- <div className="absolute bottom-8 right-8 top-6 w-px bg-[#236CFF]/14" />- <div className="absolute left-16 top-[170px] h-28 w-80 -rotate-12 rounded-full border-t-[18px] border-[#236CFF]/12" />- <div className="absolute bottom-16 left-20 h-20 w-64 rotate-[-18deg] border-b-2 border-l-2 border-[#236CFF]/18" />- <div className="absolute right-20 top-36 h-20 w-64 rotate-[-8deg] border-t-2 border-[#236CFF]/18" />- <svg className="absolute inset-0 h-full w-full opacity-45" viewBox="0 0 1500 980" preserveAspectRatio="none">- <path d="M44 861 C151 783 224 766 305 690" fill="none" stroke="#236CFF" strokeWidth="2" strokeOpacity="0.18" strokeDasharray="8 12" />- <path d="M1240 146 C1300 134 1360 142 1416 118" fill="none" stroke="#236CFF" strokeWidth="2" strokeOpacity="0.16" />- <path d="M80 150 h62 v62 h-62z" fill="none" stroke="#236CFF" strokeWidth="2" strokeOpacity="0.12" strokeDasharray="6 8" />- <path d="M1426 706 l-16 28 -16 -28" fill="none" stroke="#236CFF" strokeWidth="2" strokeOpacity="0.18" />- <path d="M556 308 l14 23 23 14 -23 14 -14 23 -14 -23 -23 -14 23 -14 14 -23z" fill="#236CFF" fillOpacity="0.18" />+ <div className="absolute left-8 right-8 top-6 h-px bg-border/70" />+ <div className="absolute bottom-8 left-8 right-8 h-px bg-border/60" />+ <div className="absolute bottom-8 left-8 top-6 w-px bg-border/60" />+ <div className="absolute bottom-8 right-8 top-6 w-px bg-border/50" />+ <div className="absolute left-16 top-[170px] h-28 w-80 -rotate-12 rounded-full border-t-[18px] border-primary/[0.07]" />+ <div className="absolute bottom-16 left-20 h-20 w-64 rotate-[-18deg] border-b-2 border-l-2 border-primary/10" />+ <div className="absolute right-20 top-36 h-20 w-64 rotate-[-8deg] border-t-2 border-primary/10" />+ <svg className="absolute inset-0 h-full w-full" viewBox="0 0 1500 980" preserveAspectRatio="none">+ <path d="M44 861 C151 783 224 766 305 690" fill="none" stroke="hsl(var(--primary))" strokeWidth="2" strokeOpacity="0.14" strokeDasharray="8 12" />+ <path d="M1240 146 C1300 134 1360 142 1416 118" fill="none" stroke="hsl(var(--primary))" strokeWidth="2" strokeOpacity="0.12" />+ <path d="M80 150 h62 v62 h-62z" fill="none" stroke="hsl(var(--primary))" strokeWidth="2" strokeOpacity="0.1" strokeDasharray="6 8" />+ <path d="M1426 706 l-16 28 -16 -28" fill="none" stroke="hsl(var(--primary))" strokeWidth="2" strokeOpacity="0.14" />+ <path d="M556 308 l14 23 23 14 -23 14 -14 23 -14 -23 -23 -14 23 -14 14 -23z" fill="hsl(var(--primary))" fillOpacity="0.13" /></svg>- <div className="absolute inset-x-0 top-0 h-72 bg-gradient-to-b from-[#EAF2FF] to-transparent" />+ <div className="absolute inset-x-0 top-0 h-72 bg-gradient-to-b from-accent/50 to-transparent" /></div><div@@ -653,33 +668,43 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {<AnimatePresence mode="sync"><motion.divkey={activeSection}- initial={{ opacity: 0, y: 18, scale: 0.992, filter: "blur(6px)" }}- animate={{ opacity: 1, y: 0, scale: 1, filter: "blur(0px)" }}- exit={{ opacity: 0, y: -14, scale: 0.992, filter: "blur(6px)" }}- transition={{ duration: 0.58, ease: [0.22, 1, 0.36, 1] }}+ // Transform and opacity only. The previous version animated a 6px+ // blur across the whole page, which is the one property here that+ // forces a full-surface repaint every frame.+ initial={{ opacity: 0, y: 14, scale: 0.994 }}+ animate={{ opacity: 1, y: 0, scale: 1 }}+ exit={{ opacity: 0, y: -10, scale: 0.994 }}+ transition={TWEEN.slow}className="absolute inset-x-4 top-0 h-full sm:inset-x-6 lg:inset-x-10">{activeSection === "home" ? (<main id="portal-home" className="grid h-full items-center gap-8 py-2 xl:grid-cols-[0.88fr_1.12fr]"><section className="max-w-[650px] px-2">- <motion.div- initial={{ opacity: 0, y: 18 }}- animate={{ opacity: 1, y: 0 }}- transition={{ duration: 0.5 }}- >- <h1 className="text-[clamp(34px,4.2vw,64px)] font-black leading-[1.08] text-slate-950">- <span className="block">{copy.titleA}</span>- <span className="block">- <span>{copy.titleB}</span>- <span className="text-[#236CFF]">{copy.titleAccent}</span>- </span>- </h1>- <p className="mt-7 max-w-[620px] text-[clamp(16px,1.35vw,18px)] leading-8 text-slate-600">- {copy.intro}- </p>-- <div className="mt-8 h-px w-64 bg-gradient-to-r from-[#236CFF]/60 via-[#8EC1FF]/45 to-transparent" />- </motion.div>+ <Stagger stagger={0.07}>+ <StaggerItem>+ <h1 className="font-display text-[clamp(34px,4vw,58px)] font-semibold leading-[1.1] tracking-[-0.02em] text-foreground">+ <span className="block">{copy.titleA}</span>+ <span className="block">+ <span>{copy.titleB}</span>+ <span className="text-primary">{copy.titleAccent}</span>+ </span>+ </h1>+ </StaggerItem>+ <StaggerItem>+ <p className="mt-6 max-w-[620px] text-[clamp(15px,1.25vw,17px)] leading-8 text-muted-foreground">+ {copy.intro}+ </p>+ </StaggerItem>+ {/* The rule draws itself in rather than fading — a small nod to+ the drafting metaphor, and it costs one transform. */}+ <motion.div+ variants={{+ hidden: { scaleX: 0 },+ shown: { scaleX: 1, transition: { duration: 0.6, ease: [0.22, 1, 0.36, 1] } },+ }}+ className="mt-8 h-px w-64 origin-left bg-gradient-to-r from-primary/60 via-primary/25 to-transparent"+ />+ </Stagger></section><section className="hidden justify-center xl:flex">@@ -688,32 +713,32 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {onMouseEnter={() => setPaused(true)}onMouseLeave={() => setPaused(false)}>- <div className="absolute left-[74px] top-2 h-[620px] w-[620px] rounded-full bg-[radial-gradient(circle,#FFFFFF_0%,rgba(239,246,255,0.88)_45%,rgba(218,232,255,0.30)_73%,transparent_100%)]" />- <div className="absolute left-[238px] top-[172px] h-[280px] w-[280px] rotate-[-5deg] rounded-[28px] border border-[#D6E7FF]/80 bg-white/58 shadow-[0_24px_70px_rgba(34,76,150,0.10)]" />- <div className="absolute left-[252px] top-[186px] h-[280px] w-[280px] rotate-[4deg] rounded-[28px] border border-[#D6E7FF]/70 bg-[#F8FBFF]/58 shadow-[0_18px_54px_rgba(34,76,150,0.08)]" />+ <div className="absolute left-[74px] top-2 h-[620px] w-[620px] rounded-full bg-[radial-gradient(circle,hsl(var(--card))_0%,hsl(var(--card)/0.7)_45%,hsl(var(--accent)/0.35)_73%,transparent_100%)]" />+ <div className="absolute left-[238px] top-[172px] h-[280px] w-[280px] rotate-[-5deg] rounded-[28px] border border-border/60 bg-card/50 shadow-soft" />+ <div className="absolute left-[252px] top-[186px] h-[280px] w-[280px] rotate-[4deg] rounded-[28px] border border-border/50 bg-sunken/50 shadow-soft" /><svg viewBox="0 0 720 720" className="absolute left-[384px] top-1/2 h-[620px] w-[620px] -translate-x-1/2 -translate-y-1/2"><defs><marker id="orbit-arrow" markerWidth="10" markerHeight="10" refX="7" refY="3" orient="auto">- <path d="M0,0 L0,6 L8,3 z" fill="rgba(35,108,255,0.72)" />+ <path d="M0,0 L0,6 L8,3 z" fill="hsl(var(--primary) / 0.7)" /></marker><filter id="canvas-paper-shadow" x="-20%" y="-20%" width="140%" height="140%">- <feDropShadow dx="0" dy="12" stdDeviation="12" floodColor="#224C96" floodOpacity="0.10" />+ <feDropShadow dx="0" dy="10" stdDeviation="10" floodColor="#3A2A20" floodOpacity="0.08" /></filter></defs>- <rect x="258" y="258" width="204" height="204" rx="28" fill="rgba(255,255,255,0.58)" stroke="rgba(35,108,255,0.13)" filter="url(#canvas-paper-shadow)" />- <path d="M286 314 H432 M286 360 H432 M286 406 H432" stroke="rgba(35,108,255,0.11)" strokeWidth="2" strokeLinecap="round" />- <path d="M314 286 V434 M360 286 V434 M406 286 V434" stroke="rgba(35,108,255,0.08)" strokeWidth="2" strokeLinecap="round" />+ <rect x="258" y="258" width="204" height="204" rx="28" fill="hsl(var(--card) / 0.6)" stroke="hsl(var(--foreground) / 0.08)" filter="url(#canvas-paper-shadow)" />+ <path d="M286 314 H432 M286 360 H432 M286 406 H432" stroke="hsl(var(--foreground) / 0.07)" strokeWidth="2" strokeLinecap="round" />+ <path d="M314 286 V434 M360 286 V434 M406 286 V434" stroke="hsl(var(--foreground) / 0.05)" strokeWidth="2" strokeLinecap="round" />- <circle cx="360" cy="360" r="250" fill="none" stroke="rgba(35,108,255,0.16)" strokeWidth="1.6" strokeDasharray="4 10" />- <circle cx="360" cy="360" r="205" fill="none" stroke="rgba(35,108,255,0.18)" strokeWidth="2.2" />- <circle cx="360" cy="360" r="160" fill="none" stroke="rgba(35,108,255,0.13)" strokeWidth="1.6" strokeDasharray="11 9" />- <circle cx="360" cy="360" r="112" fill="none" stroke="rgba(35,108,255,0.19)" strokeWidth="2.6" />+ <circle cx="360" cy="360" r="250" fill="none" stroke="hsl(var(--primary) / 0.14)" strokeWidth="1.6" strokeDasharray="4 10" />+ <circle cx="360" cy="360" r="205" fill="none" stroke="hsl(var(--primary) / 0.16)" strokeWidth="2.2" />+ <circle cx="360" cy="360" r="160" fill="none" stroke="hsl(var(--primary) / 0.11)" strokeWidth="1.6" strokeDasharray="11 9" />+ <circle cx="360" cy="360" r="112" fill="none" stroke="hsl(var(--primary) / 0.17)" strokeWidth="2.6" />- <path d="M232 190 A205 205 0 0 1 500 230" fill="none" stroke="rgba(35,108,255,0.74)" strokeWidth="2.3" markerEnd="url(#orbit-arrow)" />- <path d="M525 456 A205 205 0 0 1 380 566" fill="none" stroke="rgba(35,108,255,0.58)" strokeWidth="2.2" markerEnd="url(#orbit-arrow)" />- <path d="M190 462 A205 205 0 0 1 166 322" fill="none" stroke="rgba(35,108,255,0.50)" strokeWidth="2.1" markerEnd="url(#orbit-arrow)" />+ <path d="M232 190 A205 205 0 0 1 500 230" fill="none" stroke="hsl(var(--primary) / 0.6)" strokeWidth="2.3" markerEnd="url(#orbit-arrow)" />+ <path d="M525 456 A205 205 0 0 1 380 566" fill="none" stroke="hsl(var(--primary) / 0.48)" strokeWidth="2.2" markerEnd="url(#orbit-arrow)" />+ <path d="M190 462 A205 205 0 0 1 166 322" fill="none" stroke="hsl(var(--primary) / 0.4)" strokeWidth="2.1" markerEnd="url(#orbit-arrow)" />{[14, 78, 142, 206, 270, 334].map((angle, index) => (<OrbitNode key={angle} angle={angle} radius={250} delay={index * 0.22} />@@ -747,25 +772,34 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {))}</div>- <div className="absolute left-[384px] top-1/2 h-[248px] w-[248px] -translate-x-1/2 -translate-y-1/2 rounded-full border border-[#AFCBFF] bg-white shadow-[0_24px_90px_rgba(35,108,255,0.18)]">- <div className="absolute inset-4 rounded-full border border-[#E2ECFF]" style={{ animation: "portal-ring-breathe 5s ease-in-out infinite" }} />- <div className="absolute inset-8 rounded-full bg-[radial-gradient(circle,#FFFFFF_0%,#F3F7FF_100%)] shadow-[inset_0_0_0_8px_rgba(35,108,255,0.06),0_0_0_2px_rgba(35,108,255,0.08)]" />+ {/* Centring lives in motion's own x/y, not in `-translate-*`+ classes: an animated `scale` writes an inline `transform` that+ would clobber the utility and drop the hub off-centre. */}+ <motion.div+ initial={{ opacity: 0, scale: 0.94 }}+ animate={{ opacity: 1, scale: 1 }}+ transition={{ ...SPRING.gentle, delay: 0.1 }}+ style={{ x: "-50%", y: "-50%" }}+ className="absolute left-[384px] top-1/2 h-[248px] w-[248px] rounded-full border border-primary/25 bg-card shadow-soft-lg"+ >+ <div className="absolute inset-4 rounded-full border border-border/70" style={{ animation: "portal-ring-breathe 5s ease-in-out infinite" }} />+ <div className="absolute inset-8 rounded-full bg-[radial-gradient(circle,hsl(var(--card))_0%,hsl(var(--sunken))_100%)] shadow-[inset_0_0_0_8px_hsl(var(--primary)/0.05),0_0_0_2px_hsl(var(--primary)/0.07)]" /><div className="absolute inset-0 flex flex-col items-center justify-center"><BrandIcon className="h-20 w-20" />- <div className="mt-4 text-2xl font-black text-slate-950">{copy.hub}</div>- <div className="mt-2 text-sm text-slate-500">{copy.hubSub}</div>+ <div className="mt-3 font-display text-2xl font-semibold text-foreground">{copy.hub}</div>+ <div className="mt-1.5 text-sm text-muted-foreground">{copy.hubSub}</div></div>- </div>+ </motion.div></div></section><section className="xl:hidden">- <div className="mb-3 text-sm font-semibold text-[#236CFF]">{copy.mobileHint}</div>+ <div className="mb-3 text-sm font-medium text-primary">{copy.mobileHint}</div><div className="grid gap-3 sm:grid-cols-2">{portalCanvasItems.map((item) => (<buttonkey={item.id}- className="overflow-hidden rounded-2xl border border-[#E6EEFC] bg-white p-3 text-left shadow-[0_12px_28px_rgba(34,76,150,0.08)]"+ className="overflow-hidden rounded-2xl border border-border/70 bg-card p-3 text-left shadow-soft transition-transform duration-base ease-out-soft active:scale-[0.99]"onMouseEnter={() => setActiveCanvas(item.id)}onFocus={() => setActiveCanvas(item.id)}onClick={() => {@@ -775,10 +809,10 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {}}><div className="mb-2 flex items-center justify-between">- <span className="text-sm font-bold text-slate-900">{uiLang === "zh" ? item.zhTitle : item.enTitle}</span>+ <span className="text-sm font-semibold text-foreground">{uiLang === "zh" ? item.zhTitle : item.enTitle}</span><span className="h-2.5 w-2.5 rounded-full" style={{ backgroundColor: item.accent }} /></div>- <img src={item.image} alt={uiLang === "zh" ? item.zhTitle : item.enTitle} className="h-[128px] w-full rounded-xl border border-[#EEF3FE] object-cover object-top" />+ <img src={item.image} alt={uiLang === "zh" ? item.zhTitle : item.enTitle} className="h-[128px] w-full rounded-xl border border-border/60 object-cover object-top" /></button>))}</div>@@ -802,14 +836,14 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {<AnimatePresence>{previewImage && (<motion.div- className="fixed inset-0 z-50 flex items-center justify-center bg-slate-950/52 p-8 backdrop-blur-md"+ className="fixed inset-0 z-50 flex items-center justify-center bg-overlay/50 p-8 backdrop-blur-md"initial={{ opacity: 0 }}animate={{ opacity: 1 }}exit={{ opacity: 0 }}onClick={() => setPreviewImage(null)}><motion.div- className="relative max-h-[86vh] w-full max-w-[1180px] rounded-[28px] border border-white/70 bg-white p-5 shadow-[0_28px_90px_rgba(7,31,75,0.28)]"+ className="relative max-h-[86vh] w-full max-w-[1180px] rounded-[28px] border border-border/60 bg-card p-5 shadow-soft-xl"initial={{ opacity: 0, y: 24, scale: 0.96 }}animate={{ opacity: 1, y: 0, scale: 1 }}exit={{ opacity: 0, y: 18, scale: 0.96 }}@@ -817,16 +851,16 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {onClick={(event) => event.stopPropagation()}><div className="mb-4 flex items-center justify-between gap-4">- <div className="text-[22px] font-black text-slate-950">{previewImage.title}</div>+ <div className="font-display text-[22px] font-semibold text-foreground">{previewImage.title}</div><button- className="flex h-10 w-10 items-center justify-center rounded-full border border-[#DDE8FA] bg-[#F7FAFF] text-slate-600 transition hover:bg-[#EAF2FF] hover:text-[#236CFF]"+ className="flex h-10 w-10 items-center justify-center rounded-full border border-border/70 bg-sunken text-muted-foreground transition-[background-color,color,transform] duration-fast ease-out-soft hover:bg-accent hover:text-foreground active:scale-95"onClick={() => setPreviewImage(null)}aria-label={uiLang === "zh" ? "关闭预览" : "Close preview"}><X className="h-5 w-5" /></button></div>- <div className="flex max-h-[72vh] items-center justify-center overflow-hidden rounded-2xl border border-[#E3ECFA] bg-[#F7FAFF]">+ <div className="flex max-h-[72vh] items-center justify-center overflow-hidden rounded-2xl border border-border/60 bg-sunken"><img src={previewImage.image} alt={previewImage.title} className="max-h-[72vh] w-full object-contain" /></div></motion.div>diff --git a/client/pages/portal/data.ts b/client/pages/portal/data.tsindex 315a6a3..3a9017a 100644--- a/client/pages/portal/data.ts+++ b/client/pages/portal/data.ts@@ -20,7 +20,7 @@ export const portalCanvasItems: PortalCanvasItem[] = [enSummary: "Structured flow diagrams with node-level edits",image: "/examples/flow/01.png",angle: -90,- accent: "#236CFF",+ accent: "#C96442",},{id: "cad",@@ -30,7 +30,7 @@ export const portalCanvasItems: PortalCanvasItem[] = [enSummary: "Layouts, renders, and material lists in one flow",image: "/examples/cad/01.png",angle: 30,- accent: "#8B5CF6",+ accent: "#7C8B6E",},{id: "ppt",@@ -40,6 +40,6 @@ export const portalCanvasItems: PortalCanvasItem[] = [enSummary: "Outline-first decks with editable, PDF, and image exports",image: "/examples/ppt/ppt1/01.png",angle: 150,- accent: "#1F63F3",+ accent: "#A8825C",},];diff --git a/client/shared/motion/index.ts b/client/shared/motion/index.tsnew file mode 100644index 0000000..ea00cbb--- /dev/null+++ b/client/shared/motion/index.ts@@ -0,0 +1,15 @@+export {+ DURATION,+ EASE_IN_OUT_SOFT,+ EASE_OUT_SOFT,+ SPRING,+ TWEEN,+ fadeIn,+ liftOnHover,+ pressable,+ riseIn,+ scaleIn,+ staggerContainer,+} from "./tokens";++export { Appear, Reveal, Stagger, StaggerItem } from "./reveal";diff --git a/client/shared/motion/reveal.tsx b/client/shared/motion/reveal.tsxnew file mode 100644index 0000000..a6503da--- /dev/null+++ b/client/shared/motion/reveal.tsx@@ -0,0 +1,103 @@+import { type ComponentPropsWithoutRef, type ElementType, type ReactNode } from "react";+import { motion } from "motion/react";+import { riseIn, scaleIn, staggerContainer } from "./tokens";++type MotionDivProps = ComponentPropsWithoutRef<typeof motion.div>;++/**+ * Mount entrance. Use for content that is already on screen when it appears —+ * a view that just became active, a panel that opened.+ */+export function Appear({+ children,+ variant = "rise",+ delay = 0,+ ...rest+}: {+ children: ReactNode;+ variant?: "rise" | "scale";+ delay?: number;+} & MotionDivProps) {+ return (+ <motion.div+ initial="hidden"+ animate="shown"+ exit="exit"+ variants={variant === "scale" ? scaleIn : riseIn}+ transition={{ delay }}+ {...rest}+ >+ {children}+ </motion.div>+ );+}++/**+ * Scroll entrance. Fires once, slightly before the element reaches the+ * viewport edge so the motion is finishing as the reader arrives rather than+ * starting under their eye.+ */+export function Reveal({+ children,+ delay = 0,+ as,+ ...rest+}: {+ children: ReactNode;+ delay?: number;+ as?: ElementType;+} & MotionDivProps) {+ const Component = as ? motion.create(as) : motion.div;++ return (+ <Component+ initial="hidden"+ whileInView="shown"+ viewport={{ once: true, margin: "0px 0px -12% 0px" }}+ variants={riseIn}+ transition={{ delay }}+ {...rest}+ >+ {children}+ </Component>+ );+}++/**+ * Wraps a run of `<StaggerItem>` children so they arrive in sequence.+ * `inView` switches the trigger from mount to scroll.+ */+export function Stagger({+ children,+ stagger,+ delay,+ inView = false,+ ...rest+}: {+ children: ReactNode;+ stagger?: number;+ delay?: number;+ inView?: boolean;+} & MotionDivProps) {+ return (+ <motion.div+ initial="hidden"+ {...(inView+ ? { whileInView: "shown", viewport: { once: true, margin: "0px 0px -12% 0px" } }+ : { animate: "shown" })}+ exit="exit"+ variants={staggerContainer(stagger, delay)}+ {...rest}+ >+ {children}+ </motion.div>+ );+}++export function StaggerItem({ children, ...rest }: { children: ReactNode } & MotionDivProps) {+ return (+ <motion.div variants={riseIn} {...rest}>+ {children}+ </motion.div>+ );+}diff --git a/client/shared/motion/tokens.ts b/client/shared/motion/tokens.tsnew file mode 100644index 0000000..9d94b1c--- /dev/null+++ b/client/shared/motion/tokens.ts@@ -0,0 +1,96 @@+import type { Transition, Variants } from "motion/react";++/**+ * The whole app's motion vocabulary.+ *+ * Deliberately small. Every animation in the product should reach for one of+ * these rather than inventing its own numbers — that is the difference between+ * an interface that feels coherently alive and fifty files each guessing at a+ * duration.+ *+ * These mirror the `--dur-*` / `--ease-*` custom properties in index.css, so a+ * CSS transition and a JS tween on the same element land on the same curve.+ */++export const DURATION = {+ fast: 0.15,+ base: 0.22,+ slow: 0.34,+} as const;++/** Matches `--ease-out-soft`. Decelerating, no overshoot. */+export const EASE_OUT_SOFT = [0.22, 1, 0.36, 1] as const;+/** Matches `--ease-in-out-soft`. */+export const EASE_IN_OUT_SOFT = [0.65, 0, 0.35, 1] as const;++/**+ * Springs, ordered by how much mass the motion should imply.+ *+ * `snap` is for things that respond under the finger — buttons, toggles, tabs.+ * `soft` is the default for elements entering the page.+ * `gentle` is for large surfaces where a fast spring would read as a twitch.+ */+export const SPRING: Record<"snap" | "soft" | "gentle", Transition> = {+ snap: { type: "spring", stiffness: 420, damping: 34, mass: 0.7 },+ soft: { type: "spring", stiffness: 260, damping: 30, mass: 0.9 },+ gentle: { type: "spring", stiffness: 170, damping: 26, mass: 1 },+};++export const TWEEN: Record<"fast" | "base" | "slow", Transition> = {+ fast: { duration: DURATION.fast, ease: EASE_OUT_SOFT },+ base: { duration: DURATION.base, ease: EASE_OUT_SOFT },+ slow: { duration: DURATION.slow, ease: EASE_OUT_SOFT },+};++/* -------------------------------------------------------------------------- */+/* Variants */+/* -------------------------------------------------------------------------- */++/** The default entrance: a short lift with a fade. 8px, not 40px. */+export const riseIn: Variants = {+ hidden: { opacity: 0, y: 8 },+ shown: { opacity: 1, y: 0, transition: SPRING.soft },+ exit: { opacity: 0, y: -6, transition: TWEEN.fast },+};++export const fadeIn: Variants = {+ hidden: { opacity: 0 },+ shown: { opacity: 1, transition: TWEEN.base },+ exit: { opacity: 0, transition: TWEEN.fast },+};++export const scaleIn: Variants = {+ hidden: { opacity: 0, scale: 0.97 },+ shown: { opacity: 1, scale: 1, transition: SPRING.soft },+ exit: { opacity: 0, scale: 0.98, transition: TWEEN.fast },+};++/**+ * Container for a run of children that should arrive in sequence.+ *+ * 45ms apart: enough to read as a cascade, short enough that a list of eight+ * finishes inside a third of a second.+ */+export function staggerContainer(stagger = 0.045, delay = 0): Variants {+ return {+ hidden: {},+ shown: { transition: { staggerChildren: stagger, delayChildren: delay } },+ exit: { transition: { staggerChildren: 0.02, staggerDirection: -1 } },+ };+}++/* -------------------------------------------------------------------------- */+/* Interaction presets */+/* -------------------------------------------------------------------------- */++/** Hover/press pair for cards. The press must undershoot the rest state. */+export const liftOnHover = {+ whileHover: { y: -3, transition: SPRING.snap },+ whileTap: { y: -1, scale: 0.99, transition: SPRING.snap },+} as const;++/** Hover/press pair for buttons and other small controls. */+export const pressable = {+ whileHover: { y: -1, transition: SPRING.snap },+ whileTap: { scale: 0.97, y: 0, transition: SPRING.snap },+} as const;diff --git a/client/shared/theme.ts b/client/shared/theme.tsnew file mode 100644index 0000000..22a9b3f--- /dev/null+++ b/client/shared/theme.ts@@ -0,0 +1,91 @@+import { useEffect, useState } from "react";++/**+ * The colour theme, stored once and broadcast on change — same shape as the+ * UI-language store next door.+ *+ * This used to live inside the Flow workspace, which meant a control buried in+ * one canvas was mutating `documentElement` for the whole app: switching away+ * from Flow left its theme behind with nothing left on screen to undo it.+ */++export type Theme = "light" | "dark" | "system";+export type ResolvedTheme = "light" | "dark";++const THEME_STORAGE_KEY = "CanvasAnvil-theme-v1";+/** Flow's old key, read once so an existing preference survives the move. */+const LEGACY_DARK_KEY = "next-ai-draw-io-dark-mode";++function prefersDark(): boolean {+ if (typeof window === "undefined" || !window.matchMedia) return false;+ return window.matchMedia("(prefers-color-scheme: dark)").matches;+}++export function getTheme(): Theme {+ if (typeof window === "undefined") return "system";++ const raw = String(localStorage.getItem(THEME_STORAGE_KEY) || "").trim().toLowerCase();+ if (raw === "light" || raw === "dark" || raw === "system") return raw;++ const legacy = localStorage.getItem(LEGACY_DARK_KEY);+ if (legacy === "true") return "dark";+ if (legacy === "false") return "light";++ return "system";+}++export function resolveTheme(theme: Theme = getTheme()): ResolvedTheme {+ if (theme === "system") return prefersDark() ? "dark" : "light";+ return theme;+}++/** Writes the class the Tailwind `dark:` variant keys off. */+export function applyTheme(theme: Theme = getTheme()) {+ if (typeof document === "undefined") return;+ document.documentElement.classList.toggle("dark", resolveTheme(theme) === "dark");+}++export function setTheme(theme: Theme) {+ if (typeof window === "undefined") return;+ try {+ localStorage.setItem(THEME_STORAGE_KEY, theme);+ } catch {+ // A blocked localStorage only costs us persistence across reloads.+ }+ applyTheme(theme);+ try {+ window.dispatchEvent(new Event("ui-theme-changed"));+ } catch {+ // No window to notify (server render, or a detached document).+ }+}++/**+ * Subscribes to the change event above, and to the OS setting while the theme+ * is "system" — so following the system means actually following it, not just+ * sampling it once at mount.+ */+export function useTheme() {+ const [theme, setThemeState] = useState<Theme>(() => getTheme());+ const [resolved, setResolved] = useState<ResolvedTheme>(() => resolveTheme());++ useEffect(() => {+ const sync = () => {+ const next = getTheme();+ setThemeState(next);+ setResolved(resolveTheme(next));+ };++ window.addEventListener("ui-theme-changed", sync);++ const media = window.matchMedia?.("(prefers-color-scheme: dark)");+ media?.addEventListener?.("change", sync);++ return () => {+ window.removeEventListener("ui-theme-changed", sync);+ media?.removeEventListener?.("change", sync);+ };+ }, []);++ return { theme, resolved, setTheme, isDark: resolved === "dark" };+}diff --git a/client/shared/ui/button.tsx b/client/shared/ui/button.tsxindex 4df27c7..f1bfafe 100644--- a/client/shared/ui/button.tsx+++ b/client/shared/ui/button.tsx@@ -5,26 +5,38 @@ import { cva, type VariantProps } from "class-variance-authority"import { cn } from "@/shared/lib/utils"const buttonVariants = cva(- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",+ [+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium",+ "transition-[background-color,border-color,color,box-shadow,transform,opacity] duration-fast ease-out-soft",+ // The press has to undershoot the rest position, otherwise a click on a+ // lifted button reads as nothing happening. `active:` sorts after `hover:`+ // so it wins while the pointer is down.+ "active:translate-y-px",+ "disabled:pointer-events-none disabled:opacity-50",+ "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0",+ "outline-none focus-visible:border-ring focus-visible:ring-ring/35 focus-visible:ring-[3px]",+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",+ ],{variants: {variant: {default:- "bg-primary text-primary-foreground shadow-xs hover:brightness-75",+ "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 hover:shadow-soft hover:-translate-y-px",destructive:- "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",+ "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 hover:-translate-y-px focus-visible:ring-destructive/30",outline:- "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",+ "border border-border bg-card text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground hover:-translate-y-px hover:shadow-soft",secondary:- "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",+ "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/70 hover:-translate-y-px",ghost:- "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",- link: "text-primary underline-offset-4 hover:underline",+ "hover:bg-accent hover:text-accent-foreground",+ link:+ "text-primary underline-offset-4 hover:underline active:translate-y-0",},size: {default: "h-9 px-4 py-2 has-[>svg]:px-3",sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",+ lg: "h-11 rounded-lg px-6 text-[15px] has-[>svg]:px-4",icon: "size-9",},},diff --git a/client/shared/ui/dialog.tsx b/client/shared/ui/dialog.tsxindex 306af4b..029ed32 100644--- a/client/shared/ui/dialog.tsx+++ b/client/shared/ui/dialog.tsx@@ -40,7 +40,9 @@ const DialogOverlay = React.forwardRef<ref={ref}data-slot="dialog-overlay"className={cn(- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",+ // Warm scrim rather than flat black — pure black over an ivory ground+ // reads as a hole punched in the page.+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-overlay/45 backdrop-blur-[2px] duration-base",className)}{...props}@@ -61,13 +63,14 @@ const DialogContent = React.forwardRef<ref={ref}data-slot="dialog-content"className={cn(- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",+ "bg-card data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-bottom-2 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border border-border/70 p-6 shadow-soft-xl duration-base sm:max-w-lg",className)}{...props}>{children}- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">+ {/* `rounded-xs` is v4-only, so this used to render square. */}+ <DialogPrimitive.Close className="ring-offset-background focus:ring-ring text-muted-foreground absolute top-4 right-4 flex size-7 items-center justify-center rounded-md transition-[background-color,color,transform] duration-fast ease-out-soft hover:bg-accent hover:text-foreground active:scale-95 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"><XIcon /><span className="sr-only">{uiLang === "zh" ? "关闭" : "Close"}</span></DialogPrimitive.Close>@@ -108,7 +111,7 @@ const DialogTitle = React.forwardRef<<DialogPrimitive.Titleref={ref}data-slot="dialog-title"- className={cn("text-lg leading-none font-semibold", className)}+ className={cn("font-display text-xl leading-tight font-semibold tracking-[-0.015em]", className)}{...props}/>)diff --git a/client/shared/ui/input.tsx b/client/shared/ui/input.tsxindex f8d3e05..c183b13 100644--- a/client/shared/ui/input.tsx+++ b/client/shared/ui/input.tsx@@ -8,8 +8,10 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {type={type}data-slot="input"className={cn(- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input bg-card flex h-9 w-full min-w-0 rounded-lg border px-3 py-1 text-base shadow-xs outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",+ "transition-[color,box-shadow,border-color,background-color] duration-fast ease-out-soft",+ "hover:border-border",+ "focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",className)}diff --git a/client/shared/ui/select.tsx b/client/shared/ui/select.tsxindex a1aad3e..f3b2896 100644--- a/client/shared/ui/select.tsx+++ b/client/shared/ui/select.tsx@@ -37,7 +37,10 @@ function SelectTrigger({data-slot="select-trigger"data-size={size}className={cn(- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive bg-card hover:bg-accent/50 flex w-fit items-center justify-between gap-2 rounded-lg border px-3 py-2 text-sm whitespace-nowrap shadow-xs outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ "transition-[color,box-shadow,border-color,background-color] duration-fast ease-out-soft",+ // Chevron leans into the open state.+ "[&>span>svg]:transition-transform [&>span>svg]:duration-base [&>span>svg]:ease-out-soft data-[state=open]:[&>span>svg]:rotate-180",className)}{...props}@@ -62,7 +65,11 @@ function SelectContent({<SelectPrimitive.Contentdata-slot="select-content"className={cn(- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[140] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 relative z-[140] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-xl border shadow-soft-lg",+ // Tailwind v4's `max-h-(--var)` / `origin-(--var)` shorthands are not+ // valid in v3: the list had no height cap at all, so a long one ran+ // past the bottom of the viewport.+ "max-h-[var(--radix-select-content-available-height)] origin-[var(--radix-select-content-transform-origin)]",position === "popper" &&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",className@@ -109,7 +116,9 @@ function SelectItem({<SelectPrimitive.Itemdata-slot="select-item"className={cn(- "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",+ // `outline-hidden` is another v4-only name; v3 spells it `outline-none`.+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",+ "transition-colors duration-fast ease-out-soft",className)}{...props}diff --git a/client/shared/ui/switch.tsx b/client/shared/ui/switch.tsxindex b6b697c..7d7c5d9 100644--- a/client/shared/ui/switch.tsx+++ b/client/shared/ui/switch.tsx@@ -13,7 +13,8 @@ function Switch({<SwitchPrimitive.Rootdata-slot="switch"className={cn(- "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/30 dark:data-[state=unchecked]:bg-input/80 inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent px-0.5 shadow-[inset_0_1px_2px_hsl(var(--shadow-hue)/0.10)] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",+ "transition-[background-color,box-shadow] duration-base ease-out-soft",className)}{...props}@@ -21,7 +22,9 @@ function Switch({<SwitchPrimitive.Thumbdata-slot="switch-thumb"className={cn(- "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full shadow-xs ring-0 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",+ // Slight overshoot so the thumb lands rather than slides to a stop.+ "transition-transform duration-base [transition-timing-function:cubic-bezier(0.34,1.4,0.64,1)]")}/></SwitchPrimitive.Root>diff --git a/client/shared/ui/textarea.tsx b/client/shared/ui/textarea.tsxindex 226e6b9..ccfefc8 100644--- a/client/shared/ui/textarea.tsx+++ b/client/shared/ui/textarea.tsx@@ -16,7 +16,9 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"texref={ref}data-slot="textarea"className={cn(- "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-sm transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive bg-card flex field-sizing-content min-h-16 w-full rounded-lg border px-3 py-2 text-base shadow-xs outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",+ "transition-[color,box-shadow,border-color,background-color,height] duration-fast ease-out-soft",+ "hover:border-border",className)}{...props}diff --git a/client/shared/ui/tooltip.tsx b/client/shared/ui/tooltip.tsxindex f014f37..e31e3ca 100644--- a/client/shared/ui/tooltip.tsx+++ b/client/shared/ui/tooltip.tsx@@ -42,13 +42,18 @@ const TooltipContent = React.forwardRef<data-slot="tooltip-content"sideOffset={sideOffset}className={cn(- "bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",+ // A clay tooltip on every icon would shout; the inverted neutral reads+ // as a system surface and flips correctly with the theme.+ "bg-foreground text-background shadow-soft animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 z-50 w-fit rounded-md px-2.5 py-1.5 text-xs font-medium text-balance",+ // Tailwind v4's `origin-(--var)` shorthand is not valid in v3, so the+ // zoom used to pivot from the centre instead of the trigger edge.+ "origin-[var(--radix-tooltip-content-transform-origin)]",className,)}{...props}>{children}- <TooltipPrimitive.Arrow className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />+ <TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" /></TooltipPrimitive.Content></TooltipPrimitive.Portal>))diff --git a/client/workspaces/flow/FlowWorkspace.tsx b/client/workspaces/flow/FlowWorkspace.tsxindex 08e54af..f443d77 100644--- a/client/workspaces/flow/FlowWorkspace.tsx+++ b/client/workspaces/flow/FlowWorkspace.tsx@@ -9,6 +9,7 @@ import {type PanelImperativeHandle,} from "@/shared/ui/resizable"import { DiagramProvider, useDiagram } from "@/workspaces/flow/state/diagram-context"+import { useTheme } from "@/shared/theme"const drawioBaseUrl =(typeof import.meta !== "undefined" &&@@ -23,7 +24,8 @@ function FlowCanvas() {const [isMobile, setIsMobile] = useState(false)const [isChatVisible, setIsChatVisible] = useState(true)const [drawioUi, setDrawioUi] = useState<"min" | "sketch">("min")- const [darkMode, setDarkMode] = useState(false)+ // Theme is app-wide now; this canvas only mirrors it into the draw.io embed.+ const { isDark: darkMode, resolved, setTheme } = useTheme()const [isLoaded, setIsLoaded] = useState(false)const [closeProtection, setCloseProtection] = useState(false)@@ -36,21 +38,6 @@ function FlowCanvas() {setDrawioUi(savedUi)}- const savedDarkMode = localStorage.getItem("next-ai-draw-io-dark-mode")- if (savedDarkMode !== null) {- // Use saved preference- const isDark = savedDarkMode === "true"- setDarkMode(isDark)- document.documentElement.classList.toggle("dark", isDark)- } else {- // First visit: match browser preference- const prefersDark = window.matchMedia(- "(prefers-color-scheme: dark)",- ).matches- setDarkMode(prefersDark)- document.documentElement.classList.toggle("dark", prefersDark)- }-const savedCloseProtection = localStorage.getItem(STORAGE_CLOSE_PROTECTION_KEY,)@@ -62,14 +49,17 @@ function FlowCanvas() {}, [])const toggleDarkMode = () => {- const newValue = !darkMode- setDarkMode(newValue)- localStorage.setItem("next-ai-draw-io-dark-mode", String(newValue))- document.documentElement.classList.toggle("dark", newValue)- // Reset so onDrawioLoad fires again after remount- resetDrawioReady()+ setTheme(darkMode ? "light" : "dark")}+ // The embed is keyed on the theme, so a change from anywhere -- this+ // canvas's own button, the app header, or the OS while set to "system" --+ // remounts it. Reset first so onDrawioLoad fires again afterwards.+ useEffect(() => {+ resetDrawioReady()+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [resolved])+// Check mobileuseEffect(() => {const checkMobile = () => {diff --git a/index.html b/index.htmlindex 7dec64c..7c573df 100644--- a/index.html+++ b/index.html@@ -6,6 +6,25 @@<link rel="shortcut icon" href="/favicon.svg?v=CanvasAnvil" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>CanvasAnvil</title>+ <!-- Runs before first paint so a dark-theme user never sees an ivory+ flash. Kept in sync with client/shared/theme.ts. -->+ <script>+ (function () {+ try {+ var stored = localStorage.getItem('CanvasAnvil-theme-v1');+ if (stored !== 'light' && stored !== 'dark' && stored !== 'system') {+ var legacy = localStorage.getItem('next-ai-draw-io-dark-mode');+ stored = legacy === 'true' ? 'dark' : legacy === 'false' ? 'light' : 'system';+ }+ var dark =+ stored === 'dark' ||+ (stored === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);+ document.documentElement.classList.toggle('dark', dark);+ } catch (e) {+ /* Blocked storage just means we fall through to the light default. */+ }+ })();+ </script><script type="module">if (import.meta.hot?.on) {import.meta.hot.on('vite:error', (error) => {diff --git a/package-lock.json b/package-lock.jsonindex 34a5609..9cd5b2e 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,16 +1,18 @@{"name": "canvasanvil",- "version": "2.0.0",+ "version": "2.1.0","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "canvasanvil",- "version": "2.0.0",+ "version": "2.1.0",+ "license": "AGPL-3.0-only","dependencies": {"@ai-sdk/openai": "^2.0.19","@ai-sdk/react": "^2.0.107",- "@jvmr/pptx-to-html": "^1.0.0",+ "@fontsource-variable/inter": "^5.3.0",+ "@fontsource-variable/source-serif-4": "^5.3.0","@langfuse/client": "^4.6.0","@langfuse/tracing": "^4.6.0","@opentelemetry/api": "^1.9.0",@@ -28,8 +30,7 @@"class-variance-authority": "^0.7.1","clsx": "^2.1.1","express": "^5.2.1",- "framer-motion": "^12.28.1",- "js-tiktoken": "^1.0.21",+ "jszip": "^3.10.1","lucide-react": "^0.511.0","mammoth": "^1.11.0","motion": "^12.28.1",@@ -44,17 +45,13 @@"react-icons": "^5.5.0","react-markdown": "^10.1.0","react-resizable-panels": "^4.4.1",- "react-resizable-panels-v3": "npm:react-resizable-panels@^3.0.6",- "react-router-dom": "^7.3.0","remark-gfm": "^4.0.1","sonner": "^2.0.7","tailwind-merge": "^3.4.0","tailwindcss-animate": "^1.0.7",- "three": "^0.161.0","tsx": "^4.21.0","unpdf": "^1.4.0",- "zod": "^4.3.6",- "zustand": "^5.0.3"+ "zod": "^4.3.6"},"devDependencies": {"@eslint/js": "^9.25.0",@@ -64,17 +61,13 @@"@types/pako": "^2.0.4","@types/react": "^18.3.12","@types/react-dom": "^18.3.1",- "@types/three": "^0.182.0","@vitejs/plugin-react": "^4.4.1","autoprefixer": "^10.4.23",- "concurrently": "^9.2.1","eslint": "^9.25.0","eslint-plugin-react-hooks": "^5.2.0","eslint-plugin-react-refresh": "^0.4.19","globals": "^16.0.0",- "http-proxy-middleware": "^3.0.5","postcss": "^8.5.6",- "sass-embedded": "^1.99.0","tailwindcss": "^3.4.19","typescript": "~5.8.3","typescript-eslint": "^8.30.1",@@ -467,14 +460,9 @@"resolved": "https://registry.npmmirror.com/@bufbuild/protobuf/-/protobuf-2.11.0.tgz","integrity": "sha512-sBXGT13cpmPR5BMgHE6UEEfEaShh5Ror6rfN3yEK5si7QVrtZg8LEPQb0VVhiLRUslD2yLnXtnRzG035J/mZXQ==","dev": true,- "license": "(Apache-2.0 AND BSD-3-Clause)"- },- "node_modules/@dimforge/rapier3d-compat": {- "version": "0.12.0",- "resolved": "https://registry.npmmirror.com/@dimforge/rapier3d-compat/-/rapier3d-compat-0.12.0.tgz",- "integrity": "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==",- "dev": true,- "license": "Apache-2.0"+ "license": "(Apache-2.0 AND BSD-3-Clause)",+ "optional": true,+ "peer": true},"node_modules/@esbuild/aix-ppc64": {"version": "0.25.12",@@ -1113,6 +1101,24 @@"integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==","license": "MIT"},+ "node_modules/@fontsource-variable/inter": {+ "version": "5.3.0",+ "resolved": "https://registry.npmmirror.com/@fontsource-variable/inter/-/inter-5.3.0.tgz",+ "integrity": "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==",+ "license": "OFL-1.1",+ "funding": {+ "url": "https://github.com/sponsors/ayuhito"+ }+ },+ "node_modules/@fontsource-variable/source-serif-4": {+ "version": "5.3.0",+ "resolved": "https://registry.npmmirror.com/@fontsource-variable/source-serif-4/-/source-serif-4-5.3.0.tgz",+ "integrity": "sha512-9vch9WqxjaaA+1o9Ur8pOgIGbCYLjRReOUel23A6lOpD1syptgjtkORevvNmldJ5kGXQL29onQUqI5Ltz0s3bQ==",+ "license": "OFL-1.1",+ "funding": {+ "url": "https://github.com/sponsors/ayuhito"+ }+ },"node_modules/@humanfs/core": {"version": "0.19.1","resolved": "https://registry.npmmirror.com/@humanfs/core/-/core-0.19.1.tgz",@@ -1211,15 +1217,6 @@"@jridgewell/sourcemap-codec": "^1.4.14"}},- "node_modules/@jvmr/pptx-to-html": {- "version": "1.0.0",- "resolved": "https://registry.npmmirror.com/@jvmr/pptx-to-html/-/pptx-to-html-1.0.0.tgz",- "integrity": "sha512-08XVODrexXWT2JpDaywHMe6ucP+JK4FeXT+QbduMSi6J/175c3AynXCb89ed24w/Sx5YiPCTUlGJjCiTfYtd3g==",- "license": "MIT",- "dependencies": {- "jszip": "^3.10.1"- }- },"node_modules/@langfuse/client": {"version": "4.6.0","resolved": "https://registry.npmmirror.com/@langfuse/client/-/client-4.6.0.tgz",@@ -1310,6 +1307,7 @@"hasInstallScript": true,"license": "MIT","optional": true,+ "peer": true,"dependencies": {"detect-libc": "^2.0.3","is-glob": "^4.0.3",@@ -1352,6 +1350,7 @@"os": ["android"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1373,6 +1372,7 @@"os": ["darwin"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1394,6 +1394,7 @@"os": ["darwin"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1415,6 +1416,7 @@"os": ["freebsd"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1436,6 +1438,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1457,6 +1460,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1478,6 +1482,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1499,6 +1504,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1520,6 +1526,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1541,6 +1548,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1562,6 +1570,7 @@"os": ["win32"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1583,6 +1592,7 @@"os": ["win32"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1604,6 +1614,7 @@"os": ["win32"],+ "peer": true,"engines": {"node": ">= 10.0.0"},@@ -1619,6 +1630,7 @@"dev": true,"license": "MIT","optional": true,+ "peer": true,"engines": {"node": ">=12"},@@ -2979,13 +2991,6 @@"node": ">=4"}},- "node_modules/@tweenjs/tween.js": {- "version": "23.1.3",- "resolved": "https://registry.npmmirror.com/@tweenjs/tween.js/-/tween.js-23.1.3.tgz",- "integrity": "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==",- "dev": true,- "license": "MIT"- },"node_modules/@types/babel__core": {"version": "7.20.5","resolved": "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz",@@ -3117,16 +3122,6 @@"dev": true,"license": "MIT"},- "node_modules/@types/http-proxy": {- "version": "1.17.17",- "resolved": "https://registry.npmmirror.com/@types/http-proxy/-/http-proxy-1.17.17.tgz",- "integrity": "sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==",- "dev": true,- "license": "MIT",- "dependencies": {- "@types/node": "*"- }- },"node_modules/@types/json-schema": {"version": "7.0.15","resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz",@@ -3232,42 +3227,12 @@"@types/node": "*"}},- "node_modules/@types/stats.js": {- "version": "0.17.4",- "resolved": "https://registry.npmmirror.com/@types/stats.js/-/stats.js-0.17.4.tgz",- "integrity": "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==",- "dev": true,- "license": "MIT"- },- "node_modules/@types/three": {- "version": "0.182.0",- "resolved": "https://registry.npmmirror.com/@types/three/-/three-0.182.0.tgz",- "integrity": "sha512-WByN9V3Sbwbe2OkWuSGyoqQO8Du6yhYaXtXLoA5FkKTUJorZ+yOHBZ35zUUPQXlAKABZmbYp5oAqpA4RBjtJ/Q==",- "dev": true,- "license": "MIT",- "dependencies": {- "@dimforge/rapier3d-compat": "~0.12.0",- "@tweenjs/tween.js": "~23.1.3",- "@types/stats.js": "*",- "@types/webxr": ">=0.5.17",- "@webgpu/types": "*",- "fflate": "~0.8.2",- "meshoptimizer": "~0.22.0"- }- },"node_modules/@types/unist": {"version": "3.0.3","resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz","integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==","license": "MIT"},- "node_modules/@types/webxr": {- "version": "0.5.24",- "resolved": "https://registry.npmmirror.com/@types/webxr/-/webxr-0.5.24.tgz",- "integrity": "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==",- "dev": true,- "license": "MIT"- },"node_modules/@typescript-eslint/eslint-plugin": {"version": "8.53.1","resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.53.1.tgz",@@ -3573,13 +3538,6 @@"vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"}},- "node_modules/@webgpu/types": {- "version": "0.1.69",- "resolved": "https://registry.npmmirror.com/@webgpu/types/-/types-0.1.69.tgz",- "integrity": "sha512-RPmm6kgRbI8e98zSD3RVACvnuktIja5+yLgDAkTmxLr90BEwdTXRQWNLF3ETTTyH/8mKhznZuN5AveXYFEsMGQ==",- "dev": true,- "license": "BSD-3-Clause"- },"node_modules/@xmldom/xmldom": {"version": "0.8.11","resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.11.tgz",@@ -3660,16 +3618,6 @@"url": "https://github.com/sponsors/epoberezkin"}},- "node_modules/ansi-regex": {- "version": "5.0.1",- "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",- "dev": true,- "license": "MIT",- "engines": {- "node": ">=8"- }- },"node_modules/ansi-styles": {"version": "4.3.0","resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",@@ -4106,21 +4054,6 @@"url": "https://polar.sh/cva"}},- "node_modules/cliui": {- "version": "8.0.1",- "resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz",- "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",- "dev": true,- "license": "ISC",- "dependencies": {- "string-width": "^4.2.0",- "strip-ansi": "^6.0.1",- "wrap-ansi": "^7.0.0"- },- "engines": {- "node": ">=12"- }- },"node_modules/clsx": {"version": "2.1.1","resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz",@@ -4155,7 +4088,9 @@"resolved": "https://registry.npmmirror.com/colorjs.io/-/colorjs.io-0.5.2.tgz","integrity": "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==","dev": true,- "license": "MIT"+ "license": "MIT",+ "optional": true,+ "peer": true},"node_modules/comma-separated-tokens": {"version": "2.0.3",@@ -4183,47 +4118,6 @@"dev": true,"license": "MIT"},- "node_modules/concurrently": {- "version": "9.2.1",- "resolved": "https://registry.npmmirror.com/concurrently/-/concurrently-9.2.1.tgz",- "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==",- "dev": true,- "license": "MIT",- "dependencies": {- "chalk": "4.1.2",- "rxjs": "7.8.2",- "shell-quote": "1.8.3",- "supports-color": "8.1.1",- "tree-kill": "1.2.2",- "yargs": "17.7.2"- },- "bin": {- "conc": "dist/bin/concurrently.js",- "concurrently": "dist/bin/concurrently.js"- },- "engines": {- "node": ">=18"- },- "funding": {- "url": "https://github.com/open-cli-tools/concurrently?sponsor=1"- }- },- "node_modules/concurrently/node_modules/supports-color": {- "version": "8.1.1",- "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-8.1.1.tgz",- "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",- "dev": true,- "license": "MIT",- "dependencies": {- "has-flag": "^4.0.0"- },- "engines": {- "node": ">=10"- },- "funding": {- "url": "https://github.com/chalk/supports-color?sponsor=1"- }- },"node_modules/content-disposition": {"version": "1.0.1","resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-1.0.1.tgz",@@ -4253,19 +4147,6 @@"dev": true,"license": "MIT"},- "node_modules/cookie": {- "version": "1.1.1",- "resolved": "https://registry.npmmirror.com/cookie/-/cookie-1.1.1.tgz",- "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",- "license": "MIT",- "engines": {- "node": ">=18"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },"node_modules/cookie-signature": {"version": "1.2.2","resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.2.2.tgz",@@ -4376,6 +4257,7 @@"dev": true,"license": "Apache-2.0","optional": true,+ "peer": true,"engines": {"node": ">=8"}@@ -4453,13 +4335,6 @@"dev": true,"license": "ISC"},- "node_modules/emoji-regex": {- "version": "8.0.0",- "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",- "dev": true,- "license": "MIT"- },"node_modules/encodeurl": {"version": "2.0.0","resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-2.0.0.tgz",@@ -4766,13 +4641,6 @@"node": ">= 0.6"}},- "node_modules/eventemitter3": {- "version": "4.0.7",- "resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz",- "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",- "dev": true,- "license": "MIT"- },"node_modules/eventsource-parser": {"version": "3.0.6","resolved": "https://registry.npmmirror.com/eventsource-parser/-/eventsource-parser-3.0.6.tgz",@@ -4898,13 +4766,6 @@"reusify": "^1.0.4"}},- "node_modules/fflate": {- "version": "0.8.2",- "resolved": "https://registry.npmmirror.com/fflate/-/fflate-0.8.2.tgz",- "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",- "dev": true,- "license": "MIT"- },"node_modules/file-entry-cache": {"version": "8.0.0","resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz",@@ -4989,27 +4850,6 @@"dev": true,"license": "ISC"},- "node_modules/follow-redirects": {- "version": "1.16.0",- "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.16.0.tgz",- "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",- "dev": true,- "funding": [- {- "type": "individual",- "url": "https://github.com/sponsors/RubenVerborgh"- }- ],- "license": "MIT",- "engines": {- "node": ">=4.0"- },- "peerDependenciesMeta": {- "debug": {- "optional": true- }- }- },"node_modules/forwarded": {"version": "0.2.0","resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",@@ -5102,16 +4942,6 @@"node": ">=6.9.0"}},- "node_modules/get-caller-file": {- "version": "2.0.5",- "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",- "dev": true,- "license": "ISC",- "engines": {- "node": "6.* || 8.* || >= 10.*"- }- },"node_modules/get-intrinsic": {"version": "1.3.0","resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",@@ -5318,39 +5148,6 @@"url": "https://opencollective.com/express"}},- "node_modules/http-proxy": {- "version": "1.18.1",- "resolved": "https://registry.npmmirror.com/http-proxy/-/http-proxy-1.18.1.tgz",- "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",- "dev": true,- "license": "MIT",- "dependencies": {- "eventemitter3": "^4.0.0",- "follow-redirects": "^1.0.0",- "requires-port": "^1.0.0"- },- "engines": {- "node": ">=8.0.0"- }- },- "node_modules/http-proxy-middleware": {- "version": "3.0.5",- "resolved": "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-3.0.5.tgz",- "integrity": "sha512-GLZZm1X38BPY4lkXA01jhwxvDoOkkXqjgVyUzVxiEK4iuRu03PZoYHhHRwxnfhQMDuaxi3vVri0YgSro/1oWqg==",- "dev": true,- "license": "MIT",- "dependencies": {- "@types/http-proxy": "^1.17.15",- "debug": "^4.3.6",- "http-proxy": "^1.18.1",- "is-glob": "^4.0.3",- "is-plain-object": "^5.0.0",- "micromatch": "^4.0.8"- },- "engines": {- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"- }- },"node_modules/https": {"version": "1.0.0","resolved": "https://registry.npmmirror.com/https/-/https-1.0.0.tgz",@@ -5409,7 +5206,9 @@"resolved": "https://registry.npmmirror.com/immutable/-/immutable-5.1.5.tgz","integrity": "sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==","dev": true,- "license": "MIT"+ "license": "MIT",+ "optional": true,+ "peer": true},"node_modules/import-fresh": {"version": "3.3.1",@@ -5529,16 +5328,6 @@"node": ">=0.10.0"}},- "node_modules/is-fullwidth-code-point": {- "version": "3.0.0",- "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",- "dev": true,- "license": "MIT",- "engines": {- "node": ">=8"- }- },"node_modules/is-glob": {"version": "4.0.3","resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz",@@ -5582,16 +5371,6 @@"url": "https://github.com/sponsors/sindresorhus"}},- "node_modules/is-plain-object": {- "version": "5.0.0",- "resolved": "https://registry.npmmirror.com/is-plain-object/-/is-plain-object-5.0.0.tgz",- "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",- "dev": true,- "license": "MIT",- "engines": {- "node": ">=0.10.0"- }- },"node_modules/is-promise": {"version": "4.0.0","resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-4.0.0.tgz",@@ -5620,15 +5399,6 @@"jiti": "bin/jiti.js"}},- "node_modules/js-tiktoken": {- "version": "1.0.21",- "resolved": "https://registry.npmmirror.com/js-tiktoken/-/js-tiktoken-1.0.21.tgz",- "integrity": "sha512-biOj/6M5qdgx5TKjDnFT1ymSpM5tbd3ylwDtrQvFQSu0Z7bBYko2dF+W/aUkXUPuk6IVpRxk/3Q2sHOzGlS36g==",- "license": "MIT",- "dependencies": {- "base64-js": "^1.5.1"- }- },"node_modules/js-tokens": {"version": "4.0.0","resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz",@@ -6209,13 +5979,6 @@"node": ">= 8"}},- "node_modules/meshoptimizer": {- "version": "0.22.0",- "resolved": "https://registry.npmmirror.com/meshoptimizer/-/meshoptimizer-0.22.0.tgz",- "integrity": "sha512-IebiK79sqIy+E4EgOr+CAw+Ke8hAspXKzBd0JdgEmPHiAwmvEj2S4h1rfvo+o/BnfEYd/jAOg5IeeIjzlzSnDg==",- "dev": true,- "license": "MIT"- },"node_modules/micromark": {"version": "4.0.2","resolved": "https://registry.npmmirror.com/micromark/-/micromark-4.0.2.tgz",@@ -6937,7 +6700,8 @@"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==","dev": true,"license": "MIT",- "optional": true+ "optional": true,+ "peer": true},"node_modules/node-releases": {"version": "2.0.27",@@ -7676,55 +7440,6 @@"react-dom": "^18.0.0 || ^19.0.0"}},- "node_modules/react-resizable-panels-v3": {- "name": "react-resizable-panels",- "version": "3.0.6",- "resolved": "https://registry.npmmirror.com/react-resizable-panels/-/react-resizable-panels-3.0.6.tgz",- "integrity": "sha512-b3qKHQ3MLqOgSS+FRYKapNkJZf5EQzuf6+RLiq1/IlTHw99YrZ2NJZLk4hQIzTnnIkRg2LUqyVinu6YWWpUYew==",- "license": "MIT",- "peerDependencies": {- "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",- "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"- }- },- "node_modules/react-router": {- "version": "7.12.0",- "resolved": "https://registry.npmmirror.com/react-router/-/react-router-7.12.0.tgz",- "integrity": "sha512-kTPDYPFzDVGIIGNLS5VJykK0HfHLY5MF3b+xj0/tTyNYL1gF1qs7u67Z9jEhQk2sQ98SUaHxlG31g1JtF7IfVw==",- "license": "MIT",- "dependencies": {- "cookie": "^1.0.1",- "set-cookie-parser": "^2.6.0"- },- "engines": {- "node": ">=20.0.0"- },- "peerDependencies": {- "react": ">=18",- "react-dom": ">=18"- },- "peerDependenciesMeta": {- "react-dom": {- "optional": true- }- }- },- "node_modules/react-router-dom": {- "version": "7.12.0",- "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-7.12.0.tgz",- "integrity": "sha512-pfO9fiBcpEfX4Tx+iTYKDtPbrSLLCbwJ5EqP+SPYQu1VYCXdy79GSj0wttR0U4cikVdlImZuEZ/9ZNCgoaxwBA==",- "license": "MIT",- "dependencies": {- "react-router": "7.12.0"- },- "engines": {- "node": ">=20.0.0"- },- "peerDependencies": {- "react": ">=18",- "react-dom": ">=18"- }- },"node_modules/react-style-singleton": {"version": "2.2.3","resolved": "https://registry.npmmirror.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz",@@ -7849,23 +7564,6 @@"url": "https://opencollective.com/unified"}},- "node_modules/require-directory": {- "version": "2.1.1",- "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz",- "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",- "dev": true,- "license": "MIT",- "engines": {- "node": ">=0.10.0"- }- },- "node_modules/requires-port": {- "version": "1.0.0",- "resolved": "https://registry.npmmirror.com/requires-port/-/requires-port-1.0.0.tgz",- "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",- "dev": true,- "license": "MIT"- },"node_modules/resolve": {"version": "1.22.11","resolved": "https://registry.npmmirror.com/resolve/-/resolve-1.22.11.tgz",@@ -8005,6 +7703,8 @@"integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==","dev": true,"license": "Apache-2.0",+ "optional": true,+ "peer": true,"dependencies": {"tslib": "^2.1.0"}@@ -8028,6 +7728,7 @@"dev": true,"license": "MIT","optional": true,+ "peer": true,"dependencies": {"chokidar": "^4.0.0","immutable": "^5.1.5",@@ -8049,6 +7750,8 @@"integrity": "sha512-gF/juR1aX02lZHkvwxdF80SapkQeg2fetoDF6gIQkNbSw5YEUFspMkyGTjPjgZSgIHuZpy+Wz4PlebKnLXMjdg==","dev": true,"license": "MIT",+ "optional": true,+ "peer": true,"dependencies": {"@bufbuild/protobuf": "^2.5.0","colorjs.io": "^0.5.0",@@ -8098,6 +7801,7 @@"dev": true,"license": "MIT","optional": true,+ "peer": true,"dependencies": {"sass": "1.99.0"}@@ -8115,6 +7819,7 @@"os": ["android"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8132,6 +7837,7 @@"os": ["android"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8149,6 +7855,7 @@"os": ["android"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8166,6 +7873,7 @@"os": ["android"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8183,6 +7891,7 @@"os": ["darwin"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8200,6 +7909,7 @@"os": ["darwin"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8217,6 +7927,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8234,6 +7945,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8251,6 +7963,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8268,6 +7981,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8285,6 +7999,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8302,6 +8017,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8319,6 +8035,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8336,6 +8053,7 @@"os": ["linux"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8353,6 +8071,7 @@"!linux","!win32"],+ "peer": true,"dependencies": {"sass": "1.99.0"}@@ -8370,6 +8089,7 @@"os": ["win32"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8387,6 +8107,7 @@"os": ["win32"],+ "peer": true,"engines": {"node": ">=14.0.0"}@@ -8397,6 +8118,8 @@"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==","dev": true,"license": "MIT",+ "optional": true,+ "peer": true,"dependencies": {"has-flag": "^4.0.0"},@@ -8414,6 +8137,7 @@"dev": true,"license": "MIT","optional": true,+ "peer": true,"dependencies": {"readdirp": "^4.0.1"},@@ -8431,6 +8155,7 @@"dev": true,"license": "MIT","optional": true,+ "peer": true,"engines": {"node": ">= 14.18.0"},@@ -8503,12 +8228,6 @@"url": "https://opencollective.com/express"}},- "node_modules/set-cookie-parser": {- "version": "2.7.2",- "resolved": "https://registry.npmmirror.com/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",- "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",- "license": "MIT"- },"node_modules/setimmediate": {"version": "1.0.5","resolved": "https://registry.npmmirror.com/setimmediate/-/setimmediate-1.0.5.tgz",@@ -8544,19 +8263,6 @@"node": ">=8"}},- "node_modules/shell-quote": {- "version": "1.8.3",- "resolved": "https://registry.npmmirror.com/shell-quote/-/shell-quote-1.8.3.tgz",- "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==",- "dev": true,- "license": "MIT",- "engines": {- "node": ">= 0.4"- },- "funding": {- "url": "https://github.com/sponsors/ljharb"- }- },"node_modules/side-channel": {"version": "1.1.0","resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz",@@ -8682,21 +8388,6 @@"safe-buffer": "~5.1.0"}},- "node_modules/string-width": {- "version": "4.2.3",- "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",- "dev": true,- "license": "MIT",- "dependencies": {- "emoji-regex": "^8.0.0",- "is-fullwidth-code-point": "^3.0.0",- "strip-ansi": "^6.0.1"- },- "engines": {- "node": ">=8"- }- },"node_modules/stringify-entities": {"version": "4.0.4","resolved": "https://registry.npmmirror.com/stringify-entities/-/stringify-entities-4.0.4.tgz",@@ -8711,19 +8402,6 @@"url": "https://github.com/sponsors/wooorm"}},- "node_modules/strip-ansi": {- "version": "6.0.1",- "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",- "dev": true,- "license": "MIT",- "dependencies": {- "ansi-regex": "^5.0.1"- },- "engines": {- "node": ">=8"- }- },"node_modules/strip-json-comments": {"version": "3.1.1","resolved": "https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz",@@ -8821,6 +8499,8 @@"integrity": "sha512-8lD+t2KrrScJ/7KXCSyfhT3/hRq78rC0wBFqNJXv3mZyn6hW2ypM05JmlSvtqRbeq6jqA94oHbxAr2vYsJ8vDA==","dev": true,"license": "MIT",+ "optional": true,+ "peer": true,"dependencies": {"sync-message-port": "^1.0.0"},@@ -8834,6 +8514,8 @@"integrity": "sha512-gAQ9qrUN/UCypHtGFbbe7Rc/f9bzO88IwrG8TDo/aMKAApKyD6E3W4Cm0EfhfBb6Z6SKt59tTCTfD+n1xmAvMg==","dev": true,"license": "MIT",+ "optional": true,+ "peer": true,"engines": {"node": ">=16.0.0"}@@ -8915,12 +8597,6 @@"node": ">=0.8"}},- "node_modules/three": {- "version": "0.161.0",- "resolved": "https://registry.npmmirror.com/three/-/three-0.161.0.tgz",- "integrity": "sha512-LC28VFtjbOyEu5b93K0bNRLw1rQlMJ85lilKsYj6dgTu+7i17W+JCCEbvrpmNHF1F3NAUqDSWq50UD7w9H2xQw==",- "license": "MIT"- },"node_modules/throttleit": {"version": "2.1.0","resolved": "https://registry.npmmirror.com/throttleit/-/throttleit-2.1.0.tgz",@@ -8999,16 +8675,6 @@"node": ">=0.6"}},- "node_modules/tree-kill": {- "version": "1.2.2",- "resolved": "https://registry.npmmirror.com/tree-kill/-/tree-kill-1.2.2.tgz",- "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",- "dev": true,- "license": "MIT",- "bin": {- "tree-kill": "cli.js"- }- },"node_modules/trim-lines": {"version": "3.0.1","resolved": "https://registry.npmmirror.com/trim-lines/-/trim-lines-3.0.1.tgz",@@ -9842,7 +9508,9 @@"resolved": "https://registry.npmmirror.com/varint/-/varint-6.0.0.tgz","integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==","dev": true,- "license": "MIT"+ "license": "MIT",+ "optional": true,+ "peer": true},"node_modules/vary": {"version": "1.1.2",@@ -10033,24 +9701,6 @@"node": ">=0.10.0"}},- "node_modules/wrap-ansi": {- "version": "7.0.0",- "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",- "dev": true,- "license": "MIT",- "dependencies": {- "ansi-styles": "^4.0.0",- "string-width": "^4.1.0",- "strip-ansi": "^6.0.0"- },- "engines": {- "node": ">=10"- },- "funding": {- "url": "https://github.com/chalk/wrap-ansi?sponsor=1"- }- },"node_modules/wrappy": {"version": "1.0.2","resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",@@ -10066,16 +9716,6 @@"node": ">=4.0"}},- "node_modules/y18n": {- "version": "5.0.8",- "resolved": "https://registry.npmmirror.com/y18n/-/y18n-5.0.8.tgz",- "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",- "dev": true,- "license": "ISC",- "engines": {- "node": ">=10"- }- },"node_modules/yallist": {"version": "3.1.1","resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz",@@ -10083,35 +9723,6 @@"dev": true,"license": "ISC"},- "node_modules/yargs": {- "version": "17.7.2",- "resolved": "https://registry.npmmirror.com/yargs/-/yargs-17.7.2.tgz",- "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",- "dev": true,- "license": "MIT",- "dependencies": {- "cliui": "^8.0.1",- "escalade": "^3.1.1",- "get-caller-file": "^2.0.5",- "require-directory": "^2.1.1",- "string-width": "^4.2.3",- "y18n": "^5.0.5",- "yargs-parser": "^21.1.1"- },- "engines": {- "node": ">=12"- }- },- "node_modules/yargs-parser": {- "version": "21.1.1",- "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-21.1.1.tgz",- "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",- "dev": true,- "license": "ISC",- "engines": {- "node": ">=12"- }- },"node_modules/yocto-queue": {"version": "0.1.0","resolved": "https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz",@@ -10134,35 +9745,6 @@"url": "https://github.com/sponsors/colinhacks"}},- "node_modules/zustand": {- "version": "5.0.10",- "resolved": "https://registry.npmmirror.com/zustand/-/zustand-5.0.10.tgz",- "integrity": "sha512-U1AiltS1O9hSy3rul+Ub82ut2fqIAefiSuwECWt6jlMVUGejvf+5omLcRBSzqbRagSM3hQZbtzdeRc6QVScXTg==",- "license": "MIT",- "engines": {- "node": ">=12.20.0"- },- "peerDependencies": {- "@types/react": ">=18.0.0",- "immer": ">=9.0.6",- "react": ">=18.0.0",- "use-sync-external-store": ">=1.2.0"- },- "peerDependenciesMeta": {- "@types/react": {- "optional": true- },- "immer": {- "optional": true- },- "react": {- "optional": true- },- "use-sync-external-store": {- "optional": true- }- }- },"node_modules/zwitch": {"version": "2.0.4","resolved": "https://registry.npmmirror.com/zwitch/-/zwitch-2.0.4.tgz",diff --git a/package.json b/package.jsonindex 1995b70..00c2873 100644--- a/package.json+++ b/package.json@@ -17,6 +17,8 @@"dependencies": {"@ai-sdk/openai": "^2.0.19","@ai-sdk/react": "^2.0.107",+ "@fontsource-variable/inter": "^5.3.0",+ "@fontsource-variable/source-serif-4": "^5.3.0","@langfuse/client": "^4.6.0","@langfuse/tracing": "^4.6.0","@opentelemetry/api": "^1.9.0",diff --git a/tailwind.config.js b/tailwind.config.jsindex 91626ce..04192e3 100644--- a/tailwind.config.js+++ b/tailwind.config.js@@ -11,12 +11,22 @@ export default {},},extend: {+ fontFamily: {+ // Source Serif 4 stands in for Copernicus; Inter for Styrene. Both are+ // self-hosted (see client/main.tsx) so there is no CDN round trip.+ display: ['"Source Serif 4 Variable"', 'Georgia', '"Songti SC"', '"Noto Serif SC"', 'serif'],+ sans: ['"Inter Variable"', '-apple-system', 'BlinkMacSystemFont', '"PingFang SC"', '"Microsoft YaHei"', '"Noto Sans SC"', 'sans-serif'],+ mono: ['ui-monospace', 'SFMono-Regular', '"SF Mono"', 'Consolas', 'monospace'],+ },colors: {border: "hsl(var(--border))",input: "hsl(var(--input))",ring: "hsl(var(--ring))",background: "hsl(var(--background))",foreground: "hsl(var(--foreground))",+ elevated: "hsl(var(--elevated))",+ sunken: "hsl(var(--sunken))",+ overlay: "hsl(var(--overlay))",primary: {DEFAULT: "hsl(var(--primary))",foreground: "hsl(var(--primary-foreground))",@@ -50,6 +60,53 @@ export default {lg: "var(--radius)",md: "calc(var(--radius) - 2px)",sm: "calc(var(--radius) - 4px)",+ xl: "calc(var(--radius) + 4px)",+ "2xl": "calc(var(--radius) + 10px)",+ },+ boxShadow: {+ // `shadow-xs` shipped in shadcn's Tailwind-v4 templates but was never+ // defined here, so seven call sites rendered no shadow at all.+ xs: "0 1px 2px hsl(var(--shadow-hue) / 0.05)",+ },+ transitionTimingFunction: {+ "out-soft": "cubic-bezier(0.22, 1, 0.36, 1)",+ "in-out-soft": "cubic-bezier(0.65, 0, 0.35, 1)",+ },+ transitionDuration: {+ fast: "150ms",+ base: "220ms",+ slow: "340ms",+ },+ keyframes: {+ "rise-in": {+ from: { opacity: "0", transform: "translateY(8px)" },+ to: { opacity: "1", transform: "none" },+ },+ "fade-in": {+ from: { opacity: "0" },+ to: { opacity: "1" },+ },+ "scale-in": {+ from: { opacity: "0", transform: "scale(0.97)" },+ to: { opacity: "1", transform: "none" },+ },+ // Travelling highlight for streaming/pending text.+ sheen: {+ from: { backgroundPosition: "200% center" },+ to: { backgroundPosition: "-200% center" },+ },+ // Soft attention pulse that does not change layout.+ breathe: {+ "0%, 100%": { opacity: "0.55" },+ "50%": { opacity: "1" },+ },+ },+ animation: {+ "rise-in": "rise-in var(--dur-base) var(--ease-out-soft) both",+ "fade-in": "fade-in var(--dur-base) var(--ease-out-soft) both",+ "scale-in": "scale-in var(--dur-base) var(--ease-out-soft) both",+ sheen: "sheen 2.2s linear infinite",+ breathe: "breathe 4s var(--ease-in-out-soft) infinite",},},},