Skip to content

Open source CapCut alternative.

TypeScript

feat(site): teach the editor mock the Media panel and tool calls

David Le7927891f8214
diff --git a/site/src/cut/components/editor-mock/EditorMock.tsx b/site/src/cut/components/editor-mock/EditorMock.tsx
index fd2a2354..a1d4ae9f 100644
--- a/site/src/cut/components/editor-mock/EditorMock.tsx
+++ b/site/src/cut/components/editor-mock/EditorMock.tsx
@@ -9,7 +9,7 @@ import { MockPreview } from "@/cut/components/editor-mock/MockPreview";
import { MockSidePanel } from "@/cut/components/editor-mock/MockSidePanel";
import { MockTimeline } from "@/cut/components/editor-mock/MockTimeline";
import { MockTopBar } from "@/cut/components/editor-mock/MockTopBar";
-import { MOCK_PROJECTS } from "@/cut/components/editor-mock/mockData";
+import { MOCK_PROJECTS, type MockProject } from "@/cut/components/editor-mock/mockData";
import { cn } from "@/lib/utils";
// The mock is authored at a fixed design size and scaled to its container's
@@ -29,6 +29,8 @@ const VIEWS = {
export type EditorMockView = keyof typeof VIEWS;
type Props = {
+ /** Show exactly this project instead of the landing's showcase pair. */
+ project?: MockProject;
view?: EditorMockView;
/** Which dimension the mock is sized by. "width" fills the container and
* takes whatever height that implies; "height" fills a container of bounded
@@ -45,16 +47,18 @@ type Props = {
shadow?: boolean;
};
-// A hand-built, display-only replica of the Cut editor showing two finished
-// projects. The panels copy the real components' chrome (see the Mock*
-// siblings) over hardcoded data — no stores, no engine. The dots below switch
-// projects; nothing auto-advances.
+// A hand-built, display-only replica of the Cut editor over a finished project.
+// The panels copy the real components' chrome (see the Mock* siblings) on
+// hardcoded data — no stores, no engine. Given several projects the dots below
+// switch between them; nothing auto-advances.
export function EditorMock({
+ project,
view = "full",
fit = "width",
showSwitcher = true,
shadow = true,
}: Props) {
+ const projects = project ? [project] : MOCK_PROJECTS;
const [active, setActive] = useState(0);
const frameRef = useRef<HTMLDivElement>(null);
const [box, setBox] = useState({ width: 0, height: 0 });
@@ -117,9 +121,9 @@ export function EditorMock({
transform: `scale(${scale}) translateX(${-x}px)`,
}}
>
- {MOCK_PROJECTS.map((project, i) => (
+ {projects.map((p, i) => (
<div
- key={project.id}
+ key={p.id}
className={cn(
// Same frame as the real editor: the chat panel is a
// full-height column beside the top-bar/preview/timeline grid.
@@ -128,14 +132,14 @@ export function EditorMock({
)}
>
<div className="grid min-w-0 flex-1 grid-rows-[46px_minmax(0,1fr)_auto]">
- <MockTopBar project={project} />
+ <MockTopBar project={p} />
<div className="grid min-h-0 grid-cols-[auto_minmax(0,1fr)]">
- <MockSidePanel project={project} />
- <MockPreview project={project} active={i === active} />
+ <MockSidePanel project={p} />
+ <MockPreview project={p} active={i === active} />
</div>
- <MockTimeline project={project} />
+ <MockTimeline project={p} />
</div>
- <MockAiPanel project={project} />
+ <MockAiPanel project={p} />
</div>
))}
</div>
@@ -148,9 +152,9 @@ export function EditorMock({
</figcaption>
{showSwitcher && (
<div className="mt-6 flex flex-wrap justify-center gap-1.5">
- {MOCK_PROJECTS.map((project, i) => (
+ {projects.map((p, i) => (
<button
- key={project.id}
+ key={p.id}
type="button"
onClick={() => setActive(i)}
aria-pressed={i === active}
@@ -165,7 +169,7 @@ export function EditorMock({
i === active ? "bg-coral" : "bg-ink/25",
)}
/>
- {project.switcherLabel}
+ {p.switcherLabel}
</button>
))}
</div>
diff --git a/site/src/cut/components/editor-mock/MockAiPanel.tsx b/site/src/cut/components/editor-mock/MockAiPanel.tsx
index 1ecae5ca..4ae69972 100644
--- a/site/src/cut/components/editor-mock/MockAiPanel.tsx
+++ b/site/src/cut/components/editor-mock/MockAiPanel.tsx
@@ -2,12 +2,14 @@
import {
ArrowUp,
+ Check,
ChevronDown,
CircleDashed,
History,
Mic,
Plus,
Sparkles,
+ Wrench,
X,
} from "lucide-react";
import { cn } from "@/lib/utils";
@@ -96,22 +98,39 @@ function MockMessage({
}
return (
<div className="mock-chat-msg mb-3 flex flex-col gap-1.5" style={delay}>
- <div className="max-w-full text-[12.5px] leading-relaxed">
+ {message.tool && (
+ <span className="flex w-fit max-w-full items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] text-muted-foreground">
+ <Wrench className="size-3 shrink-0" />
+ <span className="font-mono">{message.tool.name}</span>
+ {message.tool.count && (
+ <span className="text-[10px] tabular-nums">×{message.tool.count}</span>
+ )}
+ <Check className="size-3 text-emerald-600" />
+ </span>
+ )}
+ <div className="max-w-full text-[12.5px] leading-relaxed whitespace-pre-line">
{message.text}
</div>
{message.cards && (
<div
className={cn(
"grid gap-1.5",
- message.cards.length > 2 ? "grid-cols-3" : "grid-cols-2",
+ // Tall cards leave no room for a third column.
+ message.portrait || message.cards.length <= 2
+ ? "grid-cols-2"
+ : "grid-cols-3",
)}
>
{message.cards.map((card) => (
- <div key={card.label} className="flex flex-col gap-1">
+ <div key={card.src} className="flex flex-col gap-1">
<div
className={cn(
"relative overflow-hidden rounded-md border border-border",
- card.duration ? "aspect-video" : "aspect-[3/4]",
+ message.portrait
+ ? "aspect-[9/16]"
+ : card.duration
+ ? "aspect-video"
+ : "aspect-[3/4]",
)}
>
<img
@@ -125,9 +144,11 @@ function MockMessage({
</span>
)}
</div>
- <span className="w-full truncate text-[10px] text-muted-foreground">
- {card.label}
- </span>
+ {card.label && (
+ <span className="w-full truncate text-[10px] text-muted-foreground">
+ {card.label}
+ </span>
+ )}
</div>
))}
</div>
diff --git a/site/src/cut/components/editor-mock/MockSidePanel.tsx b/site/src/cut/components/editor-mock/MockSidePanel.tsx
index dfd65de1..af0eb8dc 100644
--- a/site/src/cut/components/editor-mock/MockSidePanel.tsx
+++ b/site/src/cut/components/editor-mock/MockSidePanel.tsx
@@ -8,19 +8,25 @@ import {
Film,
FolderOpen,
Image as ImageIcon,
+ Layers,
Music,
+ Play,
Sparkles,
+ Upload,
} from "lucide-react";
import { cn } from "@/lib/utils";
import type {
+ MockMediaItem,
+ MockPanel,
MockPanelTab,
MockProject,
+ MockTemplate,
} from "@/cut/components/editor-mock/mockData";
// Static replica of the editor's left side panel for the landing mock: the
-// icon rail plus the open generation panel, populated from hardcoded slide
-// data. Class strings mirror SidePanel/ImageGenPanel/GeneratePanel so it is
-// indistinguishable from the real editor at a glance.
+// icon rail plus whichever panel the slide has open, populated from hardcoded
+// slide data. Class strings mirror SidePanel/ImageGenPanel/GeneratePanel so it
+// is indistinguishable from the real editor at a glance.
const TABS: { id: MockPanelTab; label: string; icon: typeof Film }[] = [
{ id: "media", label: "Media", icon: Clapperboard },
@@ -48,7 +54,7 @@ function Pill({ label, className }: { label: string; className?: string }) {
}
export function MockSidePanel({ project }: { project: MockProject }) {
- const isImage = project.panelTab === "image";
+ const { panel } = project;
return (
<div className="flex h-full min-h-0 overflow-hidden border-r border-border bg-card">
@@ -66,7 +72,7 @@ export function MockSidePanel({ project }: { project: MockProject }) {
<span
className={cn(
"relative grid size-9 place-items-center rounded-lg",
- project.panelTab === id && "bg-muted text-foreground"
+ panel.tab === id && "bg-muted text-foreground"
)}
>
<Icon className="size-4.5" />
@@ -74,7 +80,7 @@ export function MockSidePanel({ project }: { project: MockProject }) {
<span
className={cn(
"text-[10px] font-medium",
- project.panelTab === id && "text-foreground"
+ panel.tab === id && "text-foreground"
)}
>
{label}
@@ -83,93 +89,233 @@ export function MockSidePanel({ project }: { project: MockProject }) {
])}
</div>
- {/* Open generation panel */}
<div className="flex w-[252px] min-h-0 shrink-0 flex-col">
- <div className="flex h-12 shrink-0 items-center pr-2.5 pl-4">
- <span className="text-sm font-semibold tracking-tight">
- {isImage ? "Generate image" : "Generate video"}
- </span>
+ {panel.tab === "media" ? (
+ <MediaPanel panel={panel} />
+ ) : (
+ <GeneratePanel panel={panel} aspect={project.aspect} />
+ )}
+ </div>
+ </div>
+ );
+}
+
+/** The project's own files: what the user uploaded or recorded, plus the
+ * arrangements they saved. Generated media lives where it was made, so it
+ * never shows up here. */
+function MediaPanel({ panel }: { panel: Extract<MockPanel, { tab: "media" }> }) {
+ return (
+ <>
+ <div className="flex h-12 shrink-0 items-center pr-2.5 pl-4">
+ <span className="text-sm font-semibold tracking-tight">Media</span>
+ </div>
+ <div className="shrink-0 px-3.5 pb-3">
+ <span className="flex h-8 w-full items-center justify-center gap-1.5 rounded-lg border border-input text-sm font-medium">
+ <Upload className="size-4" /> Upload
+ </span>
+ </div>
+
+ <div className="flex min-h-0 flex-1 flex-col gap-3 overflow-hidden px-3.5 pb-4">
+ <div className="flex shrink-0 flex-col gap-1.5">
+ {panel.templates.map((t, i) => (
+ <TemplateRow key={i} template={t} />
+ ))}
</div>
+ <div className="grid shrink-0 grid-cols-2 content-start gap-2.5">
+ {panel.items.map((item) => (
+ <MediaCard key={item.handle} item={item} />
+ ))}
+ </div>
+ </div>
+ </>
+ );
+}
+
+function TemplateRow({ template }: { template: MockTemplate }) {
+ return (
+ <div className="flex items-center gap-2 rounded-lg border border-border bg-background px-2.5 py-1.5">
+ <Layers className="size-3.5 shrink-0 text-violet-500" />
+ <div className="min-w-0 flex-1">
+ <div className="truncate text-[12px] font-medium">{template.name}</div>
+ <div className="flex items-center gap-0.5 text-[10.5px] text-muted-foreground">
+ {template.duration} · {template.items} items
+ <ChevronDown className="size-3" />
+ </div>
+ </div>
+ </div>
+ );
+}
+
+function MediaCard({ item }: { item: MockMediaItem }) {
+ return (
+ <div className="flex flex-col gap-1.5 text-left">
+ <div className="relative aspect-square overflow-hidden rounded-lg border border-border bg-muted">
+ {item.kind === "audio" ? (
+ <AudioFace item={item} />
+ ) : (
+ // eslint-disable-next-line @next/next/no-img-element -- static landing asset
+ <img src={item.thumb} alt="" className="size-full object-cover" />
+ )}
+ {item.kind === "video" && item.duration && (
+ <span className="absolute right-1 bottom-1 rounded-[5px] bg-black/65 px-1 py-px font-mono text-[9.5px] tabular-nums text-white">
+ {item.duration}
+ </span>
+ )}
+ </div>
+ {item.kind !== "audio" && (
+ <span className="flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground">
+ <Handle handle={item.handle} />
+ <span className="truncate">{item.name}</span>
+ </span>
+ )}
+ </div>
+ );
+}
+
+/** Audio has no frame to show, so the card is the waveform itself — the same
+ * green face, play button, and duration pill the editor draws. */
+function AudioFace({ item }: { item: MockMediaItem }) {
+ return (
+ <div className="relative size-full bg-[#0F6E56]">
+ <div className="absolute inset-x-[8%] top-1/2 flex h-[36%] -translate-y-1/2 items-center justify-between">
+ {Array.from({ length: 34 }, (_, i) => (
+ <span
+ key={i}
+ className="w-[2px] rounded-full bg-[#8fd8bb]"
+ style={{ height: `${AUDIO_PEAKS[i % AUDIO_PEAKS.length]}%` }}
+ />
+ ))}
+ </div>
+ <span className="absolute bottom-2 left-2 grid size-8 place-items-center rounded-full bg-[#e3f2e8] text-[#0F6E56] shadow">
+ <Play className="size-3.5 translate-x-px" />
+ </span>
+ <span className="absolute top-1.5 left-1.5 flex max-w-[70%] min-w-0 items-center gap-1 px-2 py-1 text-[11px] font-medium text-white">
+ <Handle handle={item.handle} dark />
+ <span className="truncate">{item.name}</span>
+ </span>
+ {item.duration && (
+ <span className="absolute right-2 bottom-3 rounded-md bg-[#2b4e42] px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-[#d6eddf]">
+ {item.duration}
+ </span>
+ )}
+ </div>
+ );
+}
+
+/** The short reference a prompt can name the file by (`@v1`). */
+function Handle({ handle, dark }: { handle: string; dark?: boolean }) {
+ return (
+ <span
+ className={cn(
+ "shrink-0 rounded-[5px] px-1 py-px font-mono text-[9px] font-medium",
+ dark ? "bg-white/25 text-white" : "bg-[#0a84ff]/12 text-[#0a84ff]"
+ )}
+ >
+ {handle}
+ </span>
+ );
+}
+
+/** Deterministic waveform silhouette for the audio card face. */
+const AUDIO_PEAKS = [
+ 46, 78, 34, 92, 58, 70, 40, 86, 52, 64, 96, 30, 74, 44, 82, 56, 68, 38, 90, 50,
+];
- <div className="flex min-h-0 flex-1 flex-col gap-3 overflow-hidden px-3.5 pb-4">
- {/* Composer, filled with the slide's prompt */}
- <div className="relative flex shrink-0 flex-col rounded-lg border border-input">
- <div className="min-h-[88px] w-full px-2.5 py-2 pr-9 text-[12.5px] leading-relaxed">
- {project.panelPrompt}
- </div>
+function GeneratePanel({
+ panel,
+ aspect,
+}: {
+ panel: Extract<MockPanel, { tab: "image" | "video" }>;
+ aspect: MockProject["aspect"];
+}) {
+ const isImage = panel.tab === "image";
+
+ return (
+ <>
+ <div className="flex h-12 shrink-0 items-center pr-2.5 pl-4">
+ <span className="text-sm font-semibold tracking-tight">
+ {isImage ? "Generate image" : "Generate video"}
+ </span>
+ </div>
+
+ <div className="flex min-h-0 flex-1 flex-col gap-3 overflow-hidden px-3.5 pb-4">
+ {/* Composer, filled with the slide's prompt */}
+ <div className="relative flex shrink-0 flex-col rounded-lg border border-input">
+ <div className="min-h-[88px] w-full px-2.5 py-2 pr-9 text-[12.5px] leading-relaxed">
+ {panel.prompt}
</div>
+ </div>
- {isImage ? (
- <div className="flex shrink-0 items-center gap-2">
- <Pill
- className="min-w-0 flex-1"
- label={project.aspect === "9:16" ? "Portrait" : "Landscape"}
- />
- <Pill label="2K" />
- </div>
- ) : (
- <>
- <Pill className="h-7 shrink-0" label="Omni Flash" />
- <Pill
- className="h-7 shrink-0"
- label={project.aspect === "9:16" ? "Portrait" : "Landscape"}
- />
- </>
- )}
-
- <div className="flex h-8 w-full shrink-0 items-center justify-center gap-1.5 rounded-lg border border-transparent bg-primary pr-2.5 pl-2 text-sm font-medium whitespace-nowrap text-primary-foreground">
- <Sparkles className="size-4 shrink-0" />
- {isImage ? "Generate image" : "Generate video"}
+ {isImage ? (
+ <div className="flex shrink-0 items-center gap-2">
+ <Pill
+ className="min-w-0 flex-1"
+ label={aspect === "9:16" ? "Vertical" : "Widescreen"}
+ />
+ <Pill label="2K" />
</div>
+ ) : (
+ <>
+ <Pill className="h-7 shrink-0" label="Omni Flash" />
+ <Pill
+ className="h-7 shrink-0"
+ label={aspect === "9:16" ? "Vertical" : "Widescreen"}
+ />
+ </>
+ )}
- {!isImage && (
- <p className="shrink-0 text-[11px] leading-relaxed text-muted-foreground">
- Renders take a minute or two. Keep editing while it runs.
- </p>
- )}
-
- {isImage && <div className="text-xs font-semibold text-muted-foreground">Generated</div>}
-
- {isImage ? (
- <div className="grid shrink-0 grid-cols-2 content-start gap-2.5">
- {project.panelResults.map((r) => (
- <div key={r.label} className="flex flex-col gap-1.5">
- <div
- className={cn(
- "relative aspect-[3/4] overflow-hidden rounded-lg border border-border bg-muted",
- r.selected && "ring-2 ring-[#0a84ff]"
- )}
- >
- {/* eslint-disable-next-line @next/next/no-img-element -- static landing asset */}
- <img src={r.src} alt="" className="size-full object-cover" />
- </div>
- <span className="truncate text-[11px] text-muted-foreground">{r.label}</span>
- </div>
- ))}
- </div>
- ) : (
- <div className="grid shrink-0 grid-cols-2 content-start gap-2.5">
- {project.panelResults.map((r) => (
+ <div className="flex h-8 w-full shrink-0 items-center justify-center gap-1.5 rounded-lg border border-transparent bg-primary pr-2.5 pl-2 text-sm font-medium whitespace-nowrap text-primary-foreground">
+ <Sparkles className="size-4 shrink-0" />
+ {isImage ? "Generate image" : "Generate video"}
+ </div>
+
+ {!isImage && (
+ <p className="shrink-0 text-[11px] leading-relaxed text-muted-foreground">
+ Renders take a minute or two. Keep editing while it runs.
+ </p>
+ )}
+
+ {isImage && <div className="text-xs font-semibold text-muted-foreground">Generated</div>}
+
+ {isImage ? (
+ <div className="grid shrink-0 grid-cols-2 content-start gap-2.5">
+ {panel.results.map((r) => (
+ <div key={r.src} className="flex flex-col gap-1.5">
<div
- key={r.label}
className={cn(
- "relative aspect-video overflow-hidden rounded-lg border border-border bg-muted",
+ "relative aspect-[3/4] overflow-hidden rounded-lg border border-border bg-muted",
r.selected && "ring-2 ring-[#0a84ff]"
)}
>
{/* eslint-disable-next-line @next/next/no-img-element -- static landing asset */}
<img src={r.src} alt="" className="size-full object-cover" />
- {r.duration && (
- <span className="absolute right-1 bottom-1 rounded bg-black/65 px-1 font-mono text-[10px] text-white">
- {r.duration}
- </span>
- )}
</div>
- ))}
- </div>
- )}
- </div>
+ <span className="truncate text-[11px] text-muted-foreground">{r.label}</span>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <div className="grid shrink-0 grid-cols-2 content-start gap-2.5">
+ {panel.results.map((r) => (
+ <div
+ key={r.src}
+ className={cn(
+ "relative aspect-video overflow-hidden rounded-lg border border-border bg-muted",
+ r.selected && "ring-2 ring-[#0a84ff]"
+ )}
+ >
+ {/* eslint-disable-next-line @next/next/no-img-element -- static landing asset */}
+ <img src={r.src} alt="" className="size-full object-cover" />
+ {r.duration && (
+ <span className="absolute right-1 bottom-1 rounded bg-black/65 px-1 font-mono text-[10px] text-white">
+ {r.duration}
+ </span>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
</div>
- </div>
+ </>
);
}
diff --git a/site/src/cut/components/editor-mock/MockTimeline.tsx b/site/src/cut/components/editor-mock/MockTimeline.tsx
index 43a09080..ad6ba90a 100644
--- a/site/src/cut/components/editor-mock/MockTimeline.tsx
+++ b/site/src/cut/components/editor-mock/MockTimeline.tsx
@@ -4,6 +4,7 @@
// presentation: geometry and chrome copied from src/cut/components/Timeline.tsx.
import type { CSSProperties } from "react";
+import { VolumeX } from "lucide-react";
import { cn } from "@/lib/utils";
import type { MockProject } from "@/cut/components/editor-mock/mockData";
@@ -25,7 +26,7 @@ const WAVE = [
export function MockTimeline({ project }: { project: MockProject }) {
const pxPerSec = TRACK_W / project.timelineSeconds;
- const ticks = Array.from({ length: project.timelineSeconds }, (_, i) => i);
+ const ticks = Array.from({ length: Math.ceil(project.timelineSeconds) }, (_, i) => i);
// Clips butt up against each other; each starts where the previous ended.
const clips = project.clips.map((c, i) => ({
@@ -63,23 +64,28 @@ export function MockTimeline({ project }: { project: MockProject }) {
{clips.map((c) => (
<div
key={c.label}
+ role="img"
+ aria-label={c.label}
className={cn(
- "absolute top-0.5 overflow-hidden rounded-lg bg-neutral-200 bg-cover bg-center shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]",
+ "absolute top-0.5 overflow-hidden rounded-lg bg-neutral-200 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]",
c.selected && "z-10 ring-2 ring-[#0a84ff]"
)}
style={{
left: c.left,
width: c.width,
height: VIDEO_H - 4,
+ // The editor draws a clip as a strip of frames repeated across
+ // its width; one tile at native aspect gives the same read.
backgroundImage: `url(${c.thumb})`,
+ backgroundSize: "auto 100%",
+ backgroundRepeat: "repeat-x",
}}
>
- <span className="absolute top-1 left-1 max-w-[80%] truncate rounded-[5px] bg-black/65 px-1.5 py-px text-[10px] text-white">
- {c.label}
- </span>
- <span className="absolute right-1 bottom-1 rounded px-1 py-px font-mono text-[10px] tabular-nums text-white bg-black/65">
- {c.seconds.toFixed(1)}s
- </span>
+ {c.muted && (
+ <span className="absolute bottom-1 left-1 grid size-[18px] place-items-center rounded-[5px] bg-black/70 text-white">
+ <VolumeX className="size-3" />
+ </span>
+ )}
</div>
))}
</div>
diff --git a/site/src/cut/components/editor-mock/MockTopBar.tsx b/site/src/cut/components/editor-mock/MockTopBar.tsx
index 76977682..e28c10d2 100644
--- a/site/src/cut/components/editor-mock/MockTopBar.tsx
+++ b/site/src/cut/components/editor-mock/MockTopBar.tsx
@@ -11,6 +11,7 @@ import {
} from "lucide-react";
import type { MockProject } from "@/cut/components/editor-mock/mockData";
+import { aspectLabel } from "@/cut/lib/types";
// Static replica of src/cut/components/TopBar.tsx — same chrome, no store.
export function MockTopBar({ project }: { project: MockProject }) {
@@ -20,7 +21,7 @@ export function MockTopBar({ project }: { project: MockProject }) {
<div className="absolute left-1/2 flex -translate-x-1/2 items-center gap-2">
<span className="flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-xs font-medium text-muted-foreground shadow-xs">
<AspectIcon className="size-3.5" />
- {project.aspectLabel}
+ {aspectLabel(project.aspect)}
<ChevronDown className="size-3" />
</span>
<span className="flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-xs font-medium text-muted-foreground shadow-xs">
diff --git a/site/src/cut/components/editor-mock/mockData.ts b/site/src/cut/components/editor-mock/mockData.ts
index 07bd9a47..bab804a5 100644
--- a/site/src/cut/components/editor-mock/mockData.ts
+++ b/site/src/cut/components/editor-mock/mockData.ts
@@ -14,17 +14,47 @@ export type MockPanelTab =
export interface MockResultCard {
src: string;
- label: string;
+ /** Caption under the card; omitted where the real card shows the name only
+ * on hover. Also the alt text and list key when present. */
+ label?: string;
/** Duration chip on video results ("4.0s"); omitted on images. */
duration?: string;
selected?: boolean;
}
+/** One card in the Media panel's grid — a file the user brought into the
+ * project, with the short handle (`v1`, `a1`) prompts can reference it by. */
+export interface MockMediaItem {
+ kind: "video" | "image" | "audio";
+ handle: string;
+ name: string;
+ /** Poster for video and image cards; audio draws a waveform face instead. */
+ thumb?: string;
+ duration?: string;
+}
+
+/** A saved arrangement in the Media panel, collapsed to its summary row. */
+export interface MockTemplate {
+ name: string;
+ duration: string;
+ items: number;
+}
+
+/** Which panel is open on the left, and what it holds. The Media panel lists
+ * the project's own files; the generate panels are a prompt over its results. */
+export type MockPanel =
+ | { tab: "media"; templates: MockTemplate[]; items: MockMediaItem[] }
+ | { tab: "image" | "video"; prompt: string; results: MockResultCard[] };
+
export interface MockChatMessage {
role: "user" | "assistant";
text: string;
+ /** Tool-call chip above the message, as the assistant's turn shows its work. */
+ tool?: { name: string; count?: number };
/** Result cards rendered under the message text. */
cards?: MockResultCard[];
+ /** Cards are 9:16 rather than the default 3:4 / 16:9. */
+ portrait?: boolean;
}
export interface MockClip {
@@ -32,6 +62,7 @@ export interface MockClip {
thumb: string;
seconds: number;
selected?: boolean;
+ muted?: boolean;
}
export interface MockCue {
@@ -47,11 +78,7 @@ export interface MockProject {
switcherLabel: string;
name: string;
aspect: MockAspect;
- aspectLabel: string;
- panelTab: MockPanelTab;
- /** Generation prompt shown in the open side panel. */
- panelPrompt: string;
- panelResults: MockResultCard[];
+ panel: MockPanel;
videoSrc: string;
videoPoster: string;
previewCaption: string;
@@ -73,14 +100,15 @@ export const MOCK_PROJECTS: MockProject[] = [
switcherLabel: "Travel posters",
name: "City poster series",
aspect: "9:16",
- aspectLabel: "9:16 · Portrait",
- panelTab: "image",
- panelPrompt:
- "Hand-painted travel poster, PARIS — woman in a trench coat crossing the street, Eiffel Tower behind, café awnings, 'Live the romance' in red script",
- panelResults: [
- { src: `${ASSETS}/poster-paris.jpg`, label: "Paris", selected: true },
- { src: `${ASSETS}/poster-newyork.jpg`, label: "New York" },
- ],
+ panel: {
+ tab: "image",
+ prompt:
+ "Hand-painted travel poster, PARIS — woman in a trench coat crossing the street, Eiffel Tower behind, café awnings, 'Live the romance' in red script",
+ results: [
+ { src: `${ASSETS}/poster-paris.jpg`, label: "Paris", selected: true },
+ { src: `${ASSETS}/poster-newyork.jpg`, label: "New York" },
+ ],
+ },
videoSrc: `${ASSETS}/travel-loop.mp4`,
videoPoster: `${ASSETS}/poster-paris.jpg`,
previewCaption: "Live the romance",
@@ -124,15 +152,16 @@ export const MOCK_PROJECTS: MockProject[] = [
switcherLabel: "Railway mystery",
name: "The Railway Mystery",
aspect: "16:9",
- aspectLabel: "16:9 · Landscape",
- panelTab: "video",
- panelPrompt:
- "Franco-Belgian comic style, early-1900s animation with film grain: a steam train races a cliffside railway through a mountain canyon; a cloaked figure rides the carriage roof; a boy on a bicycle gives chase",
- panelResults: [
- { src: `${ASSETS}/chase-1.jpg`, label: "Canyon run", duration: "3.2s", selected: true },
- { src: `${ASSETS}/chase-2.jpg`, label: "On the roof", duration: "2.8s" },
- { src: `${ASSETS}/chase-3.jpg`, label: "Bicycle chase", duration: "4.0s" },
- ],
+ panel: {
+ tab: "video",
+ prompt:
+ "Franco-Belgian comic style, early-1900s animation with film grain: a steam train races a cliffside railway through a mountain canyon; a cloaked figure rides the carriage roof; a boy on a bicycle gives chase",
+ results: [
+ { src: `${ASSETS}/chase-1.jpg`, label: "Canyon run", duration: "3.2s", selected: true },
+ { src: `${ASSETS}/chase-2.jpg`, label: "On the roof", duration: "2.8s" },
+ { src: `${ASSETS}/chase-3.jpg`, label: "Bicycle chase", duration: "4.0s" },
+ ],
+ },
videoSrc: `${ASSETS}/railway-loop.mp4`,
videoPoster: `${ASSETS}/chase-1.jpg`,
previewCaption: "",