diff --git a/.gitignore b/.gitignore index c0e6322..03aee31 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,5 @@ src/lib/paraglide # AI Debug Logs logs/ -.vscode/chrome/ \ No newline at end of file +.vscode/chrome/ +demo.json diff --git a/src/lib/ai/models.ts b/src/lib/ai/models.ts index 6676364..76f866d 100644 --- a/src/lib/ai/models.ts +++ b/src/lib/ai/models.ts @@ -37,20 +37,32 @@ export const AI_MODELS = { input: 0.3, output: 1.2 } - } + }, // // Kimi K2.5 - Excellent for creative tasks, long context - // 'moonshotai/kimi-k2.5': { - // id: 'moonshotai/kimi-k2.5', - // name: 'Kimi K2.5', - // provider: 'Moonshot AI', - // description: 'Excellent for creative and complex tasks with 128K context', - // recommended: true, - // costTier: 'low', - // pricing: { - // input: 0.5, - // output: 2.8 - // } - // } + 'moonshotai/kimi-k2.5': { + id: 'moonshotai/kimi-k2.5', + name: 'Kimi K2.5', + provider: 'Moonshot AI', + description: 'Excellent for creative and complex tasks with 128K context', + recommended: true, + costTier: 'low', + pricing: { + input: 0.5, + output: 2.8 + } + }, + 'x-ai/grok-4.1-fast': { + id: 'x-ai/grok-4.1-fast', + name: 'Grok 4.1 Fast', + provider: 'X AI', + description: 'Excellent for creative and complex tasks with 128K context', + recommended: true, + costTier: 'low', + pricing: { + input: 0.2, + output: 0.5 + } + } // // Claude 4.5 Sonnet - Great reasoning and creativity // 'anthropic/claude-sonnet-4.5': { @@ -98,7 +110,7 @@ export type ModelId = keyof typeof AI_MODELS; /** * Default model to use */ -export const DEFAULT_MODEL_ID: ModelId = 'minimax/minimax-m2.5'; +export const DEFAULT_MODEL_ID: ModelId = 'x-ai/grok-4.1-fast'; /** * Get model by ID with fallback to default diff --git a/src/lib/ai/mutations.ts b/src/lib/ai/mutations.ts index b48a04d..223e03e 100644 --- a/src/lib/ai/mutations.ts +++ b/src/lib/ai/mutations.ts @@ -35,6 +35,7 @@ import type { RemoveKeyframeOutput } from './schemas'; import type { Layer, ProjectData } from '$lib/schemas/animation'; +import { defaultLayerStyle, defaultTransform } from '$lib/schemas/base'; /** * Context for resolving layer IDs (e.g. "layer_0" -> "actual-uuid") @@ -436,13 +437,8 @@ export function mutateGroupLayers( id: groupId, name: input.name ?? 'Group', type: 'group' as const, - transform: { - position: { x: 0, y: 0, z: 0 }, - rotation: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1 }, - anchor: 'center' as const - }, - style: { opacity: 1 }, + transform: defaultTransform(), + style: defaultLayerStyle(), visible: true, locked: false, keyframes: [], diff --git a/src/lib/components/editor/panels/add-layer.svelte b/src/lib/components/editor/panels/add-layer.svelte index 0cbc288..7fb6289 100644 --- a/src/lib/components/editor/panels/add-layer.svelte +++ b/src/lib/components/editor/panels/add-layer.svelte @@ -10,18 +10,14 @@ import type { LayerCategory } from '$lib/layers/base'; import { SvelteMap } from 'svelte/reactivity'; import type { Component } from 'svelte'; + import { defaultTransform } from '$lib/schemas/base'; const editorState = $derived(getEditorState()); const projectStore = $derived(editorState.project); function addLayer(type: LiteralUnion) { const layer = createLayer(type, { - transform: { - position: { x: 0, y: 0, z: 0 }, - rotation: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1 }, - anchor: 'center' - }, + transform: defaultTransform(), projectDimensions: { width: projectStore.state.width, height: projectStore.state.height diff --git a/src/lib/components/editor/panels/input-property.svelte b/src/lib/components/editor/panels/input-property.svelte index 52ba6d2..5252381 100644 --- a/src/lib/components/editor/panels/input-property.svelte +++ b/src/lib/components/editor/panels/input-property.svelte @@ -16,12 +16,15 @@ metadata, value, layer, - onUpdateProp + onUpdateProp, + targetPath = 'props' }: { metadata: PropertyMetadata; value: unknown; layer: TypedLayer; onUpdateProp: (prop: string, value: unknown) => void; + /** The path prefix for the property (e.g., 'props' or 'style') */ + targetPath?: 'transform' | 'props' | 'style'; } = $props(); @@ -66,7 +69,7 @@ /> {:else if metadata.meta?.widget === 'textarea'}