feat: full studio build -- light theme, canvas thumbnails, i18n (fa/en)

This commit is contained in:
Soroush.Asadi
2026-05-24 17:37:21 +03:30
parent d962483359
commit c61f587767
295 changed files with 29797 additions and 265 deletions
+56
View File
@@ -0,0 +1,56 @@
import { z } from "zod";
export const layerSchema = z.object({
id: z.string(),
type: z.enum(["text", "image", "video", "shape"]),
x: z.number(),
y: z.number(),
width: z.number(),
height: z.number(),
rotation: z.number(),
opacity: z.number(),
zIndex: z.number(),
props: z.record(z.string(), z.unknown()),
});
export const sceneSchema = z.object({
id: z.string(),
name: z.string(),
duration: z.number().positive(),
layers: z.array(layerSchema),
thumbnailUrl: z.string().optional(),
});
export const renderSettingsSchema = z.object({
resolution: z.enum(["720p", "1080p", "4K"]),
format: z.literal("mp4").default("mp4"),
fps: z.union([z.literal(24), z.literal(30), z.literal(60)]),
});
export const renderRequestSchema = z.object({
projectId: z.string().min(1),
scenes: z.array(sceneSchema).min(1),
settings: renderSettingsSchema,
});
export type RenderRequest = z.infer<typeof renderRequestSchema>;
export type RenderSettings = z.infer<typeof renderSettingsSchema>;
export type RenderScene = z.infer<typeof sceneSchema>;
export const renderStatusSchema = z.enum([
"queued",
"processing",
"completed",
"failed",
]);
export type RenderJobStatus = z.infer<typeof renderStatusSchema>;
export const RESOLUTION_DIMENSIONS: Record<
RenderSettings["resolution"],
{ width: number; height: number }
> = {
"720p": { width: 1280, height: 720 },
"1080p": { width: 1920, height: 1080 },
"4K": { width: 3840, height: 2160 },
};