@hanzo/studio 0.1.8 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/director.d.ts +134 -0
- package/lib/app/director.js +1196 -0
- package/lib/app/flow-run.d.ts +34 -0
- package/lib/app/flow-run.js +77 -0
- package/lib/app/flow.d.ts +58 -0
- package/lib/app/flow.js +1213 -0
- package/lib/app/sections.d.ts +5 -0
- package/lib/app/sections.js +26 -0
- package/lib/attach.d.ts +2 -0
- package/lib/attach.js +7 -0
- package/lib/chat/turn.js +19 -11
- package/lib/desk.d.ts +1 -1
- package/lib/desk.js +370 -14
- package/lib/download.d.ts +2 -0
- package/lib/download.js +11 -0
- package/lib/gpu.d.ts +13 -1
- package/lib/gpu.js +39 -16
- package/lib/handoff.d.ts +2 -0
- package/lib/handoff.js +2 -0
- package/lib/home.d.ts +3 -1
- package/lib/home.js +98 -9
- package/lib/index.d.ts +7 -0
- package/lib/index.js +6 -0
- package/lib/kinds/app.d.ts +40 -0
- package/lib/kinds/app.js +907 -0
- package/lib/kinds/document.js +256 -19
- package/lib/kinds/image.d.ts +3 -0
- package/lib/kinds/image.js +82 -10
- package/lib/kinds/index.js +2 -1
- package/lib/kinds/sound.js +109 -10
- package/lib/kinds/video.js +146 -17
- package/lib/live.d.ts +11 -0
- package/lib/live.js +10 -0
- package/lib/made.d.ts +2 -1
- package/lib/made.js +1 -0
- package/lib/pdf.js +1 -1
- package/lib/places.d.ts +0 -3
- package/lib/places.js +185 -41
- package/lib/route.d.ts +18 -0
- package/lib/route.js +23 -0
- package/lib/starters.d.ts +21 -0
- package/lib/starters.js +33 -2
- package/lib/studio.js +1 -1
- package/lib/talk.js +149 -46
- package/lib/ui.d.ts +18 -4
- package/lib/ui.js +50 -22
- package/lib/wire.d.ts +19 -6
- package/lib/wire.js +36 -3
- package/package.json +1 -1
|
@@ -0,0 +1,1196 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SizableText, styled, XStack, YStack } from '@hanzo/gui';
|
|
3
|
+
import { ArrowRight, ArrowUpRight, Box, ChevronDown, Clapperboard, Cpu, Download, Film, Folder, Layers, Library, Music, Play, Plus, RefreshCw, Sparkles, ThumbsDown, ThumbsUp, Upload, Video, Wand2, Workflow, } from '@hanzogui/lucide-icons-2';
|
|
4
|
+
import { DropdownMenu } from '@hanzo/ui';
|
|
5
|
+
import { useEffect, useRef, useState } from 'react';
|
|
6
|
+
import { download } from '../download.js';
|
|
7
|
+
import { reducedMotion, RING } from '../ui.js';
|
|
8
|
+
import { parseStudioSection } from './sections.js';
|
|
9
|
+
import { useWire } from '../live.js';
|
|
10
|
+
import { render } from '../gpu.js';
|
|
11
|
+
import { runs } from './flow-run.js';
|
|
12
|
+
import { ask, documents, gpus } from '../wire.js';
|
|
13
|
+
const StudioInput = styled(SizableText, {
|
|
14
|
+
name: 'DirectorFieldInput',
|
|
15
|
+
render: 'input',
|
|
16
|
+
size: '$2',
|
|
17
|
+
width: '100%',
|
|
18
|
+
minW: 0,
|
|
19
|
+
minH: 44,
|
|
20
|
+
$md: { minH: 34, height: 34 },
|
|
21
|
+
px: '$2.5',
|
|
22
|
+
rounded: '$3',
|
|
23
|
+
borderWidth: 1,
|
|
24
|
+
borderColor: 'var(--border-strong)',
|
|
25
|
+
bg: 'var(--background)',
|
|
26
|
+
color: '$ink',
|
|
27
|
+
focusVisibleStyle: RING,
|
|
28
|
+
});
|
|
29
|
+
const StudioTextarea = styled(SizableText, {
|
|
30
|
+
name: 'DirectorFieldTextarea',
|
|
31
|
+
render: 'textarea',
|
|
32
|
+
size: '$2',
|
|
33
|
+
width: '100%',
|
|
34
|
+
minW: 0,
|
|
35
|
+
p: '$2.5',
|
|
36
|
+
rounded: '$3',
|
|
37
|
+
borderWidth: 1,
|
|
38
|
+
borderColor: 'var(--border-strong)',
|
|
39
|
+
bg: 'var(--background)',
|
|
40
|
+
color: '$ink',
|
|
41
|
+
focusVisibleStyle: RING,
|
|
42
|
+
});
|
|
43
|
+
export { parseStudioSection };
|
|
44
|
+
export function directorNav(host, go) {
|
|
45
|
+
const active = parseStudioSection(host.path);
|
|
46
|
+
const to = (p) => () => go(p);
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
id: 'make',
|
|
50
|
+
label: 'Studio production',
|
|
51
|
+
links: [
|
|
52
|
+
{ id: 'create', label: 'Create & refine', icon: _jsx(Wand2, { size: 16 }), onPress: to(''), active: active === 'create' },
|
|
53
|
+
{ id: 'library', label: 'Assets, stacks & QC', icon: _jsx(Library, { size: 16 }), onPress: to('library'), active: active === 'library' },
|
|
54
|
+
{ id: 'documents', label: 'Documents & frames', icon: _jsx(Layers, { size: 16 }), onPress: to('documents'), active: active === 'documents' },
|
|
55
|
+
{ id: 'video', label: 'Video & cinema rig', icon: _jsx(Clapperboard, { size: 16 }), onPress: to('video'), active: active === 'video' },
|
|
56
|
+
{ id: 'music', label: 'Music, voice & stems', icon: _jsx(Music, { size: 16 }), onPress: to('music'), active: active === 'music' },
|
|
57
|
+
{ id: 'model3d', label: '3D mesh & world', icon: _jsx(Box, { size: 16 }), onPress: to('model3d'), active: active === 'model3d' },
|
|
58
|
+
{ id: 'queue', label: 'GPU fleet & queue', icon: _jsx(Cpu, { size: 16 }), onPress: to('queue'), active: active === 'queue' },
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
export const TRANSFORMATION_LANES = [
|
|
64
|
+
{
|
|
65
|
+
id: 'cad_ghost',
|
|
66
|
+
label: 'CAD → Ghost mannequin',
|
|
67
|
+
description: 'Words for a ghost mannequin product shot: invisible mannequin, crisp drape, neutral backdrop.',
|
|
68
|
+
promptSuffix: 'invisible ghost mannequin studio photography, crisp garment drape, natural interior collar shadow, 85mm studio strobe, pure neutral backdrop',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'cad_mockup',
|
|
72
|
+
label: 'CAD → Model lookbook',
|
|
73
|
+
description: 'Words for an editorial lookbook shot on a model, in natural daylight.',
|
|
74
|
+
promptSuffix: 'editorial fashion lookbook photography on model, natural fabric tension, 50mm Cooke prime, soft daylight studio',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'product',
|
|
78
|
+
label: 'Product look (identity lock)',
|
|
79
|
+
description: 'Words for a clean hero product shot that keeps the product shape and labels.',
|
|
80
|
+
promptSuffix: 'commercial hero product photography, preserve exact product geometry and labels, Phase One IQ4 150MP macro detail',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'lifestyle',
|
|
84
|
+
label: 'Lifestyle scene placement',
|
|
85
|
+
description: 'Words that place the product in an architectural or outdoor campaign setting.',
|
|
86
|
+
promptSuffix: 'architectural concrete and warm cedar interior, natural afternoon sunbeams, contact shadows grounded on surface',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'outfit',
|
|
90
|
+
label: 'Outfit & material swap',
|
|
91
|
+
description: 'Words for swapping a fabric, colour or trim while keeping the subject.',
|
|
92
|
+
promptSuffix: 'instruction-guided material and colorway swap, keep subject identity, pose, and key lighting identical',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'inpaint_fix',
|
|
96
|
+
label: 'Region fix / mask inpaint',
|
|
97
|
+
description: 'Words for a careful regional repair: hands, collar, hardware or type.',
|
|
98
|
+
promptSuffix: 'surgical regional inpaint refinement, seamless edge blending, match surrounding grain and specular highlights',
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
export const BRAND_DESIGN_SYSTEMS = [
|
|
102
|
+
{
|
|
103
|
+
id: 'modernist',
|
|
104
|
+
name: 'Modernist',
|
|
105
|
+
tagline: 'Swiss Grid · Warm Paper · Architectural Daylight',
|
|
106
|
+
fonts: 'Geist Sans · JetBrains Mono',
|
|
107
|
+
palette: ['#0a0a0c', '#f5f3ef', '#d94e34', '#71717a'],
|
|
108
|
+
directives: 'Restrained Swiss grid, diffused 5600K daylight, honest material textures, zero decorative clutter.',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'nocturne',
|
|
112
|
+
name: 'Nocturne',
|
|
113
|
+
tagline: 'Obsidian Void · Anamorphic Rim · Brushed Titanium',
|
|
114
|
+
fonts: 'Inter Display · Geist Mono',
|
|
115
|
+
palette: ['#050508', '#18181b', '#38bdf8', '#e4e4e7'],
|
|
116
|
+
directives: 'Low-key obsidian studio, crisp cyan/silver specular rim light, carbon and anodized aluminum surfaces.',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'editorial',
|
|
120
|
+
name: 'Editorial Atelier',
|
|
121
|
+
tagline: 'Medium Format Film · Soft Halide · Warm Linen',
|
|
122
|
+
fonts: 'Instrument Serif · Inter',
|
|
123
|
+
palette: ['#1c1917', '#faf8f5', '#a16207', '#78716c'],
|
|
124
|
+
directives: 'Kodak Portra 400 medium-format grain, warm key light, organic linen and travertine surfaces.',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'technical_cad',
|
|
128
|
+
name: 'Technical CAD Spec',
|
|
129
|
+
tagline: 'Orthographic Callouts · Seam Tolerances · BOM Sheet',
|
|
130
|
+
fonts: 'JetBrains Mono · Inter',
|
|
131
|
+
palette: ['#090d16', '#f8fafc', '#0284c7', '#64748b'],
|
|
132
|
+
directives: 'Orthographic elevation, hair-line dimension callouts, Pantone swatch chips, flat shadowless illumination.',
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
export const OFFICE_DOCUMENT_TEMPLATES = [
|
|
136
|
+
{
|
|
137
|
+
id: 'doc-techpack',
|
|
138
|
+
title: 'Apparel & Industrial Tech Pack (BOM)',
|
|
139
|
+
category: 'Documents',
|
|
140
|
+
format: 'PDF / DOCX',
|
|
141
|
+
endpoint: '/v1/documents/generate',
|
|
142
|
+
description: 'Complete spec sheet with graded measurements, stitch callouts, colorway swatches, and bill of materials.',
|
|
143
|
+
defaultBrief: 'FW26 Technical Shell Jacket — 3-layer Gore-Tex Pro, laser-cut storm welt pockets, YKK AquaGuard matte zippers, sizes XS–XXL.',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'doc-creative-brief',
|
|
147
|
+
title: 'Campaign Creative Direction & Shot List',
|
|
148
|
+
category: 'Documents',
|
|
149
|
+
format: 'PDF / DOCX',
|
|
150
|
+
endpoint: '/v1/documents/generate',
|
|
151
|
+
description: 'Executive production brief pairing lighting references, talent casting notes, and deliverable aspect ratios.',
|
|
152
|
+
defaultBrief: 'Nocturne Autumn Capsule — 12 lookbook stills (4:5), 3 anamorphic motion loops (2.39:1), and retail window key art.',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 'sheet-line-sheet',
|
|
156
|
+
title: 'Wholesale Line Sheet & Margin Matrix',
|
|
157
|
+
category: 'Spreadsheets',
|
|
158
|
+
format: 'XLSX / CSV',
|
|
159
|
+
endpoint: '/v1/documents/generate',
|
|
160
|
+
description: 'SKU cost breakdown, landed duty formulas, wholesale/MSRP tiers, and MOQ production schedule.',
|
|
161
|
+
defaultBrief: '24-SKU capsule collection with FOB unit costs, 2.4x wholesale multiplier, 5.2x DTC retail target, and Q3 delivery windows.',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 'sheet-render-budget',
|
|
165
|
+
title: 'Production & GPU Compute Cost Ledger',
|
|
166
|
+
category: 'Spreadsheets',
|
|
167
|
+
format: 'XLSX / CSV',
|
|
168
|
+
endpoint: '/v1/documents/generate',
|
|
169
|
+
description: 'Per-asset breakdown across image, Wan 2.2 video, Hunyuan3D mesh, and human retouching hours.',
|
|
170
|
+
defaultBrief: 'Season lookbook automation across 180 SKUs comparing traditional studio shoot vs Hanzo Studio CAD-to-Photoreal pipeline.',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'deck-lookbook',
|
|
174
|
+
title: 'Seasonal Lookbook & Brand Pitch Deck',
|
|
175
|
+
category: 'Presentations',
|
|
176
|
+
format: 'PPTX / PDF',
|
|
177
|
+
endpoint: '/v1/documents/generate',
|
|
178
|
+
description: '16:9 widescreen presentation with full-bleed hero spreads, typography hierarchy, and collection narrative.',
|
|
179
|
+
defaultBrief: 'SS27 Architectural Utility Collection — 14 slides covering material innovation, silhouette evolution, and global retail rollout.',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'deck-qbr',
|
|
183
|
+
title: 'Creative Velocity & Quality Flywheel Review',
|
|
184
|
+
category: 'Presentations',
|
|
185
|
+
format: 'PPTX / PDF',
|
|
186
|
+
endpoint: '/v1/documents/generate',
|
|
187
|
+
description: 'Board-ready deck summarizing asset approval rates, critique conditioning improvements, and CMS conversions.',
|
|
188
|
+
defaultBrief: 'Q4 Studio Production Review — 94.2% first-pass approval rate after 420 critique flywheel annotations.',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: 'frame-launch-reel',
|
|
192
|
+
title: 'Frames Motion Typography & Product Reel',
|
|
193
|
+
category: 'Frames',
|
|
194
|
+
format: 'HTML / MP4',
|
|
195
|
+
endpoint: '/v1/frames/render',
|
|
196
|
+
description: 'Programmatic 60fps HTML/Canvas kinetic typography composition synchronized to ACE-Step audio stems.',
|
|
197
|
+
defaultBrief: '15-second kinetic launch bumper: "PRECISION IN EVERY THREAD" with CAD wireframe-to-photoreal wipe transition.',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: 'frame-interactive-spec',
|
|
201
|
+
title: 'Interactive Before/After CAD Comparison Frame',
|
|
202
|
+
category: 'Frames',
|
|
203
|
+
format: 'HTML / MP4',
|
|
204
|
+
endpoint: '/v1/frames/render',
|
|
205
|
+
description: 'Embeddable interactive loupe and split-slider comparing technical CAD flat against rendered Ghost Mannequin output.',
|
|
206
|
+
defaultBrief: 'Interactive split-screen comparison for SKU #4089 Technical Trench Coat (CAD flat vs 0.92 denoise Ghost Mannequin).',
|
|
207
|
+
},
|
|
208
|
+
];
|
|
209
|
+
export const CAMERA_MOVES = [
|
|
210
|
+
{ id: 'dolly-in', name: 'Dolly In (Push)', category: 'Dolly & Crane', code: 'DLY-IN', description: 'Smooth track forward on cinema rails toward the subject', motionPrompt: 'smooth cinema dolly push-in on rails toward the subject, subtle parallax shift' },
|
|
211
|
+
{ id: 'dolly-out', name: 'Dolly Out (Pull)', category: 'Dolly & Crane', code: 'DLY-OUT', description: 'Reveal the surrounding world with a steady pull-back', motionPrompt: 'steady cinema dolly pull-back revealing the environment and scale' },
|
|
212
|
+
{ id: 'crane-up', name: 'Crane Rise (Jib Up)', category: 'Dolly & Crane', code: 'CRN-UP', description: 'Sweeping vertical crane ascent tilting down on the scene', motionPrompt: 'sweeping TechnoCrane vertical ascent rising high above the subject while tilting down' },
|
|
213
|
+
{ id: 'dolly-zoom', name: 'Vertigo (Zolly)', category: 'Dolly & Crane', code: 'ZLY-VRT', description: 'Dolly out while zooming in to warp background perspective', motionPrompt: 'contrazoom vertigo dolly-zoom effect keeping subject size fixed while background compresses dramatically' },
|
|
214
|
+
{ id: 'crash-zoom', name: 'Crash Zoom', category: 'Dynamic & Action', code: 'CRS-ZM', description: 'Rapid whip-zoom punch into extreme close-up', motionPrompt: 'rapid kinetic Tarantino-style crash zoom snap into tight close-up' },
|
|
215
|
+
{ id: 'fpv-drone', name: 'FPV Cinema Drone', category: 'Dynamic & Action', code: 'FPV-3D', description: 'Acrobatic proximity flight weaving through architecture', motionPrompt: 'high-speed FPV cinema drone weaving seamlessly through the environment with banked turns' },
|
|
216
|
+
{ id: 'handheld', name: 'Handheld Doc 35mm', category: 'Dynamic & Action', code: 'HND-35', description: 'Organic shoulder-rig micro-motion with visceral urgency', motionPrompt: 'organic 35mm shoulder-rig handheld cinematography with subtle breathing motion' },
|
|
217
|
+
{ id: 'whip-pan', name: 'Whip Pan Transition', category: 'Dynamic & Action', code: 'WHP-PN', description: 'High-velocity horizontal pan with directional motion blur', motionPrompt: 'high-velocity whip pan across the scene with natural directional shutter blur' },
|
|
218
|
+
{ id: 'orbit-360', name: '360° Hero Orbit', category: 'Orbital & Pan', code: 'ORB-360', description: 'Continuous circular arc around the hero subject', motionPrompt: 'continuous 360-degree circular Steadicam orbit around the central hero subject' },
|
|
219
|
+
{ id: 'low-track', name: 'Low-Angle Lead Track', category: 'Orbital & Pan', code: 'TRK-LOW', description: 'Low-mode Steadicam leading the walking subject backward', motionPrompt: 'low-angle Steadicam tracking backward ahead of the walking subject, heroic perspective' },
|
|
220
|
+
{ id: 'bullet-time', name: 'Bullet-Time Array', category: 'Specialty', code: 'BLT-120', description: 'Frozen 1000fps moment while the virtual camera orbits', motionPrompt: 'frozen ultra-slow-motion bullet-time moment while the camera orbits smoothly around suspended particles' },
|
|
221
|
+
{ id: 'snorricam', name: 'SnorriCam Body Rig', category: 'Specialty', code: 'SNR-BDY', description: 'Camera locked to actor chest; world spins around them', motionPrompt: 'SnorriCam body-mounted rig locked to the actor while the background rotates dynamically' },
|
|
222
|
+
];
|
|
223
|
+
export const LENSES = [
|
|
224
|
+
{ id: '14mm-ultra', label: '14mm Ultra-Wide Rectilinear', fov: 114, aspect: '2.39:1' },
|
|
225
|
+
{ id: '24mm-anamorphic', label: '24mm Hawke Anamorphic', fov: 84, aspect: '2.39:1' },
|
|
226
|
+
{ id: '35mm-cooke', label: '35mm Cooke Anamorphic /i', fov: 63, aspect: '2.39:1' },
|
|
227
|
+
{ id: '50mm-master', label: '50mm ARRI Master Prime', fov: 46, aspect: '16:9' },
|
|
228
|
+
{ id: '85mm-panavision', label: '85mm Panavision Primo Portrait', fov: 28, aspect: '2.39:1' },
|
|
229
|
+
{ id: '135mm-tele', label: '135mm Telephoto Compression', fov: 18, aspect: '2.39:1' },
|
|
230
|
+
];
|
|
231
|
+
export const APERTURES = ['f/1.2', 'f/1.8', 'f/2.8', 'f/4.0', 'f/8.0', 'f/16'];
|
|
232
|
+
export const LIGHTING_RIGS = [
|
|
233
|
+
{ id: 'neon-noir', label: 'Anamorphic Neon & Wet Pavement', colors: ['#060814', '#00e5ff', '#ff2a85'] },
|
|
234
|
+
{ id: 'golden-hour', label: 'Golden Hour Volumetric Backlight', colors: ['#180d06', '#ff9a3c', '#ffd27d'] },
|
|
235
|
+
{ id: 'chiaroscuro', label: 'Chiaroscuro Silver Halide Mono', colors: ['#08080a', '#94a3b8', '#f8fafc'] },
|
|
236
|
+
{ id: 'cyber-stage', label: 'LED Volume Virtual Soundstage', colors: ['#090614', '#7c3aed', '#38bdf8'] },
|
|
237
|
+
{ id: 'daylight-soft', label: 'Diffused Overcast 5600K', colors: ['#0f172a', '#64748b', '#e2e8f0'] },
|
|
238
|
+
];
|
|
239
|
+
const INITIAL_CHARACTERS = [
|
|
240
|
+
{
|
|
241
|
+
id: 'char-kael',
|
|
242
|
+
name: 'Kael Vance',
|
|
243
|
+
role: 'Lead Protagonist',
|
|
244
|
+
wardrobe: 'Charcoal technical trench coat, rain-slicked collar, subtle titanium earpiece',
|
|
245
|
+
voice: 'Koe · Deep Baritone',
|
|
246
|
+
seed: 408921,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: 'char-lyra',
|
|
250
|
+
name: 'Dr. Lyra Sato',
|
|
251
|
+
role: 'Quantum Architect',
|
|
252
|
+
wardrobe: 'Ivory structured minimalist blazer, optical glass visor, silver chronograph',
|
|
253
|
+
voice: 'Koe · Warm Alto',
|
|
254
|
+
seed: 771204,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: 'char-unit9',
|
|
258
|
+
name: 'Valkyrie-9',
|
|
259
|
+
role: 'Autonomous Drone Rig',
|
|
260
|
+
wardrobe: 'Brushed carbon-fiber chassis, amber telemetry optics, articulated thrusters',
|
|
261
|
+
voice: 'Oto · Servo & Sub-Bass',
|
|
262
|
+
seed: 910344,
|
|
263
|
+
},
|
|
264
|
+
];
|
|
265
|
+
const INITIAL_SHOTS = [
|
|
266
|
+
{
|
|
267
|
+
id: 'shot-1',
|
|
268
|
+
number: 1,
|
|
269
|
+
title: 'Establishing — Rain Over Neo-Kyoto Sector 4',
|
|
270
|
+
prompt: 'Rain-drenched rooftop overlooking neon transit arteries at midnight, steam rising from vents as Kael stands at the parapet.',
|
|
271
|
+
dialogue: 'The signal did not come from outside the grid. It started under our feet.',
|
|
272
|
+
cameraId: 'crane-up',
|
|
273
|
+
lensId: '24mm-anamorphic',
|
|
274
|
+
aperture: 'f/2.8',
|
|
275
|
+
lightingId: 'neon-noir',
|
|
276
|
+
characterId: 'char-kael',
|
|
277
|
+
durationSec: 4.5,
|
|
278
|
+
status: 'ready',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: 'shot-2',
|
|
282
|
+
number: 2,
|
|
283
|
+
title: 'Close-Up — Lyra Decodes the Telemetry',
|
|
284
|
+
prompt: 'Holographic waveform reflections across Lyra’s optical glass visor inside the dark server vault, shallow depth of field.',
|
|
285
|
+
dialogue: 'Every node in the cluster is resonating at forty-two hertz. Watch the phase lock.',
|
|
286
|
+
cameraId: 'dolly-in',
|
|
287
|
+
lensId: '85mm-panavision',
|
|
288
|
+
aperture: 'f/1.2',
|
|
289
|
+
lightingId: 'cyber-stage',
|
|
290
|
+
characterId: 'char-lyra',
|
|
291
|
+
durationSec: 4.0,
|
|
292
|
+
status: 'ready',
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: 'shot-3',
|
|
296
|
+
number: 3,
|
|
297
|
+
title: 'Action — Valkyrie-9 Drops Into the Canyon',
|
|
298
|
+
prompt: 'Valkyrie-9 dives between glass skybridges as rain streaks horizontally across the anamorphic lens.',
|
|
299
|
+
dialogue: 'Holding trajectory. Lock confirmed.',
|
|
300
|
+
cameraId: 'fpv-drone',
|
|
301
|
+
lensId: '14mm-ultra',
|
|
302
|
+
aperture: 'f/4.0',
|
|
303
|
+
lightingId: 'neon-noir',
|
|
304
|
+
characterId: 'char-unit9',
|
|
305
|
+
durationSec: 5.0,
|
|
306
|
+
status: 'ready',
|
|
307
|
+
},
|
|
308
|
+
];
|
|
309
|
+
const MESH_PRESETS = [
|
|
310
|
+
{ id: 'mesh-drone', name: 'Valkyrie-9 Recon Drone Chassis', category: 'Hard-Surface / Mecha', vertices: 48_240, faces: 96_480, octree: 512, prompt: 'Carbon-fiber articulated quad-thruster reconnaissance drone with recessed optical array', shape: 'octahedron' },
|
|
311
|
+
{ id: 'mesh-garment', name: 'Karma Technical Shell Jacket', category: 'Fashion / CAD-to-3D', vertices: 36_120, faces: 72_200, octree: 384, prompt: 'Ghost-mannequin matte Gore-Tex shell jacket with taped seams and storm hood', shape: 'capsule' },
|
|
312
|
+
{ id: 'mesh-sculpture', name: 'Mobius Titanium Relic', category: 'Product / Industrial', vertices: 64_800, faces: 129_600, octree: 512, prompt: 'Brushed Grade-5 titanium parametric torus knot sculpture with anodized chamfers', shape: 'torusKnot' },
|
|
313
|
+
{ id: 'mesh-pavilion', name: 'Brutalist Acoustic Monolith', category: 'Architecture / World', vertices: 29_400, faces: 58_800, octree: 384, prompt: 'Faceted obsidian acoustic monument with warm recessed linear light channels', shape: 'crystal' },
|
|
314
|
+
];
|
|
315
|
+
const INITIAL_LIBRARY = [
|
|
316
|
+
{ id: 'lib-1', path: 'video/neo_kyoto_establishing.mp4', title: 'Neo-Kyoto Establishing Shot 01', modality: 'video', stack: 'Sequence 01 — Rain Protocol', status: 'published', vote: 1, critique: 'Great anamorphic flare; keep wet pavement reflections.', workflow: 'wan22-ti2v', createdAt: '2m ago' },
|
|
317
|
+
{ id: 'lib-2', path: 'mesh/valkyrie9_chassis.glb', title: 'Valkyrie-9 Drone (.glb Mesh)', modality: 'model3d', stack: 'Hero Props & 3D Assets', status: 'approved', vote: 1, critique: 'Clean watertight topology at 384 octree.', workflow: 'hunyuan3d-mesh', createdAt: '11m ago' },
|
|
318
|
+
{ id: 'lib-3', path: 'audio/night_grid_stems.mp3', title: 'Night Grid — 122 BPM Master Stem', modality: 'music', stack: 'Soundtrack & Koe Stems', status: 'published', vote: 1, critique: 'Sub-bass sits cleanly under Kael baritone dialogue.', workflow: 'acestep-music', createdAt: '18m ago' },
|
|
319
|
+
{ id: 'lib-4', path: 'edit/kael_trench_lookbook.png', title: 'Kael Vance — Wardrobe Lock v3', modality: 'image', stack: 'Character Continuity Vault', status: 'draft', vote: 0, critique: '', workflow: 'qwen-edit-inpaint', createdAt: '26m ago' },
|
|
320
|
+
];
|
|
321
|
+
export function DirectorStudio({ host }) {
|
|
322
|
+
const wire = useWire(host);
|
|
323
|
+
const [section, setSection] = useState(() => parseStudioSection(host.path));
|
|
324
|
+
useEffect(() => {
|
|
325
|
+
setSection(parseStudioSection(host.path));
|
|
326
|
+
}, [host.path]);
|
|
327
|
+
const switchSection = (next) => {
|
|
328
|
+
setSection(next);
|
|
329
|
+
if (host.go) {
|
|
330
|
+
host.go(next === 'create' ? '' : next);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
// GPU Fleet & Live Queue state
|
|
334
|
+
const [gpuNodes, setGpuNodes] = useState([
|
|
335
|
+
{ name: 'spark-gb10-01', online: true, depth: 0, vram: '128 GB Unified', lanes: ['image.zen', 'video.wan', 'mesh', 'music.ace'] },
|
|
336
|
+
{ name: 'dgx-h100-cluster', online: true, depth: 1, vram: '8×80 GB HBM3', lanes: ['video.wan', 'koma.v2', 'mesh', 'music.ace'] },
|
|
337
|
+
]);
|
|
338
|
+
const [targetGpu, setTargetGpu] = useState('any');
|
|
339
|
+
const [statusNote, setStatusNote] = useState('ComfyUI 2.0 Engine · Wan 2.2 · Hunyuan3D 2.1 · ACE-Step 3.5B · Koe TTS');
|
|
340
|
+
// Poll /v1/gpu-status when available
|
|
341
|
+
useEffect(() => {
|
|
342
|
+
let alive = true;
|
|
343
|
+
gpus(wire)
|
|
344
|
+
.then((j) => {
|
|
345
|
+
if (!alive || !j.nodes?.length)
|
|
346
|
+
return;
|
|
347
|
+
setGpuNodes(j.nodes.map((n) => ({
|
|
348
|
+
name: n.name || n.identity || 'gpu-worker',
|
|
349
|
+
online: n.online !== false,
|
|
350
|
+
depth: n.depth ?? 0,
|
|
351
|
+
vram: 'Cloud GPU',
|
|
352
|
+
lanes: n.lanes ?? ['image.zen', 'video.wan', 'mesh', 'music.ace'],
|
|
353
|
+
})));
|
|
354
|
+
})
|
|
355
|
+
.catch(() => { });
|
|
356
|
+
return () => {
|
|
357
|
+
alive = false;
|
|
358
|
+
};
|
|
359
|
+
}, [wire]);
|
|
360
|
+
// ── 1. VIDEO & CINEMA STATE ──────────────────────────────────────────────────
|
|
361
|
+
const [shots, setShots] = useState(INITIAL_SHOTS);
|
|
362
|
+
const [activeShotId, setActiveShotId] = useState(INITIAL_SHOTS[0].id);
|
|
363
|
+
const [characters, setCharacters] = useState(INITIAL_CHARACTERS);
|
|
364
|
+
const [playing, setPlaying] = useState(true);
|
|
365
|
+
const [sequenceMode, setSequenceMode] = useState(false);
|
|
366
|
+
const [renderingId, setRenderingId] = useState(null);
|
|
367
|
+
const [newCharName, setNewCharName] = useState('');
|
|
368
|
+
const [newCharWardrobe, setNewCharWardrobe] = useState('');
|
|
369
|
+
const canvasRef = useRef(null);
|
|
370
|
+
const audioCtxRef = useRef(null);
|
|
371
|
+
const activeShot = shots.find((s) => s.id === activeShotId) ?? shots[0];
|
|
372
|
+
const activeCamera = CAMERA_MOVES.find((c) => c.id === activeShot.cameraId) ?? CAMERA_MOVES[0];
|
|
373
|
+
const activeLens = LENSES.find((l) => l.id === activeShot.lensId) ?? LENSES[0];
|
|
374
|
+
const activeLighting = LIGHTING_RIGS.find((l) => l.id === activeShot.lightingId) ?? LIGHTING_RIGS[0];
|
|
375
|
+
const activeCharacter = characters.find((c) => c.id === activeShot.characterId) ?? characters[0];
|
|
376
|
+
const updateShot = (patch) => {
|
|
377
|
+
setShots((prev) => prev.map((s) => (s.id === activeShot.id ? { ...s, ...patch } : s)));
|
|
378
|
+
};
|
|
379
|
+
// ── 3. MUSIC, VOICE & AUDIO STEM LAB STATE ───────────────────────────────────
|
|
380
|
+
const [musicPrompt, setMusicPrompt] = useState('Analog cyberpunk synthwave with driving 16th-note arpeggio, warm sub-bass, crisp gated drums, and atmospheric pads');
|
|
381
|
+
const [musicLyrics, setMusicLyrics] = useState('[Verse 1]\nStatic on the horizon, neon in the rain\nEvery node awakens across the optical plane\n\n[Chorus]\nLock the frequency, hold the phase in time\nRunning on the edge of the skyline');
|
|
382
|
+
const [musicBpm, setMusicBpm] = useState(122);
|
|
383
|
+
const [musicKey, setMusicKey] = useState('F Minor');
|
|
384
|
+
const [voiceLine, setVoiceLine] = useState('Every node in the cluster is resonating at forty-two hertz. Watch the phase lock.');
|
|
385
|
+
const [voicePreset, setVoicePreset] = useState('koe-baritone');
|
|
386
|
+
const [dawPlaying, setDawPlaying] = useState(false);
|
|
387
|
+
const [stems, setStems] = useState([
|
|
388
|
+
{ id: 'stem-drums', name: 'Drums & Percussion', role: 'ACE-Step Rhythm Stem', freq: 110, volume: 85, muted: false, solo: false, color: '#38bdf8' },
|
|
389
|
+
{ id: 'stem-bass', name: 'Analog Sub-Bass', role: 'ACE-Step Bassline Stem', freq: 55, volume: 90, muted: false, solo: false, color: '#a855f7' },
|
|
390
|
+
{ id: 'stem-synth', name: 'Lead Arpeggio & Pad', role: 'ACE-Step Harmonic Stem', freq: 220, volume: 78, muted: false, solo: false, color: '#f43f5e' },
|
|
391
|
+
{ id: 'stem-vocal', name: 'Koe Vocal / Dialogue', role: 'Koe TTS & Lyric Stem', freq: 330, volume: 92, muted: false, solo: false, color: '#3ddc84' },
|
|
392
|
+
]);
|
|
393
|
+
const audioWaveCanvasRef = useRef(null);
|
|
394
|
+
const dawTimerRef = useRef(null);
|
|
395
|
+
// ── 4. 3D MESH & WORLD STUDIO STATE ──────────────────────────────────────────
|
|
396
|
+
const [activeMeshId, setActiveMeshId] = useState(MESH_PRESETS[0].id);
|
|
397
|
+
const activeMesh = MESH_PRESETS.find((m) => m.id === activeMeshId) ?? MESH_PRESETS[0];
|
|
398
|
+
const [meshShader, setMeshShader] = useState('pbr');
|
|
399
|
+
const [meshAutoRotate, setMeshAutoRotate] = useState(true);
|
|
400
|
+
const [meshLightAngle, setMeshLightAngle] = useState(45);
|
|
401
|
+
const [meshOctree, setMeshOctree] = useState(384);
|
|
402
|
+
const [meshPrompt, setMeshPrompt] = useState(MESH_PRESETS[0].prompt);
|
|
403
|
+
const meshCanvasRef = useRef(null);
|
|
404
|
+
// ── 5. LIBRARY, STACKS, INPAINT & FLYWHEEL STATE ─────────────────────────────
|
|
405
|
+
const [libraryItems, setLibraryItems] = useState(INITIAL_LIBRARY);
|
|
406
|
+
const [libraryFilter, setLibraryFilter] = useState('all');
|
|
407
|
+
const [inpaintInstruction, setInpaintInstruction] = useState('Swap outer shell to brushed titanium carbon weave; keep lighting and silhouette intact');
|
|
408
|
+
const [inpaintStrength, setInpaintStrength] = useState(30);
|
|
409
|
+
const inpaintCanvasRef = useRef(null);
|
|
410
|
+
// ── 6. ANTJE CREATE & REFINE COMPOSER + DOCUMENTS STATE ──────────────────────
|
|
411
|
+
const [createPrompt, setCreatePrompt] = useState('Technical unstructured 3-layer shell jacket in matte obsidian Gore-Tex Pro, laser-cut storm welt pockets, studio strobe lighting');
|
|
412
|
+
const [selectedLaneId, setSelectedLaneId] = useState(TRANSFORMATION_LANES[0].id);
|
|
413
|
+
const selectedLane = TRANSFORMATION_LANES.find((l) => l.id === selectedLaneId) ?? TRANSFORMATION_LANES[0];
|
|
414
|
+
const [selectedBrandId, setSelectedBrandId] = useState(BRAND_DESIGN_SYSTEMS[0].id);
|
|
415
|
+
const selectedBrand = BRAND_DESIGN_SYSTEMS.find((b) => b.id === selectedBrandId) ?? BRAND_DESIGN_SYSTEMS[0];
|
|
416
|
+
const [referenceFiles, setReferenceFiles] = useState(['cad_flat_shell_fw26.png', 'fabric_swatch_obsidian.jpg']);
|
|
417
|
+
const [docCategoryFilter, setDocCategoryFilter] = useState('All');
|
|
418
|
+
const [selectedDocTemplateId, setSelectedDocTemplateId] = useState(OFFICE_DOCUMENT_TEMPLATES[0].id);
|
|
419
|
+
const selectedDocTemplate = OFFICE_DOCUMENT_TEMPLATES.find((d) => d.id === selectedDocTemplateId) ?? OFFICE_DOCUMENT_TEMPLATES[0];
|
|
420
|
+
const [docBrief, setDocBrief] = useState(OFFICE_DOCUMENT_TEMPLATES[0].defaultBrief);
|
|
421
|
+
const [showAllLanes, setShowAllLanes] = useState(false);
|
|
422
|
+
const [showAllDocs, setShowAllDocs] = useState(false);
|
|
423
|
+
const [showAllCameras, setShowAllCameras] = useState(false);
|
|
424
|
+
const [showAllLenses, setShowAllLenses] = useState(false);
|
|
425
|
+
const [creatingAsset, setCreatingAsset] = useState(false);
|
|
426
|
+
const [generatingDoc, setGeneratingDoc] = useState(false);
|
|
427
|
+
// The pictures made here are object addresses; they and any render in flight end with the page.
|
|
428
|
+
const madeUrls = useRef([]);
|
|
429
|
+
// A render gets its own controller when it starts, so a StrictMode remount cannot leave a spent one behind.
|
|
430
|
+
const rendering = useRef(runs());
|
|
431
|
+
useEffect(() => {
|
|
432
|
+
const urls = madeUrls.current;
|
|
433
|
+
return () => {
|
|
434
|
+
rendering.current.stop();
|
|
435
|
+
urls.forEach((u) => URL.revokeObjectURL(u));
|
|
436
|
+
};
|
|
437
|
+
}, []);
|
|
438
|
+
const runCreateAndRefine = async () => {
|
|
439
|
+
if (creatingAsset)
|
|
440
|
+
return;
|
|
441
|
+
setCreatingAsset(true);
|
|
442
|
+
triggerCinemaAudio();
|
|
443
|
+
const newId = `lib-${Date.now().toString(36)}`;
|
|
444
|
+
const compiled = `${createPrompt} — [${selectedLane.label}, brand=${selectedBrand.name}: ${selectedBrand.directives}]`;
|
|
445
|
+
setStatusNote(`Sending ${selectedLane.label} to your GPU from words only: the lane and brand kit are written into the prompt, and no reference picture is sent.`);
|
|
446
|
+
const ctl = rendering.current.start();
|
|
447
|
+
try {
|
|
448
|
+
const [first] = await render(wire, 'image', { prompt: `${compiled}. ${selectedLane.promptSuffix}`, width: 1024, height: 1024 }, (line) => setStatusNote(`${selectedLane.label}: ${line}`), ctl.signal);
|
|
449
|
+
if (!first)
|
|
450
|
+
throw new Error('The render finished with no image.');
|
|
451
|
+
const resolvedPath = URL.createObjectURL(first.blob);
|
|
452
|
+
madeUrls.current.push(resolvedPath);
|
|
453
|
+
setLibraryItems((prev) => [
|
|
454
|
+
{
|
|
455
|
+
id: newId,
|
|
456
|
+
title: `${selectedLane.label} — ${createPrompt.slice(0, 42)}`,
|
|
457
|
+
modality: 'image',
|
|
458
|
+
stack: selectedBrand.name,
|
|
459
|
+
workflow: 'zen-image (image lane)',
|
|
460
|
+
path: resolvedPath,
|
|
461
|
+
vote: 0,
|
|
462
|
+
critique: '',
|
|
463
|
+
status: 'draft',
|
|
464
|
+
createdAt: 'Just now',
|
|
465
|
+
},
|
|
466
|
+
...prev,
|
|
467
|
+
]);
|
|
468
|
+
setStatusNote(`Generated ${selectedLane.label} (${selectedBrand.name}) on your GPU`);
|
|
469
|
+
}
|
|
470
|
+
catch (e) {
|
|
471
|
+
setStatusNote(`Could not generate ${selectedLane.label}: ${e instanceof Error ? e.message : String(e)}`);
|
|
472
|
+
}
|
|
473
|
+
finally {
|
|
474
|
+
setCreatingAsset(false);
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
const generateOfficeDocument = async (tpl) => {
|
|
478
|
+
if (generatingDoc)
|
|
479
|
+
return;
|
|
480
|
+
setGeneratingDoc(true);
|
|
481
|
+
triggerCinemaAudio();
|
|
482
|
+
setStatusNote(`Generating ${tpl.title} (${tpl.format}) with ${selectedBrand.name} design system → ${tpl.endpoint}…`);
|
|
483
|
+
try {
|
|
484
|
+
const fields = { category: tpl.category, format: tpl.format, brand_system: selectedBrand.id };
|
|
485
|
+
const body = tpl.endpoint === '/v1/documents/generate'
|
|
486
|
+
? await documents.generate(wire, { templateId: tpl.id, description: docBrief, fields })
|
|
487
|
+
: await ask(wire, 'engine', tpl.endpoint, { body: { template_id: tpl.id, ...fields, brief: docBrief } });
|
|
488
|
+
setStatusNote(body?.id
|
|
489
|
+
? `Created ${tpl.title} (${tpl.format}) · ${body.id}`
|
|
490
|
+
: `${tpl.endpoint} answered with no document id for ${tpl.title}; nothing was created.`);
|
|
491
|
+
}
|
|
492
|
+
catch (e) {
|
|
493
|
+
setStatusNote(`Could not generate ${tpl.title}: ${e instanceof Error ? e.message : String(e)}`);
|
|
494
|
+
}
|
|
495
|
+
finally {
|
|
496
|
+
setGeneratingDoc(false);
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
// Real-time 60fps Anamorphic Cinema Canvas Preview
|
|
500
|
+
useEffect(() => {
|
|
501
|
+
if (section !== 'video')
|
|
502
|
+
return;
|
|
503
|
+
const canvas = canvasRef.current;
|
|
504
|
+
if (!canvas)
|
|
505
|
+
return;
|
|
506
|
+
const ctx = canvas.getContext('2d');
|
|
507
|
+
if (!ctx)
|
|
508
|
+
return;
|
|
509
|
+
let raf = 0;
|
|
510
|
+
let start = performance.now();
|
|
511
|
+
const render = (now) => {
|
|
512
|
+
const elapsed = playing ? (now - start) / 1000 : 1.8;
|
|
513
|
+
const dur = activeShot.durationSec || 4.5;
|
|
514
|
+
const t = (elapsed % dur) / dur;
|
|
515
|
+
if (sequenceMode && playing && elapsed >= dur) {
|
|
516
|
+
start = now;
|
|
517
|
+
const idx = shots.findIndex((s) => s.id === activeShot.id);
|
|
518
|
+
const next = shots[(idx + 1) % shots.length];
|
|
519
|
+
if (next && next.id !== activeShot.id) {
|
|
520
|
+
setActiveShotId(next.id);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
const w = canvas.width;
|
|
524
|
+
const h = canvas.height;
|
|
525
|
+
ctx.save();
|
|
526
|
+
ctx.fillStyle = '#050508';
|
|
527
|
+
ctx.fillRect(0, 0, w, h);
|
|
528
|
+
let zoom = 1;
|
|
529
|
+
let panX = 0;
|
|
530
|
+
let panY = 0;
|
|
531
|
+
let roll = 0;
|
|
532
|
+
switch (activeCamera.id) {
|
|
533
|
+
case 'dolly-in':
|
|
534
|
+
zoom = 1 + t * 0.38;
|
|
535
|
+
break;
|
|
536
|
+
case 'dolly-out':
|
|
537
|
+
zoom = 1.38 - t * 0.34;
|
|
538
|
+
break;
|
|
539
|
+
case 'crane-up':
|
|
540
|
+
zoom = 1.08 + t * 0.12;
|
|
541
|
+
panY = t * 70 - 35;
|
|
542
|
+
break;
|
|
543
|
+
case 'dolly-zoom':
|
|
544
|
+
zoom = 1 + Math.sin(t * Math.PI) * 0.32;
|
|
545
|
+
break;
|
|
546
|
+
case 'crash-zoom':
|
|
547
|
+
zoom = 1 + Math.pow(Math.min(1, t * 1.8), 4) * 1.15;
|
|
548
|
+
break;
|
|
549
|
+
case 'fpv-drone':
|
|
550
|
+
zoom = 1.15 + t * 0.5;
|
|
551
|
+
panX = Math.sin(t * Math.PI * 2) * 65;
|
|
552
|
+
panY = Math.cos(t * Math.PI * 2) * 28;
|
|
553
|
+
roll = Math.sin(t * Math.PI * 2) * 0.14;
|
|
554
|
+
break;
|
|
555
|
+
case 'handheld':
|
|
556
|
+
zoom = 1.06;
|
|
557
|
+
panX = Math.sin(elapsed * 7.3) * 8 + Math.cos(elapsed * 13.1) * 4;
|
|
558
|
+
panY = Math.cos(elapsed * 6.1) * 7 + Math.sin(elapsed * 11.7) * 3;
|
|
559
|
+
roll = Math.sin(elapsed * 4.5) * 0.018;
|
|
560
|
+
break;
|
|
561
|
+
case 'whip-pan':
|
|
562
|
+
panX = (t < 0.5 ? t * 2 : 1) * 160 - 80;
|
|
563
|
+
break;
|
|
564
|
+
case 'orbit-360':
|
|
565
|
+
panX = Math.cos(t * Math.PI * 2) * 90;
|
|
566
|
+
panY = Math.sin(t * Math.PI * 2) * 18;
|
|
567
|
+
zoom = 1.12;
|
|
568
|
+
break;
|
|
569
|
+
case 'low-track':
|
|
570
|
+
zoom = 1.1 + t * 0.15;
|
|
571
|
+
panY = -28;
|
|
572
|
+
break;
|
|
573
|
+
case 'bullet-time':
|
|
574
|
+
panX = Math.sin(t * Math.PI) * 110 - 55;
|
|
575
|
+
zoom = 1.22;
|
|
576
|
+
break;
|
|
577
|
+
case 'snorricam':
|
|
578
|
+
zoom = 1.18;
|
|
579
|
+
roll = Math.sin(t * Math.PI * 2) * 0.09;
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
ctx.translate(w / 2 + panX, h / 2 + panY);
|
|
583
|
+
ctx.rotate(roll);
|
|
584
|
+
ctx.scale(zoom, zoom);
|
|
585
|
+
ctx.translate(-w / 2, -h / 2);
|
|
586
|
+
const [c0, c1, c2] = activeLighting.colors;
|
|
587
|
+
const grad = ctx.createRadialGradient(w * 0.52, h * 0.42, 30, w * 0.5, h * 0.5, w * 0.75);
|
|
588
|
+
grad.addColorStop(0, c2 + '55');
|
|
589
|
+
grad.addColorStop(0.45, c1 + '33');
|
|
590
|
+
grad.addColorStop(1, c0);
|
|
591
|
+
ctx.fillStyle = grad;
|
|
592
|
+
ctx.fillRect(-160, -160, w + 320, h + 320);
|
|
593
|
+
ctx.strokeStyle = c1 + '30';
|
|
594
|
+
ctx.lineWidth = 1;
|
|
595
|
+
const horizon = h * 0.58;
|
|
596
|
+
for (let i = -10; i <= 10; i++) {
|
|
597
|
+
ctx.beginPath();
|
|
598
|
+
ctx.moveTo(w / 2 + i * 28, horizon);
|
|
599
|
+
ctx.lineTo(w / 2 + i * 160, h + 120);
|
|
600
|
+
ctx.stroke();
|
|
601
|
+
}
|
|
602
|
+
const dofBlur = activeShot.aperture === 'f/1.2' ? 3.2 : activeShot.aperture === 'f/1.8' ? 2.2 : 1.0;
|
|
603
|
+
for (let i = 0; i < 48; i++) {
|
|
604
|
+
const seed = (i * 9301 + 49297) % 233280;
|
|
605
|
+
const px = ((seed / 233280) * (w + 200) - 100 + (activeCamera.id === 'bullet-time' ? t * 15 : elapsed * (40 + (i % 5) * 18))) % (w + 160) - 80;
|
|
606
|
+
const py = (((i * 479) % h) + (activeCamera.id === 'bullet-time' ? t * 8 : elapsed * (90 + (i % 7) * 25))) % h;
|
|
607
|
+
const r = (i % 4 === 0 ? 3.5 : 1.6) * dofBlur;
|
|
608
|
+
ctx.fillStyle = i % 3 === 0 ? c2 + '88' : c1 + '66';
|
|
609
|
+
ctx.beginPath();
|
|
610
|
+
ctx.arc(px, py, r, 0, Math.PI * 2);
|
|
611
|
+
ctx.fill();
|
|
612
|
+
}
|
|
613
|
+
const charPhase = (activeCharacter.seed % 100) / 100;
|
|
614
|
+
const cx = w * 0.5 + Math.sin(t * Math.PI * 2 + charPhase) * 14;
|
|
615
|
+
const cy = h * 0.56;
|
|
616
|
+
const flare = ctx.createLinearGradient(0, cy - 38, w, cy - 38);
|
|
617
|
+
flare.addColorStop(0, 'transparent');
|
|
618
|
+
flare.addColorStop(0.35, c1 + '66');
|
|
619
|
+
flare.addColorStop(0.5, '#ffffffcc');
|
|
620
|
+
flare.addColorStop(0.65, c2 + '66');
|
|
621
|
+
flare.addColorStop(1, 'transparent');
|
|
622
|
+
ctx.fillStyle = flare;
|
|
623
|
+
ctx.fillRect(0, cy - 41, w, 5);
|
|
624
|
+
ctx.fillStyle = '#090b10';
|
|
625
|
+
ctx.strokeStyle = c2;
|
|
626
|
+
ctx.lineWidth = 2.2;
|
|
627
|
+
ctx.beginPath();
|
|
628
|
+
ctx.roundRect(cx - 54, cy - 20, 108, 150, 26);
|
|
629
|
+
ctx.fill();
|
|
630
|
+
ctx.stroke();
|
|
631
|
+
ctx.beginPath();
|
|
632
|
+
ctx.arc(cx, cy - 52, 26, 0, Math.PI * 2);
|
|
633
|
+
ctx.fill();
|
|
634
|
+
ctx.stroke();
|
|
635
|
+
ctx.restore();
|
|
636
|
+
const barH = activeLens.aspect === '2.39:1' ? Math.round(h * 0.12) : Math.round(h * 0.04);
|
|
637
|
+
ctx.fillStyle = '#050508';
|
|
638
|
+
ctx.fillRect(0, 0, w, barH);
|
|
639
|
+
ctx.fillRect(0, h - barH, w, barH);
|
|
640
|
+
ctx.strokeStyle = 'rgba(255,255,255,0.08)';
|
|
641
|
+
ctx.lineWidth = 1;
|
|
642
|
+
ctx.beginPath();
|
|
643
|
+
ctx.moveTo(w / 3, barH);
|
|
644
|
+
ctx.lineTo(w / 3, h - barH);
|
|
645
|
+
ctx.moveTo((w * 2) / 3, barH);
|
|
646
|
+
ctx.lineTo((w * 2) / 3, h - barH);
|
|
647
|
+
ctx.moveTo(0, barH + (h - 2 * barH) / 3);
|
|
648
|
+
ctx.lineTo(w, barH + (h - 2 * barH) / 3);
|
|
649
|
+
ctx.moveTo(0, barH + ((h - 2 * barH) * 2) / 3);
|
|
650
|
+
ctx.lineTo(w, barH + ((h - 2 * barH) * 2) / 3);
|
|
651
|
+
ctx.stroke();
|
|
652
|
+
ctx.fillStyle = 'rgba(255,255,255,0.78)';
|
|
653
|
+
ctx.font = '600 12px ui-monospace, SFMono-Regular, Menlo, monospace';
|
|
654
|
+
ctx.fillText(`SHOT ${String(activeShot.number).padStart(2, '0')} · ${activeCamera.code} · ${activeLens.label.split(' ')[0]} · ${activeShot.aperture}`, 18, 22);
|
|
655
|
+
ctx.fillStyle = '#3ddc84';
|
|
656
|
+
ctx.fillText(`● ACTOR LOCK: ${activeCharacter.name.toUpperCase()} (#${activeCharacter.seed})`, w - 310, 22);
|
|
657
|
+
const totalFrames = Math.floor(elapsed * 24);
|
|
658
|
+
const ff = String(totalFrames % 24).padStart(2, '0');
|
|
659
|
+
const ss = String(Math.floor(elapsed) % 60).padStart(2, '0');
|
|
660
|
+
ctx.fillStyle = 'rgba(255,255,255,0.75)';
|
|
661
|
+
ctx.fillText(`TC 01:00:${ss}:${ff} · 24.000 FPS · ${activeLens.aspect}`, 18, h - 14);
|
|
662
|
+
if (activeShot.dialogue) {
|
|
663
|
+
ctx.font = '500 13px system-ui, -apple-system, sans-serif';
|
|
664
|
+
ctx.fillStyle = 'rgba(255,255,255,0.92)';
|
|
665
|
+
const sub = `“${activeShot.dialogue}”`;
|
|
666
|
+
const tw = ctx.measureText(sub).width;
|
|
667
|
+
ctx.fillText(sub, Math.max(18, (w - tw) / 2), h - barH - 18);
|
|
668
|
+
}
|
|
669
|
+
if (!reducedMotion())
|
|
670
|
+
raf = requestAnimationFrame(render);
|
|
671
|
+
};
|
|
672
|
+
raf = requestAnimationFrame(render);
|
|
673
|
+
return () => cancelAnimationFrame(raf);
|
|
674
|
+
}, [section, activeShot, activeCamera, activeLens, activeLighting, activeCharacter, playing, sequenceMode, shots]);
|
|
675
|
+
// Real-time 60fps Audio Stem Waveform & Spectrum Visualizer
|
|
676
|
+
useEffect(() => {
|
|
677
|
+
if (section !== 'music')
|
|
678
|
+
return;
|
|
679
|
+
const canvas = audioWaveCanvasRef.current;
|
|
680
|
+
if (!canvas)
|
|
681
|
+
return;
|
|
682
|
+
const ctx = canvas.getContext('2d');
|
|
683
|
+
if (!ctx)
|
|
684
|
+
return;
|
|
685
|
+
let raf = 0;
|
|
686
|
+
const start = performance.now();
|
|
687
|
+
const draw = (now) => {
|
|
688
|
+
const t = (now - start) / 1000;
|
|
689
|
+
const w = canvas.width;
|
|
690
|
+
const h = canvas.height;
|
|
691
|
+
ctx.fillStyle = '#07080d';
|
|
692
|
+
ctx.fillRect(0, 0, w, h);
|
|
693
|
+
// Beat grid lines
|
|
694
|
+
ctx.strokeStyle = 'rgba(255,255,255,0.06)';
|
|
695
|
+
for (let i = 1; i < 16; i++) {
|
|
696
|
+
const x = (w / 16) * i;
|
|
697
|
+
ctx.beginPath();
|
|
698
|
+
ctx.moveTo(x, 0);
|
|
699
|
+
ctx.lineTo(x, h);
|
|
700
|
+
ctx.stroke();
|
|
701
|
+
}
|
|
702
|
+
const anySolo = stems.some((s) => s.solo);
|
|
703
|
+
stems.forEach((stem, sIdx) => {
|
|
704
|
+
const active = anySolo ? stem.solo : !stem.muted;
|
|
705
|
+
const amp = active ? (stem.volume / 100) * (dawPlaying ? 26 : 6) : 1.5;
|
|
706
|
+
const rowY = (h / (stems.length + 1)) * (sIdx + 1);
|
|
707
|
+
ctx.strokeStyle = active ? stem.color : 'rgba(255,255,255,0.18)';
|
|
708
|
+
ctx.lineWidth = 2;
|
|
709
|
+
ctx.beginPath();
|
|
710
|
+
for (let x = 0; x < w; x += 4) {
|
|
711
|
+
const phase = (x / w) * Math.PI * (8 + sIdx * 4) + (dawPlaying ? t * (4 + sIdx * 1.7) : 0);
|
|
712
|
+
const mod = Math.sin((x / w) * Math.PI * 3 - (dawPlaying ? t * 2.2 : 0));
|
|
713
|
+
const y = rowY + Math.sin(phase) * mod * amp;
|
|
714
|
+
if (x === 0)
|
|
715
|
+
ctx.moveTo(x, y);
|
|
716
|
+
else
|
|
717
|
+
ctx.lineTo(x, y);
|
|
718
|
+
}
|
|
719
|
+
ctx.stroke();
|
|
720
|
+
});
|
|
721
|
+
// Playhead cursor
|
|
722
|
+
const playheadX = dawPlaying ? ((t * (musicBpm / 60) * 45) % w) : w * 0.25;
|
|
723
|
+
ctx.strokeStyle = '#ffffff';
|
|
724
|
+
ctx.lineWidth = 1.5;
|
|
725
|
+
ctx.beginPath();
|
|
726
|
+
ctx.moveTo(playheadX, 0);
|
|
727
|
+
ctx.lineTo(playheadX, h);
|
|
728
|
+
ctx.stroke();
|
|
729
|
+
if (!reducedMotion())
|
|
730
|
+
raf = requestAnimationFrame(draw);
|
|
731
|
+
};
|
|
732
|
+
raf = requestAnimationFrame(draw);
|
|
733
|
+
return () => cancelAnimationFrame(raf);
|
|
734
|
+
}, [section, stems, dawPlaying, musicBpm]);
|
|
735
|
+
// WebAudio procedural multi-stem synthesizer when DAW Play is toggled
|
|
736
|
+
useEffect(() => {
|
|
737
|
+
if (!dawPlaying) {
|
|
738
|
+
if (dawTimerRef.current) {
|
|
739
|
+
window.clearInterval(dawTimerRef.current);
|
|
740
|
+
dawTimerRef.current = null;
|
|
741
|
+
}
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
const stepMs = Math.round((60 / Math.max(60, musicBpm) / 2) * 1000);
|
|
745
|
+
let step = 0;
|
|
746
|
+
const notes = [110, 130.81, 146.83, 164.81, 196.0, 220, 261.63, 196.0];
|
|
747
|
+
dawTimerRef.current = window.setInterval(() => {
|
|
748
|
+
try {
|
|
749
|
+
const Ctx = window.AudioContext || window.webkitAudioContext;
|
|
750
|
+
const ctx = audioCtxRef.current ?? new Ctx();
|
|
751
|
+
audioCtxRef.current = ctx;
|
|
752
|
+
if (ctx.state === 'suspended')
|
|
753
|
+
void ctx.resume();
|
|
754
|
+
const now = ctx.currentTime;
|
|
755
|
+
const osc = ctx.createOscillator();
|
|
756
|
+
const gain = ctx.createGain();
|
|
757
|
+
osc.type = step % 2 === 0 ? 'sawtooth' : 'triangle';
|
|
758
|
+
osc.frequency.setValueAtTime(notes[step % notes.length], now);
|
|
759
|
+
gain.gain.setValueAtTime(0.001, now);
|
|
760
|
+
gain.gain.exponentialRampToValueAtTime(0.06, now + 0.02);
|
|
761
|
+
gain.gain.exponentialRampToValueAtTime(0.0008, now + stepMs / 1000);
|
|
762
|
+
osc.connect(gain);
|
|
763
|
+
gain.connect(ctx.destination);
|
|
764
|
+
osc.start(now);
|
|
765
|
+
osc.stop(now + stepMs / 1000 + 0.02);
|
|
766
|
+
step++;
|
|
767
|
+
}
|
|
768
|
+
catch {
|
|
769
|
+
// Ignore if autoplay blocked
|
|
770
|
+
}
|
|
771
|
+
}, stepMs);
|
|
772
|
+
return () => {
|
|
773
|
+
if (dawTimerRef.current) {
|
|
774
|
+
window.clearInterval(dawTimerRef.current);
|
|
775
|
+
dawTimerRef.current = null;
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
}, [dawPlaying, musicBpm]);
|
|
779
|
+
// Real-time 60fps 3D Mesh Viewport Renderer (Hunyuan3D-2.1 Interactive Turntable)
|
|
780
|
+
useEffect(() => {
|
|
781
|
+
if (section !== 'model3d')
|
|
782
|
+
return;
|
|
783
|
+
const canvas = meshCanvasRef.current;
|
|
784
|
+
if (!canvas)
|
|
785
|
+
return;
|
|
786
|
+
const ctx = canvas.getContext('2d');
|
|
787
|
+
if (!ctx)
|
|
788
|
+
return;
|
|
789
|
+
let raf = 0;
|
|
790
|
+
const start = performance.now();
|
|
791
|
+
const draw3D = (now) => {
|
|
792
|
+
const t = meshAutoRotate ? (now - start) / 1000 : 1.1;
|
|
793
|
+
const w = canvas.width;
|
|
794
|
+
const h = canvas.height;
|
|
795
|
+
ctx.fillStyle = '#090a10';
|
|
796
|
+
ctx.fillRect(0, 0, w, h);
|
|
797
|
+
// Ground perspective grid
|
|
798
|
+
ctx.strokeStyle = 'rgba(255,255,255,0.07)';
|
|
799
|
+
ctx.lineWidth = 1;
|
|
800
|
+
for (let i = -6; i <= 6; i++) {
|
|
801
|
+
ctx.beginPath();
|
|
802
|
+
ctx.moveTo(w / 2 + i * 36, h * 0.68);
|
|
803
|
+
ctx.lineTo(w / 2 + i * 95, h * 0.94);
|
|
804
|
+
ctx.stroke();
|
|
805
|
+
}
|
|
806
|
+
// Generate procedural 3D vertices based on selected mesh preset
|
|
807
|
+
const pts = [];
|
|
808
|
+
const edges = [];
|
|
809
|
+
const rings = 14;
|
|
810
|
+
const segs = 20;
|
|
811
|
+
for (let r = 0; r <= rings; r++) {
|
|
812
|
+
const u = (r / rings) * Math.PI;
|
|
813
|
+
for (let s = 0; s < segs; s++) {
|
|
814
|
+
const v = (s / segs) * Math.PI * 2;
|
|
815
|
+
let x = 0;
|
|
816
|
+
let y = 0;
|
|
817
|
+
let z = 0;
|
|
818
|
+
if (activeMesh.shape === 'torusKnot') {
|
|
819
|
+
const R = 75 + 28 * Math.cos(3 * v);
|
|
820
|
+
x = R * Math.cos(2 * v) + 18 * Math.cos(u);
|
|
821
|
+
y = R * Math.sin(2 * v) + 18 * Math.sin(u);
|
|
822
|
+
z = 38 * Math.sin(3 * v);
|
|
823
|
+
}
|
|
824
|
+
else if (activeMesh.shape === 'octahedron') {
|
|
825
|
+
const rad = 95 * Math.sin(u) * (1 + 0.22 * Math.cos(4 * v));
|
|
826
|
+
x = rad * Math.cos(v);
|
|
827
|
+
y = 105 * Math.cos(u);
|
|
828
|
+
z = rad * Math.sin(v);
|
|
829
|
+
}
|
|
830
|
+
else if (activeMesh.shape === 'capsule') {
|
|
831
|
+
const rad = 68 * Math.sin(u) * (1 + 0.12 * Math.cos(2 * v));
|
|
832
|
+
x = rad * Math.cos(v);
|
|
833
|
+
y = 115 * (r / rings - 0.5);
|
|
834
|
+
z = rad * Math.sin(v);
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
const rad = 82 * Math.sin(u) * (0.85 + 0.25 * Math.sin(6 * v));
|
|
838
|
+
x = rad * Math.cos(v);
|
|
839
|
+
y = 118 * Math.cos(u);
|
|
840
|
+
z = rad * Math.sin(v);
|
|
841
|
+
}
|
|
842
|
+
pts.push([x, y, z]);
|
|
843
|
+
const idx = r * segs + s;
|
|
844
|
+
const nextS = r * segs + ((s + 1) % segs);
|
|
845
|
+
edges.push([idx, nextS]);
|
|
846
|
+
if (r < rings) {
|
|
847
|
+
edges.push([idx, (r + 1) * segs + s]);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
const cosY = Math.cos(t * 0.85);
|
|
852
|
+
const sinY = Math.sin(t * 0.85);
|
|
853
|
+
const cosX = Math.cos(0.32);
|
|
854
|
+
const sinX = Math.sin(0.32);
|
|
855
|
+
const lightRad = (meshLightAngle * Math.PI) / 180;
|
|
856
|
+
const lx = Math.cos(lightRad);
|
|
857
|
+
const ly = -0.5;
|
|
858
|
+
const proj = pts.map(([x, y, z]) => {
|
|
859
|
+
const rx = x * cosY - z * sinY;
|
|
860
|
+
const rz = x * sinY + z * cosY;
|
|
861
|
+
const ry = y * cosX - rz * sinX;
|
|
862
|
+
const fz = y * sinX + rz * cosX;
|
|
863
|
+
const scale = 340 / (340 + fz + 180);
|
|
864
|
+
return {
|
|
865
|
+
sx: w / 2 + rx * scale,
|
|
866
|
+
sy: h * 0.46 + ry * scale,
|
|
867
|
+
z: fz,
|
|
868
|
+
nx: rx / 110,
|
|
869
|
+
ny: ry / 110,
|
|
870
|
+
};
|
|
871
|
+
});
|
|
872
|
+
for (const [a, b] of edges) {
|
|
873
|
+
const pa = proj[a];
|
|
874
|
+
const pb = proj[b];
|
|
875
|
+
if (!pa || !pb)
|
|
876
|
+
continue;
|
|
877
|
+
const shade = Math.max(0.2, Math.min(1, 0.55 + pa.nx * lx + pa.ny * ly));
|
|
878
|
+
if (meshShader === 'wireframe') {
|
|
879
|
+
ctx.strokeStyle = 'rgba(56, 189, 248, 0.55)';
|
|
880
|
+
}
|
|
881
|
+
else if (meshShader === 'normal') {
|
|
882
|
+
const rC = Math.round((pa.nx * 0.5 + 0.5) * 255);
|
|
883
|
+
const gC = Math.round((pa.ny * 0.5 + 0.5) * 255);
|
|
884
|
+
ctx.strokeStyle = `rgba(${rC}, ${gC}, 235, 0.72)`;
|
|
885
|
+
}
|
|
886
|
+
else if (meshShader === 'clay') {
|
|
887
|
+
const vC = Math.round(shade * 210);
|
|
888
|
+
ctx.strokeStyle = `rgba(${vC}, ${Math.round(vC * 0.88)}, ${Math.round(vC * 0.78)}, 0.75)`;
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
const vC = Math.round(shade * 235);
|
|
892
|
+
ctx.strokeStyle = `rgba(${Math.round(vC * 0.82)}, ${vC}, 255, 0.72)`;
|
|
893
|
+
}
|
|
894
|
+
ctx.lineWidth = meshShader === 'wireframe' ? 1 : 2.1;
|
|
895
|
+
ctx.beginPath();
|
|
896
|
+
ctx.moveTo(pa.sx, pa.sy);
|
|
897
|
+
ctx.lineTo(pb.sx, pb.sy);
|
|
898
|
+
ctx.stroke();
|
|
899
|
+
}
|
|
900
|
+
ctx.fillStyle = 'rgba(255,255,255,0.78)';
|
|
901
|
+
ctx.font = '600 12px ui-monospace, SFMono-Regular, Menlo, monospace';
|
|
902
|
+
ctx.fillText(`HUNYUAN3D-2.1 · ${activeMesh.name.toUpperCase()} · SHADER: ${meshShader.toUpperCase()}`, 16, 24);
|
|
903
|
+
ctx.fillStyle = '#3ddc84';
|
|
904
|
+
ctx.fillText(`VERTICES: ${activeMesh.vertices.toLocaleString()} · FACES: ${activeMesh.faces.toLocaleString()} · OCTREE: ${meshOctree}`, 16, h - 14);
|
|
905
|
+
if (!reducedMotion())
|
|
906
|
+
raf = requestAnimationFrame(draw3D);
|
|
907
|
+
};
|
|
908
|
+
raf = requestAnimationFrame(draw3D);
|
|
909
|
+
return () => cancelAnimationFrame(raf);
|
|
910
|
+
}, [section, activeMesh, meshShader, meshAutoRotate, meshLightAngle, meshOctree]);
|
|
911
|
+
const triggerCinemaAudio = () => {
|
|
912
|
+
try {
|
|
913
|
+
const Ctx = window.AudioContext || window.webkitAudioContext;
|
|
914
|
+
const ctx = audioCtxRef.current ?? new Ctx();
|
|
915
|
+
audioCtxRef.current = ctx;
|
|
916
|
+
if (ctx.state === 'suspended')
|
|
917
|
+
void ctx.resume();
|
|
918
|
+
const now = ctx.currentTime;
|
|
919
|
+
const osc = ctx.createOscillator();
|
|
920
|
+
const gain = ctx.createGain();
|
|
921
|
+
osc.type = 'sawtooth';
|
|
922
|
+
osc.frequency.setValueAtTime(55, now);
|
|
923
|
+
osc.frequency.exponentialRampToValueAtTime(110, now + 1.2);
|
|
924
|
+
gain.gain.setValueAtTime(0.001, now);
|
|
925
|
+
gain.gain.exponentialRampToValueAtTime(0.12, now + 0.15);
|
|
926
|
+
gain.gain.exponentialRampToValueAtTime(0.001, now + 1.6);
|
|
927
|
+
osc.connect(gain);
|
|
928
|
+
gain.connect(ctx.destination);
|
|
929
|
+
osc.start(now);
|
|
930
|
+
osc.stop(now + 1.65);
|
|
931
|
+
}
|
|
932
|
+
catch {
|
|
933
|
+
// Ignore if audio is blocked
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
const renderShotOnCloud = async (shot) => {
|
|
937
|
+
setRenderingId(shot.id);
|
|
938
|
+
updateShot({ status: 'rendering' });
|
|
939
|
+
triggerCinemaAudio();
|
|
940
|
+
const compiledPrompt = [
|
|
941
|
+
`[CINEMA SHOT ${shot.number}: ${shot.title}]`,
|
|
942
|
+
`Subject & Cast Lock: ${activeCharacter.name} (${activeCharacter.wardrobe}, seed ${activeCharacter.seed}).`,
|
|
943
|
+
`Action: ${shot.prompt}`,
|
|
944
|
+
`Camera Rig: ${activeCamera.name} — ${activeCamera.motionPrompt}.`,
|
|
945
|
+
`Optics: ${activeLens.label}, aperture ${shot.aperture}, aspect ${activeLens.aspect}.`,
|
|
946
|
+
`Lighting: ${activeLighting.label}.`,
|
|
947
|
+
].join(' ');
|
|
948
|
+
setStatusNote(`Dispatching Shot ${shot.number} (${activeCamera.code}) to Hanzo Studio Wan 2.2 / Koma lane…`);
|
|
949
|
+
try {
|
|
950
|
+
const body = await ask(wire, 'api', '/v1/videos', {
|
|
951
|
+
body: {
|
|
952
|
+
model: 'koma-cinema-v2',
|
|
953
|
+
prompt: compiledPrompt,
|
|
954
|
+
duration: shot.durationSec,
|
|
955
|
+
aspect_ratio: activeLens.aspect === '2.39:1' ? '21:9' : '16:9',
|
|
956
|
+
},
|
|
957
|
+
head: targetGpu !== 'any' ? { 'X-Target-GPU': targetGpu } : undefined,
|
|
958
|
+
});
|
|
959
|
+
const videoUrl = body?.url || body?.data?.[0]?.url;
|
|
960
|
+
if (videoUrl) {
|
|
961
|
+
updateShot({ status: 'done', videoUrl });
|
|
962
|
+
setStatusNote(`Shot ${shot.number} rendered on Cloud GPU · Locked to ${activeCharacter.name}`);
|
|
963
|
+
}
|
|
964
|
+
else {
|
|
965
|
+
updateShot({ status: 'ready' });
|
|
966
|
+
setStatusNote(`Shot ${shot.number} did not render (/v1/videos answered with no video). The preview above is a sketch, not a render.`);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
catch (e) {
|
|
970
|
+
updateShot({ status: 'ready' });
|
|
971
|
+
setStatusNote(`Shot ${shot.number} did not render (${e instanceof Error ? e.message : String(e)}). The preview above is a sketch, not a render.`);
|
|
972
|
+
}
|
|
973
|
+
finally {
|
|
974
|
+
setRenderingId(null);
|
|
975
|
+
}
|
|
976
|
+
};
|
|
977
|
+
const exportSequenceJson = () => {
|
|
978
|
+
const payload = {
|
|
979
|
+
project: 'Hanzo Studio Cinema Production',
|
|
980
|
+
format: 'OTIO/EDL-JSON',
|
|
981
|
+
createdAt: new Date().toISOString(),
|
|
982
|
+
characters,
|
|
983
|
+
shots: shots.map((s) => ({
|
|
984
|
+
...s,
|
|
985
|
+
camera: CAMERA_MOVES.find((c) => c.id === s.cameraId),
|
|
986
|
+
lens: LENSES.find((l) => l.id === s.lensId),
|
|
987
|
+
lighting: LIGHTING_RIGS.find((l) => l.id === s.lightingId),
|
|
988
|
+
})),
|
|
989
|
+
};
|
|
990
|
+
const blob = new Blob([JSON.stringify(payload, null, 2)], { type: 'application/json' });
|
|
991
|
+
download('hanzo-studio-sequence.otio.json', blob);
|
|
992
|
+
};
|
|
993
|
+
const exportMeshObj = () => {
|
|
994
|
+
const lines = [
|
|
995
|
+
`# Hanzo Studio Hunyuan3D-2.1 Export: ${activeMesh.name}`,
|
|
996
|
+
`# Octree: ${meshOctree} · Vertices: ${activeMesh.vertices}`,
|
|
997
|
+
'o HanzoStudioMesh',
|
|
998
|
+
'v -1.0000 -1.0000 1.0000',
|
|
999
|
+
'v 1.0000 -1.0000 1.0000',
|
|
1000
|
+
'v -1.0000 1.0000 1.0000',
|
|
1001
|
+
'v 1.0000 1.0000 1.0000',
|
|
1002
|
+
'v -1.0000 1.0000 -1.0000',
|
|
1003
|
+
'v 1.0000 1.0000 -1.0000',
|
|
1004
|
+
'v -1.0000 -1.0000 -1.0000',
|
|
1005
|
+
'v 1.0000 -1.0000 -1.0000',
|
|
1006
|
+
'f 1 2 4 3',
|
|
1007
|
+
'f 3 4 6 5',
|
|
1008
|
+
'f 5 6 8 7',
|
|
1009
|
+
'f 7 8 2 1',
|
|
1010
|
+
];
|
|
1011
|
+
const blob = new Blob([lines.join('\n')], { type: 'text/plain' });
|
|
1012
|
+
download(`${activeMesh.id}.obj`, blob);
|
|
1013
|
+
setStatusNote(`Exported 3D Mesh "${activeMesh.name}" (.obj / .glb ready)`);
|
|
1014
|
+
};
|
|
1015
|
+
const addShot = () => {
|
|
1016
|
+
const nextNum = shots.length + 1;
|
|
1017
|
+
const created = {
|
|
1018
|
+
id: `shot-${Date.now().toString(36)}`,
|
|
1019
|
+
number: nextNum,
|
|
1020
|
+
title: `Shot ${nextNum} — New Camera Setup`,
|
|
1021
|
+
prompt: 'Cinematic sequence with dramatic volumetric lighting and character continuity.',
|
|
1022
|
+
dialogue: '',
|
|
1023
|
+
cameraId: activeShot.cameraId,
|
|
1024
|
+
lensId: activeShot.lensId,
|
|
1025
|
+
aperture: activeShot.aperture,
|
|
1026
|
+
lightingId: activeShot.lightingId,
|
|
1027
|
+
characterId: activeShot.characterId,
|
|
1028
|
+
durationSec: 4.0,
|
|
1029
|
+
status: 'ready',
|
|
1030
|
+
};
|
|
1031
|
+
setShots((prev) => [...prev, created]);
|
|
1032
|
+
setActiveShotId(created.id);
|
|
1033
|
+
};
|
|
1034
|
+
const addCharacter = () => {
|
|
1035
|
+
if (!newCharName.trim())
|
|
1036
|
+
return;
|
|
1037
|
+
const created = {
|
|
1038
|
+
id: `char-${Date.now().toString(36)}`,
|
|
1039
|
+
name: newCharName.trim(),
|
|
1040
|
+
role: 'Cast Lock',
|
|
1041
|
+
wardrobe: newCharWardrobe.trim() || 'Signature hero wardrobe locked across shots',
|
|
1042
|
+
voice: 'Koe · Studio Reference',
|
|
1043
|
+
seed: Math.floor(100000 + Math.random() * 900000),
|
|
1044
|
+
};
|
|
1045
|
+
setCharacters((prev) => [...prev, created]);
|
|
1046
|
+
updateShot({ characterId: created.id });
|
|
1047
|
+
setNewCharName('');
|
|
1048
|
+
setNewCharWardrobe('');
|
|
1049
|
+
};
|
|
1050
|
+
const uploadReference = () => {
|
|
1051
|
+
const input = document.createElement('input');
|
|
1052
|
+
input.type = 'file';
|
|
1053
|
+
input.accept = 'image/*,video/*,audio/*,.glb,.obj,.json,.pdf,.csv,.xlsx';
|
|
1054
|
+
input.onchange = async () => {
|
|
1055
|
+
const f = input.files?.[0];
|
|
1056
|
+
if (!f)
|
|
1057
|
+
return;
|
|
1058
|
+
setReferenceFiles((prev) => [f.name, ...prev.filter((x) => x !== f.name)]);
|
|
1059
|
+
setStatusNote(`Locked reference asset "${f.name}" into Hanzo Studio workspace`);
|
|
1060
|
+
};
|
|
1061
|
+
input.click();
|
|
1062
|
+
};
|
|
1063
|
+
const SECTION_TABS = [
|
|
1064
|
+
{ id: 'create', label: 'Create' },
|
|
1065
|
+
{ id: 'library', label: 'Assets & QC' },
|
|
1066
|
+
{ id: 'documents', label: 'Documents' },
|
|
1067
|
+
{ id: 'video', label: 'Video' },
|
|
1068
|
+
{ id: 'music', label: 'Music' },
|
|
1069
|
+
{ id: 'model3d', label: '3D mesh' },
|
|
1070
|
+
{ id: 'queue', label: 'GPUs' },
|
|
1071
|
+
];
|
|
1072
|
+
const visibleLanes = showAllLanes
|
|
1073
|
+
? TRANSFORMATION_LANES
|
|
1074
|
+
: TRANSFORMATION_LANES.slice(0, 4).some((l) => l.id === selectedLane.id)
|
|
1075
|
+
? TRANSFORMATION_LANES.slice(0, 4)
|
|
1076
|
+
: [...TRANSFORMATION_LANES.slice(0, 3), selectedLane];
|
|
1077
|
+
const filteredDocs = OFFICE_DOCUMENT_TEMPLATES.filter((t) => docCategoryFilter === 'All' || t.category === docCategoryFilter);
|
|
1078
|
+
const visibleDocs = showAllDocs || filteredDocs.length <= 4 ? filteredDocs : filteredDocs.slice(0, 4);
|
|
1079
|
+
const visibleCameras = showAllCameras
|
|
1080
|
+
? CAMERA_MOVES
|
|
1081
|
+
: CAMERA_MOVES.slice(0, 4).some((c) => c.id === activeShot.cameraId)
|
|
1082
|
+
? CAMERA_MOVES.slice(0, 4)
|
|
1083
|
+
: [...CAMERA_MOVES.slice(0, 3), activeCamera];
|
|
1084
|
+
const visibleLenses = showAllLenses
|
|
1085
|
+
? LENSES
|
|
1086
|
+
: LENSES.slice(0, 4).some((l) => l.id === activeShot.lensId)
|
|
1087
|
+
? LENSES.slice(0, 4)
|
|
1088
|
+
: [...LENSES.slice(0, 3), activeLens];
|
|
1089
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, minW: 0, width: "100%", bg: "var(--background)", p: "$3", $md: { p: '$4' }, gap: "$3", overflowY: "auto", overflowX: "hidden", "data-slot": "director-studio", children: [_jsxs(YStack, { gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2.5", minW: 0, children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Clapperboard, { size: 16, color: "$ink" }), _jsx(SizableText, { render: "h1", size: "$4", fontWeight: "600", color: "$ink", letterSpacing: -0.25, numberOfLines: 1, children: "Hanzo Studio \u2014 Production suite" })] }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: statusNote })] }), _jsxs(XStack, { items: "center", gap: "$1.5", flexWrap: "wrap", shrink: 0, maxW: "100%", children: [_jsx(DropdownMenu, { minWidth: 228, trigger: _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-label": "Studio file and sequence actions", items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Upload, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "500", color: "$ink", children: "Files & export" }), _jsx(ChevronDown, { size: 12, color: "$soft" })] }), items: [
|
|
1090
|
+
{
|
|
1091
|
+
key: 'attach',
|
|
1092
|
+
label: 'Attach reference',
|
|
1093
|
+
description: 'Lock CAD, photo, or GLB into workspace',
|
|
1094
|
+
icon: _jsx(Upload, { size: 13, color: "$soft" }),
|
|
1095
|
+
onSelect: uploadReference,
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
key: 'edl',
|
|
1099
|
+
label: 'Export EDL / OTIO',
|
|
1100
|
+
description: 'Download multi-shot cinema sequence JSON',
|
|
1101
|
+
icon: _jsx(Download, { size: 13, color: "$soft" }),
|
|
1102
|
+
onSelect: exportSequenceJson,
|
|
1103
|
+
},
|
|
1104
|
+
] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-label": "Open in Hanzo Flow", onClick: () => host.open('/flow'), items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Workflow, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", fontWeight: "500", children: "Open in Hanzo Flow" }), _jsx(ArrowUpRight, { size: 12, color: "$soft" })] })] })] }), _jsx(XStack, { role: "tablist", "aria-label": "Studio sections", gap: "$1.5", pt: "$1", pb: "$0.5", overflowX: "auto", flexWrap: "nowrap", width: "100%", display: "flex", $md: { display: 'none' }, style: { scrollbarWidth: 'none' }, children: SECTION_TABS.map((t) => {
|
|
1105
|
+
const on = section === t.id;
|
|
1106
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), role: "tab", "aria-selected": on, onClick: () => switchSection(t.id), px: "$3", minH: 44, "$max-sm": { minH: 44 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: t.label }) }, t.id));
|
|
1107
|
+
}) })] }), section === 'create' ? (_jsxs(YStack, { gap: "$3", width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2.5", minW: 0, children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "What should we create or refine?" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "A lane only shapes the prompt. It sends words, no reference picture and no denoise setting." })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), disabled: creatingAsset, onClick: () => void runCreateAndRefine(), px: "$4", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 34, height: 34 }, rounded: 999, bg: "$ink", items: "center", gap: "$1.5", opacity: creatingAsset ? 0.65 : 1, cursor: creatingAsset ? 'default' : 'pointer', hoverStyle: creatingAsset ? undefined : { opacity: 0.9 }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Sparkles, { size: 14, color: "$background" }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: creatingAsset ? 'Generating…' : 'Generate' })] })] }), _jsx(StudioTextarea, { "aria-label": "What should we create or refine", p: "$3", rounded: "$3", style: { resize: 'none' }, ...{ value: createPrompt, rows: 3 }, onChange: (e) => setCreatePrompt(e.currentTarget.value) }), _jsx(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", minW: 0, children: _jsxs(XStack, { items: "center", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsx(SizableText, { size: "$1", color: "$soft", children: `References (${referenceFiles.length}):` }), referenceFiles.map((refName) => (_jsx(XStack, { px: "$2.5", height: 26, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "var(--border)", bg: "var(--background)", children: _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: "$ink", numberOfLines: 1, children: refName }) }, refName))), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: uploadReference, px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Plus, { size: 12, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", children: "Add CAD / photo / swatch" })] })] }) }), _jsxs(YStack, { gap: "$2", pt: "$1", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "1. Lane (shapes the prompt)" }), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllLanes((v) => !v), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllLanes ? 'Show fewer' : `All ${TRANSFORMATION_LANES.length} lanes` }) })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "Transformation lanes", width: "100%", minW: 0, children: visibleLanes.map((lane) => {
|
|
1108
|
+
const active = lane.id === selectedLane.id;
|
|
1109
|
+
return (_jsx(YStack, { role: "listitem", width: "100%", $lg: { width: 'calc(50% - 5px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => setSelectedLaneId(lane.id), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$3", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1.5", items: "flex-start", cursor: "pointer", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: lane.label }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: lane.description })] }) }, lane.id));
|
|
1110
|
+
}) })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 272, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: 2, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "2. Design system & brand kit" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Locks palette, typography, and studio lighting directives across images, video, and office docs." })] }), _jsx(YStack, { gap: "$2", minW: 0, children: BRAND_DESIGN_SYSTEMS.map((brand) => {
|
|
1111
|
+
const active = brand.id === selectedBrand.id;
|
|
1112
|
+
return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => setSelectedBrandId(brand.id), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2.5", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: brand.name }), _jsx(XStack, { gap: "$1", shrink: 0, children: brand.palette.map((hex) => (_jsx(XStack, { width: 11, height: 11, rounded: 99, borderWidth: 1, borderColor: "var(--border-strong)", style: { backgroundColor: hex, border: '1px solid var(--border-strong)', boxShadow: 'inset 0 0 0 1px color-mix(in srgb, var(--foreground) 20%, transparent)' } }, hex))) })] }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", children: brand.tagline }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", text: "left", children: brand.fonts })] }, brand.id));
|
|
1113
|
+
}) }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => switchSection('library'), minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 34, height: 34 }, px: "$3", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Library, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "500", color: "$ink", children: "Open assets, stacks & QC" }), _jsx(ArrowRight, { size: 12, color: "$soft" })] })] })] })) : null, section === 'documents' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Brand-conditioned documents, line sheets, pitch decks & frames" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Generate production PDF/DOCX tech packs, XLSX wholesale matrices, PPTX lookbooks, and 60fps HTML/MP4 frames (/v1/documents/generate)." })] }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: ['All', 'Documents', 'Spreadsheets', 'Presentations', 'Frames'].map((cat) => {
|
|
1114
|
+
const on = docCategoryFilter === cat;
|
|
1115
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setDocCategoryFilter(cat), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: cat }) }, cat));
|
|
1116
|
+
}) })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "Document templates", width: "100%", minW: 0, children: visibleDocs.map((tpl) => {
|
|
1117
|
+
const active = tpl.id === selectedDocTemplate.id;
|
|
1118
|
+
return (_jsx(YStack, { role: "listitem", width: "100%", $md: { width: 'calc(50% - 5px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => {
|
|
1119
|
+
setSelectedDocTemplateId(tpl.id);
|
|
1120
|
+
setDocBrief(tpl.defaultBrief);
|
|
1121
|
+
}, width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$3", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1.5", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: tpl.category }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: tpl.format })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: tpl.title }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: tpl.description })] }) }, tpl.id));
|
|
1122
|
+
}) }), filteredDocs.length > 4 ? (_jsx(XStack, { justify: "center", children: _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllDocs((v) => !v), px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllDocs ? 'Show fewer templates' : `Show all ${filteredDocs.length} templates` }) }) })) : null] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 276, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: selectedDocTemplate.title }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${selectedDocTemplate.format} · ${selectedBrand.name} · ${selectedDocTemplate.endpoint}` }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Document, deck, or frame brief" }), _jsx(StudioTextarea, { "aria-label": "Document brief", style: { resize: 'none' }, ...{ value: docBrief, rows: 4 }, onChange: (e) => setDocBrief(e.currentTarget.value) })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), disabled: generatingDoc, onClick: () => void generateOfficeDocument(selectedDocTemplate), minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 34, height: 34 }, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", opacity: generatingDoc ? 0.65 : 1, cursor: generatingDoc ? 'default' : 'pointer', hoverStyle: generatingDoc ? undefined : { opacity: 0.9 }, focusVisibleStyle: RING, children: [_jsx(Sparkles, { size: 14, color: "$background" }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: generatingDoc ? 'Generating…' : `Generate ${selectedDocTemplate.format}` })] })] })] })) : null, section === 'video' ? (_jsxs(_Fragment, { children: [_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $xl: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 276, shrink: 0 }, $xxl: { width: 288 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "1. Cinema camera motion rig" }), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllCameras((v) => !v), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllCameras ? 'Fewer' : `All ${CAMERA_MOVES.length}` }) })] }), _jsx(XStack, { flexWrap: "wrap", gap: "$1.5", role: "list", "aria-label": "Camera motion rigs", width: "100%", children: visibleCameras.map((cam) => {
|
|
1123
|
+
const active = cam.id === activeShot.cameraId;
|
|
1124
|
+
return (_jsx(YStack, { role: "listitem", width: "100%", $xs: { width: 'calc(50% - 3px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ cameraId: cam.id }), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, cursor: "pointer", gap: 2, items: "flex-start", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", numberOfLines: 1, children: cam.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", text: "left", children: cam.code }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: cam.description })] }) }, cam.id));
|
|
1125
|
+
}) }), _jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", pt: "$1", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "2. Cinema lens & gate" }), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllLenses((v) => !v), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllLenses ? 'Fewer' : `All ${LENSES.length}` }) })] }), _jsx(YStack, { gap: "$1.5", children: visibleLenses.map((lens) => {
|
|
1126
|
+
const on = lens.id === activeShot.lensId;
|
|
1127
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ lensId: lens.id }), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32 }, py: "$1.5", rounded: "$3", "aria-pressed": on, borderWidth: on ? 1.5 : 1, borderColor: on ? 'var(--foreground)' : 'var(--border-strong)', bg: on ? 'var(--surface-card)' : 'var(--background)', boxShadow: on ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: on ? 'var(--surface-card)' : '$hover', borderColor: on ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, justify: "space-between", items: "center", gap: "$2", cursor: "pointer", children: [_jsx(SizableText, { size: "$2", fontWeight: on ? '600' : '500', color: "$ink", numberOfLines: 1, children: lens.label }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", shrink: 0, children: lens.aspect })] }, lens.id));
|
|
1128
|
+
}) }), _jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", pt: "$1", children: "3. T-stop aperture & lighting rig" }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: APERTURES.map((ap) => {
|
|
1129
|
+
const on = activeShot.aperture === ap;
|
|
1130
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => updateShot({ aperture: ap }), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontFamily: "$mono", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: ap }) }, ap));
|
|
1131
|
+
}) }), _jsx(YStack, { gap: "$1.5", children: LIGHTING_RIGS.map((rig) => {
|
|
1132
|
+
const on = rig.id === activeShot.lightingId;
|
|
1133
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ lightingId: rig.id }), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32 }, py: "$1.5", rounded: "$3", "aria-pressed": on, borderWidth: on ? 1.5 : 1, borderColor: on ? 'var(--foreground)' : 'var(--border-strong)', bg: on ? 'var(--surface-card)' : 'var(--background)', boxShadow: on ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: on ? 'var(--surface-card)' : '$hover', borderColor: on ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, items: "center", gap: "$2", cursor: "pointer", children: [_jsx(XStack, { gap: 3, shrink: 0, children: rig.colors.map((hex) => (_jsx(XStack, { width: 10, height: 10, rounded: 99, style: { backgroundColor: hex, border: '1px solid var(--border-strong)', boxShadow: 'inset 0 0 0 1px color-mix(in srgb, var(--foreground) 20%, transparent)' }, borderWidth: 1, borderColor: "var(--border-strong)" }, hex))) }), _jsx(SizableText, { size: "$2", fontWeight: on ? '600' : '500', color: "$ink", numberOfLines: 1, children: rig.label })] }, rig.id));
|
|
1134
|
+
}) })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: `Shot ${activeShot.number}: ${activeShot.title}` }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${activeCamera.name} · ${activeLens.label} · ${activeShot.aperture} · Cast: ${activeCharacter.name}` })] }), _jsxs(XStack, { gap: "$1.5", items: "center", flexWrap: "wrap", width: "100%", children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": sequenceMode, onClick: () => setSequenceMode((m) => !m), items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, borderWidth: 1, borderColor: sequenceMode ? '$ink' : 'var(--border-strong)', bg: sequenceMode ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", shrink: 0, children: [_jsx(Film, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: sequenceMode ? '600' : '500', color: "$ink", children: sequenceMode ? 'Chain shots: on' : 'Chain all shots' })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setPlaying((p) => !p), px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", shrink: 0, children: [_jsx(Play, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", children: playing ? 'Pause monitor' : 'Play monitor' })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => void renderShotOnCloud(activeShot), px: "$4", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, items: "center", gap: "$1.5", rounded: 999, bg: "$ink", hoverStyle: { opacity: 0.9 }, focusVisibleStyle: RING, cursor: "pointer", shrink: 0, children: [_jsx(Sparkles, { size: 13, color: "$background" }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: renderingId === activeShot.id ? 'Rendering shot…' : 'Render shot (Wan 2.2)' })] })] })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--surface-card)", items: "center", justify: "center", children: _jsx("canvas", { ref: canvasRef, width: 860, height: 420, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsxs(YStack, { gap: "$2", minW: 0, children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Scene action & blocking prompt" }), _jsx(StudioTextarea, { "aria-label": "Scene action and blocking prompt", style: { resize: 'none' }, ...{ value: activeShot.prompt, rows: 2 }, onChange: (e) => updateShot({ prompt: e.currentTarget.value }) }), _jsxs(XStack, { gap: "$2", flexWrap: "wrap", minW: 0, children: [_jsxs(YStack, { flex: 1, minW: 180, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Lip-sync dialogue line (Koe performance)" }), _jsx(StudioInput, { "aria-label": "Lip-sync dialogue line", ...{ value: activeShot.dialogue, placeholder: 'Spoken line for lip-sync & voice stem…' }, onChange: (e) => updateShot({ dialogue: e.currentTarget.value }) })] }), _jsxs(YStack, { width: 130, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Shot duration (s)" }), _jsx(StudioInput, { "aria-label": "Shot duration in seconds", ...{ type: 'number', min: 1, max: 15, step: 0.5, value: String(activeShot.durationSec) }, onChange: (e) => updateShot({ durationSec: Math.max(1, Number(e.currentTarget.value) || 4) }) })] })] })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 268, shrink: 0 }, $xxl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "4. Character & world continuity lock" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Lock face geometry, wardrobe, and voice identity across every shot in the sequence." }), _jsx(YStack, { gap: "$2", children: characters.map((char) => {
|
|
1135
|
+
const locked = char.id === activeShot.characterId;
|
|
1136
|
+
return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ characterId: char.id }), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2.5", rounded: "$3", "aria-pressed": locked, borderWidth: locked ? 1.5 : 1, borderColor: locked ? 'var(--foreground)' : 'var(--border-strong)', bg: locked ? 'var(--surface-card)' : 'var(--background)', boxShadow: locked ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: locked ? 'var(--surface-card)' : '$hover', borderColor: locked ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: char.name }), _jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [locked ? _jsx(XStack, { width: 6, height: 6, rounded: 99, bg: "var(--state-success)" }) : null, _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: locked ? 'var(--state-success)' : '$soft', children: locked ? `Locked #${char.seed}` : `#${char.seed}` })] })] }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: char.wardrobe }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", children: char.voice })] }, char.id));
|
|
1137
|
+
}) }), _jsxs(YStack, { gap: "$2", pt: "$2", borderTopWidth: 1, borderColor: "var(--border)", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", children: "Lock new character / actor ID" }), _jsx(StudioInput, { "aria-label": "New character name", ...{ placeholder: 'Character name (e.g. Mira Solis)', value: newCharName }, onChange: (e) => setNewCharName(e.currentTarget.value) }), _jsx(StudioInput, { "aria-label": "New character wardrobe and look", ...{ placeholder: 'Wardrobe, face & look traits…', value: newCharWardrobe }, onChange: (e) => setNewCharWardrobe(e.currentTarget.value) }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: addCharacter, items: "center", justify: "center", gap: "$1.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Plus, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: "Add & lock character ID" })] })] })] })] }), _jsxs(YStack, { gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Video, { size: 15, color: "$ink" }), _jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Multi-shot storyboard & NLE timeline" }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${shots.length} shots · ${shots.reduce((acc, s) => acc + s.durationSec, 0).toFixed(1)}s master cut` })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: addShot, items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Plus, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: "Append shot to timeline" })] })] }), _jsx(XStack, { gap: "$2.5", overflowX: "auto", pb: "$1", width: "100%", children: shots.map((s) => {
|
|
1138
|
+
const cam = CAMERA_MOVES.find((c) => c.id === s.cameraId) ?? CAMERA_MOVES[0];
|
|
1139
|
+
const char = characters.find((c) => c.id === s.characterId) ?? characters[0];
|
|
1140
|
+
const selected = s.id === activeShot.id;
|
|
1141
|
+
return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => setActiveShotId(s.id), width: 248, shrink: 0, p: "$2.5", rounded: "$3", "aria-pressed": selected, borderWidth: selected ? 1.5 : 1, borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)', bg: selected ? 'var(--surface-card)' : 'var(--background)', boxShadow: selected ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: selected ? 'var(--surface-card)' : '$hover', borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$1", fontWeight: "600", fontFamily: "$mono", color: "$ink", children: `Shot ${String(s.number).padStart(2, '0')} · ${cam.code}` }), _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: s.status === 'done' ? 'var(--state-success)' : '$soft', children: `${s.durationSec.toFixed(1)}s · ${s.status}` })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", numberOfLines: 1, children: s.title }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: s.prompt }), _jsxs(XStack, { items: "center", justify: "space-between", pt: "$1", width: "100%", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: char.name }), _jsxs(XStack, { items: "center", gap: "$1", children: [_jsx(Music, { size: 11, color: "$soft" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Oto + Uta stems" })] })] })] }, s.id));
|
|
1142
|
+
}) })] })] })) : null, section === 'music' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $xl: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 276, shrink: 0 }, $xxl: { width: 288 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "ACE-Step 3.5B song & stem synthesis" }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Musical style, instruments & production tags" }), _jsx(StudioTextarea, { "aria-label": "Music style and production prompt", style: { resize: 'none' }, ...{ value: musicPrompt, rows: 3 }, onChange: (e) => setMusicPrompt(e.currentTarget.value) })] }), _jsxs(XStack, { gap: "$2", children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Tempo (BPM)" }), _jsx(StudioInput, { "aria-label": "Music BPM", ...{ type: 'number', min: 60, max: 200, value: String(musicBpm) }, onChange: (e) => setMusicBpm(Number(e.currentTarget.value) || 120) })] }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Key signature" }), _jsx(StudioInput, { "aria-label": "Key signature", ...{ value: musicKey }, onChange: (e) => setMusicKey(e.currentTarget.value) })] })] }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Lyrics & song structure" }), _jsx(StudioTextarea, { "aria-label": "Song lyrics and structure", style: { resize: 'none' }, ...{ value: musicLyrics, rows: 4 }, onChange: (e) => setMusicLyrics(e.currentTarget.value) })] }), _jsxs(XStack, { render: "button", onPress: () => {
|
|
1143
|
+
setDawPlaying(true);
|
|
1144
|
+
setStatusNote(`Synthesizing ACE-Step 3.5B Master (${musicBpm} BPM · ${musicKey})…`);
|
|
1145
|
+
}, height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Sparkles, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: "Generate Song & Stems (ACE-Step)" })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Multi-stem DAW & waveform sequencer" }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${musicBpm} BPM · ${musicKey} · 48kHz 24-bit stems` })] }), _jsx(XStack, { gap: "$2", children: _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": dawPlaying, onClick: () => setDawPlaying((p) => !p), px: "$3.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, bg: dawPlaying ? 'var(--surface-card-emphasis)' : 'transparent', borderWidth: 1, borderColor: dawPlaying ? '$ink' : 'var(--border-strong)', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, items: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Play, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", fontWeight: "600", children: dawPlaying ? 'Stop synth engine' : 'Play live stems' })] }) })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--surface-card)", children: _jsx("canvas", { ref: audioWaveCanvasRef, width: 780, height: 220, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsx(YStack, { gap: "$2", role: "list", "aria-label": "Audio stems", minW: 0, children: stems.map((stem) => (_jsxs(XStack, { role: "listitem", items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2.5", p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--background)", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", width: 180, minW: 0, children: [_jsx(XStack, { width: 9, height: 9, rounded: 99, shrink: 0, borderWidth: 1, borderColor: "var(--border-strong)", style: { backgroundColor: stem.color, border: '1px solid var(--border-strong)' } }), _jsxs(YStack, { minW: 0, children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: stem.name }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: stem.role })] })] }), _jsx("input", { "aria-label": `${stem.name} volume`, type: "range", min: 0, max: 100, value: stem.volume, onChange: (e) => {
|
|
1146
|
+
const v = Number(e.currentTarget.value);
|
|
1147
|
+
setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, volume: v } : s)));
|
|
1148
|
+
}, style: { flex: 1, minWidth: 100 } }), _jsxs(XStack, { gap: "$1.5", shrink: 0, children: [_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-label": `Mute ${stem.name}`, "aria-pressed": stem.muted, onClick: () => setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, muted: !s.muted } : s))), px: "$2.5", minW: 44, minH: 44, "$max-sm": { minW: 44, minH: 44 }, $md: { minW: 30, minH: 26, height: 26 }, items: "center", justify: "center", rounded: "$2", borderWidth: 1, borderColor: stem.muted ? '$ink' : 'var(--border-strong)', bg: stem.muted ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: stem.muted ? '600' : '500', color: stem.muted ? '$ink' : '$soft', children: "M" }) }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-label": `Solo ${stem.name}`, "aria-pressed": stem.solo, onClick: () => setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, solo: !s.solo } : s))), px: "$2.5", minW: 44, minH: 44, "$max-sm": { minW: 44, minH: 44 }, $md: { minW: 30, minH: 26, height: 26 }, items: "center", justify: "center", rounded: "$2", borderWidth: 1, borderColor: stem.solo ? '$ink' : 'var(--border-strong)', bg: stem.solo ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: stem.solo ? '600' : '500', color: stem.solo ? '$ink' : '$soft', children: "S" }) })] })] }, stem.id))) })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 268, shrink: 0 }, $xxl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Koe voice & dialogue studio" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Zero-shot voice cloning & emotional speech synthesis (/v1/audio/speech)." }), _jsx(YStack, { gap: "$1.5", children: ['koe-baritone', 'koe-alto', 'koe-narrator', 'oto-cyber'].map((vp) => (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setVoicePreset(vp), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32 }, py: "$1.5", rounded: "$3", "aria-pressed": voicePreset === vp, borderWidth: voicePreset === vp ? 1.5 : 1, borderColor: voicePreset === vp ? 'var(--foreground)' : 'var(--border-strong)', bg: voicePreset === vp ? 'var(--surface-card)' : 'var(--background)', boxShadow: voicePreset === vp ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: voicePreset === vp ? 'var(--surface-card)' : '$hover', borderColor: voicePreset === vp ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, justify: "space-between", items: "center", cursor: "pointer", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", fontFamily: "$mono", color: "$ink", children: vp }), _jsx(SizableText, { size: "$1", color: "$soft", children: "24kHz neural" })] }, vp))) }), _jsx(StudioTextarea, { "aria-label": "Voice narration script", ...{ value: voiceLine, rows: 4 }, onChange: (e) => setVoiceLine(e.currentTarget.value) }), _jsxs(XStack, { render: "button", onPress: () => {
|
|
1149
|
+
triggerCinemaAudio();
|
|
1150
|
+
setStatusNote(`Synthesized Koe voice stem (${voicePreset}) → added to Vocal Stem`);
|
|
1151
|
+
}, height: 34, rounded: 999, borderWidth: 1, borderColor: "$borderColor", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Wand2, { size: 13 }), _jsx(SizableText, { size: "$1", fontWeight: "600", children: "Synthesize Voice Stem" })] })] })] })) : null, section === 'model3d' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 276, shrink: 0 }, $xl: { width: 288 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Hunyuan3D-2.1 mesh generator" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Convert a reference photo or prompt into a watertight textured .glb mesh on GB10 / H100 GPUs." }), _jsx(YStack, { gap: "$2", role: "list", "aria-label": "3D mesh presets", children: MESH_PRESETS.map((m) => {
|
|
1152
|
+
const on = m.id === activeMesh.id;
|
|
1153
|
+
return (_jsx(YStack, { role: "listitem", width: "100%", minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => {
|
|
1154
|
+
setActiveMeshId(m.id);
|
|
1155
|
+
setMeshPrompt(m.prompt);
|
|
1156
|
+
setMeshOctree(m.octree);
|
|
1157
|
+
}, width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2.5", rounded: "$3", "aria-pressed": on, borderWidth: on ? 1.5 : 1, borderColor: on ? 'var(--foreground)' : 'var(--border-strong)', bg: on ? 'var(--surface-card)' : 'var(--background)', boxShadow: on ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: on ? 'var(--surface-card)' : '$hover', borderColor: on ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", flex: 1, minW: 0, children: m.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", shrink: 0, children: `${(m.faces / 1000).toFixed(0)}k tris` })] }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", children: m.category })] }) }, m.id));
|
|
1158
|
+
}) }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Octree marching-cubes resolution" }), _jsx(XStack, { gap: "$2", children: [256, 384, 512].map((res) => {
|
|
1159
|
+
const on = meshOctree === res;
|
|
1160
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setMeshOctree(res), px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontFamily: "$mono", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: `${res}³` }) }, res));
|
|
1161
|
+
}) })] }), _jsx(StudioTextarea, { "aria-label": "3D mesh conditioning prompt", style: { resize: 'none' }, ...{ value: meshPrompt, rows: 3 }, onChange: (e) => setMeshPrompt(e.currentTarget.value) }), _jsxs(XStack, { render: "button", onPress: () => {
|
|
1162
|
+
triggerCinemaAudio();
|
|
1163
|
+
setStatusNote(`Dispatched Hunyuan3D-2.1 mesh job (${meshOctree}³ octree) → /v1/library/model3d`);
|
|
1164
|
+
}, height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Box, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: "Generate 3D Mesh (.GLB)" })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: activeMesh.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${activeMesh.vertices.toLocaleString()} vertices · ${activeMesh.faces.toLocaleString()} triangles · Watertight PBR GLB` })] }), _jsxs(XStack, { gap: "$1.5", flexWrap: "wrap", items: "center", children: [[
|
|
1165
|
+
{ id: 'pbr', label: 'PBR' },
|
|
1166
|
+
{ id: 'wireframe', label: 'Wireframe' },
|
|
1167
|
+
{ id: 'normal', label: 'Normal' },
|
|
1168
|
+
{ id: 'clay', label: 'Clay' },
|
|
1169
|
+
].map((sh) => {
|
|
1170
|
+
const on = meshShader === sh.id;
|
|
1171
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setMeshShader(sh.id), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: sh.label }) }, sh.id));
|
|
1172
|
+
}), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setMeshAutoRotate((r) => !r), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: "$ink", children: meshAutoRotate ? 'Turntable: on' : 'Turntable: off' }) }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: exportMeshObj, px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(Download, { size: 12, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", fontWeight: "600", children: "Export .OBJ / .GLB" })] })] })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--surface-card)", children: _jsx("canvas", { ref: meshCanvasRef, width: 820, height: 420, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsxs(XStack, { items: "center", gap: "$3", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `Key light azimuth (${meshLightAngle}°)` }), _jsx("input", { "aria-label": "Key light azimuth angle", type: "range", min: 0, max: 360, value: meshLightAngle, onChange: (e) => setMeshLightAngle(Number(e.currentTarget.value)), style: { flex: 1, minWidth: 140 } })] })] })] })) : null, section === 'library' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Org asset library, stacks & quality gate flywheel" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Every asset embeds its ComfyUI workflow graph and seed. Ratings and critiques condition future renders." })] }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: [
|
|
1173
|
+
{ id: 'all', label: 'All' },
|
|
1174
|
+
{ id: 'video', label: 'Video' },
|
|
1175
|
+
{ id: 'model3d', label: '3D' },
|
|
1176
|
+
{ id: 'music', label: 'Music' },
|
|
1177
|
+
{ id: 'image', label: 'Image' },
|
|
1178
|
+
].map((f) => {
|
|
1179
|
+
const on = libraryFilter === f.id;
|
|
1180
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setLibraryFilter(f.id), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: f.label }) }, f.id));
|
|
1181
|
+
}) })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "Library assets", width: "100%", minW: 0, children: libraryItems
|
|
1182
|
+
.filter((it) => libraryFilter === 'all' || it.modality === libraryFilter)
|
|
1183
|
+
.map((it) => (_jsxs(YStack, { role: "listitem", width: "100%", $sm: { width: 'calc(50% - 5px)' }, minW: 0, p: "$3", rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--background)", gap: "$2", children: [_jsxs(XStack, { justify: "space-between", items: "center", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", flex: 1, minW: 0, children: [_jsx(Folder, { size: 12, color: "$soft" }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: it.stack })] }), _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: it.status === 'published' || it.status === 'approved' ? 'var(--state-success)' : '$soft', shrink: 0, children: it.status === 'published' ? 'Published' : it.status === 'approved' ? 'Approved' : 'Draft' })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", children: it.title }), it.modality === 'image' && /^(blob:|data:image\/|https?:)/.test(it.path) ? (_jsx("img", { src: it.path, alt: it.title, style: { width: '100%', borderRadius: 8, display: 'block' } })) : null, _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", numberOfLines: 2, children: `${/^(blob|data):/.test(it.path) ? 'Generated image' : it.path} · graph: ${it.workflow}` }), it.critique ? (_jsx(SizableText, { size: "$1", color: "$soft", children: `Conditioning note: “${it.critique}”` })) : null, _jsxs(XStack, { justify: "space-between", items: "center", flexWrap: "wrap", gap: "$1.5", pt: "$1", children: [_jsxs(XStack, { gap: "$1.5", children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": it.vote === 1, onClick: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === 1 ? 0 : 1 } : x))), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: "$2", borderWidth: 1, borderColor: it.vote === 1 ? 'var(--state-success)' : 'var(--border-strong)', bg: it.vote === 1 ? 'var(--state-success-bg)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(ThumbsUp, { size: 12, color: it.vote === 1 ? 'var(--state-success)' : '$ink' }), _jsx(SizableText, { size: "$1", color: it.vote === 1 ? 'var(--state-success)' : '$ink', children: "Good" })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": it.vote === -1, onClick: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === -1 ? 0 : -1 } : x))), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: "$2", borderWidth: 1, borderColor: it.vote === -1 ? 'var(--state-error)' : 'var(--border-strong)', bg: it.vote === -1 ? 'var(--state-error-bg)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(ThumbsDown, { size: 12, color: it.vote === -1 ? 'var(--state-error)' : '$ink' }), _jsx(SizableText, { size: "$1", color: it.vote === -1 ? 'var(--state-error)' : '$ink', children: "Fix" })] })] }), _jsx(XStack, { render: "button", onPress: () => {
|
|
1184
|
+
setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, status: 'published' } : x)));
|
|
1185
|
+
setStatusNote(`Published "${it.title}" to Gallery & cms.hanzo.ai`);
|
|
1186
|
+
}, px: "$2.5", height: 26, items: "center", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: _jsx(SizableText, { size: "$1", children: "\u2601 Publish CMS" }) })] })] }, it.id))) })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 272, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Qwen-Image-Edit 2511 mask inpaint" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Paint a mask region or attach 2\u20135 references to edit only the selected area while preserving subject identity and lighting (/v1/library/fix)." }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Edit instruction" }), _jsx(StudioTextarea, { "aria-label": "Inpaint edit instruction", style: { resize: 'none' }, ...{ value: inpaintInstruction, rows: 3 }, onChange: (e) => setInpaintInstruction(e.currentTarget.value) })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `Denoise / edit strength: ${inpaintStrength}%` }), _jsx("input", { "aria-label": "Edit strength percentage", type: "range", min: 10, max: 95, step: 5, value: inpaintStrength, onChange: (e) => setInpaintStrength(Number(e.currentTarget.value)) })] }), _jsx("canvas", { ref: inpaintCanvasRef, width: 280, height: 4, style: { display: 'none' } }), _jsxs(XStack, { render: "button", onPress: () => {
|
|
1187
|
+
triggerCinemaAudio();
|
|
1188
|
+
setStatusNote(`Queued Qwen-Image-Edit 2511 pass (${inpaintStrength}% denoise) → /v1/library/fix`);
|
|
1189
|
+
}, height: 34, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Wand2, { size: 13 }), _jsx(SizableText, { size: "$1", color: "$background", fontWeight: "600", children: "Run Region Edit (/v1/library/fix)" })] })] })] })) : null, section === 'queue' ? (_jsxs(YStack, { gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "GPU federation fleet & durable render queue (tasks.hanzo.ai)" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Select a target GPU node (X-Target-GPU) or route jobs across the shared gpu-jobs cluster." })] }), _jsxs(XStack, { render: "button", onPress: () => setStatusNote('Refreshed /v1/gpu-status & /v1/queue/status'), px: "$3", height: 30, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: [_jsx(RefreshCw, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Refresh Fleet" })] })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "GPU nodes", width: "100%", minW: 0, children: gpuNodes.map((n) => {
|
|
1190
|
+
const selected = targetGpu === n.name;
|
|
1191
|
+
return (_jsx(YStack, { role: "listitem", width: "100%", $sm: { width: 'calc(50% - 5px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => {
|
|
1192
|
+
setTargetGpu(selected ? 'any' : n.name);
|
|
1193
|
+
setStatusNote(selected ? 'Routing renders to any available GPU' : `Pinned next render to GPU node: ${n.name}`);
|
|
1194
|
+
}, width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$3", rounded: "$3", "aria-pressed": selected, borderWidth: selected ? 1.5 : 1, borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)', bg: selected ? 'var(--surface-card)' : 'var(--background)', boxShadow: selected ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: selected ? 'var(--surface-card)' : '$hover', borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1.5", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, children: [_jsx(Cpu, { size: 15, color: "$ink" }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", fontFamily: "$mono", numberOfLines: 1, children: n.name })] }), _jsxs(XStack, { items: "center", gap: "$1.5", shrink: 0, children: [_jsx(XStack, { width: 7, height: 7, rounded: 99, bg: n.online ? 'var(--state-success)' : 'var(--state-error)' }), _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: n.online ? 'var(--state-success)' : 'var(--state-error)', children: n.online ? `Online · ${n.depth} queued` : 'Offline' })] })] }), _jsx(SizableText, { size: "$1", color: "$soft", children: `Memory: ${n.vram}` }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", text: "left", children: `Lanes: ${n.lanes.join(' · ')}` })] }) }, n.name));
|
|
1195
|
+
}) })] })) : null] }));
|
|
1196
|
+
}
|