@pixerate/flair 0.24.0 → 0.25.0
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/CHANGELOG.md +12 -0
- package/dist/catalog/index.js +2 -2
- package/dist/chunk-DBTLCXKY.js +332 -0
- package/dist/chunk-DBTLCXKY.js.map +1 -0
- package/dist/{chunk-VP6IEWIK.js → chunk-H6L67KHI.js} +1 -1
- package/dist/chunk-H6VDFBIO.js +498 -0
- package/dist/chunk-H6VDFBIO.js.map +1 -0
- package/dist/chunk-JL6TI6II.js +724 -0
- package/dist/chunk-JL6TI6II.js.map +1 -0
- package/dist/{chunk-NGKNI3QX.js → chunk-O44ZJTGG.js} +5 -485
- package/dist/chunk-O44ZJTGG.js.map +1 -0
- package/dist/chunk-OKYMKSXK.js +414 -0
- package/dist/chunk-OKYMKSXK.js.map +1 -0
- package/dist/{chunk-OHW7UG6D.js → chunk-ORAFCHX3.js} +26 -2
- package/dist/{chunk-OHW7UG6D.js.map → chunk-ORAFCHX3.js.map} +1 -1
- package/dist/{chunk-OQ4EWZ3B.js → chunk-PYDN5G2P.js} +5 -5
- package/dist/{chunk-ARKC7LDW.js → chunk-RDU63CDO.js} +2 -331
- package/dist/chunk-RDU63CDO.js.map +1 -0
- package/dist/chunk-S2RGHHKZ.js +902 -0
- package/dist/chunk-S2RGHHKZ.js.map +1 -0
- package/dist/{chunk-LVPIIWPP.js → chunk-STKEKXCK.js} +18 -8
- package/dist/chunk-STKEKXCK.js.map +1 -0
- package/dist/chunk-YBGRXVAE.js +407 -0
- package/dist/chunk-YBGRXVAE.js.map +1 -0
- package/dist/cli.js +68 -5
- package/dist/cli.js.map +1 -1
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +14 -12
- package/dist/editor/index.js.map +1 -1
- package/dist/effect-26CPF5HS.js +47 -0
- package/dist/embed/index.d.ts +215 -0
- package/dist/embed/index.js +21 -0
- package/dist/embed/index.js.map +1 -0
- package/dist/frames-VEcqa40g.d.ts +161 -0
- package/dist/index.d.ts +6 -163
- package/dist/index.js +86 -78
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +167 -7
- package/dist/node.js +25 -3
- package/dist/react/index.d.ts +33 -2
- package/dist/react/index.js +54 -9
- package/dist/react/index.js.map +1 -1
- package/dist/recorder-CDPPTJMG.js +31 -0
- package/dist/recorder-CDPPTJMG.js.map +1 -0
- package/dist/{renderer-C2P1qGzP.d.ts → renderer-teaa98RE.d.ts} +1 -1
- package/dist/svelte/index.d.ts +33 -4
- package/dist/svelte/index.js +51 -9
- package/dist/svelte/index.js.map +1 -1
- package/dist/vector/index.d.ts +52 -1
- package/dist/vector/index.js +8 -4
- package/package.json +1 -1
- package/dist/chunk-ARKC7LDW.js.map +0 -1
- package/dist/chunk-LVPIIWPP.js.map +0 -1
- package/dist/chunk-NGKNI3QX.js.map +0 -1
- package/dist/chunk-UP6QQVRS.js +0 -331
- package/dist/chunk-UP6QQVRS.js.map +0 -1
- package/dist/recorder-HKFFHQES.js +0 -10
- /package/dist/{chunk-VP6IEWIK.js.map → chunk-H6L67KHI.js.map} +0 -0
- /package/dist/{chunk-OQ4EWZ3B.js.map → chunk-PYDN5G2P.js.map} +0 -0
- /package/dist/{recorder-HKFFHQES.js.map → effect-26CPF5HS.js.map} +0 -0
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport path from 'path';\nimport fs from 'fs';\nimport { exec } from 'child_process';\nimport { parseControls, standaloneHtml, type ControlValue } from './shader/index.js';\nimport { validateScene, simulateScene, standaloneSceneHtml, type Scene } from './scene/index.js';\n\nconst program = new Command();\n\nprogram\n .name('flair')\n .description('Generative motion graphics, animation directing & bespoke WebGL shader engine')\n .version('2.0.0');\n\n// ==========================================\n// Shader Commands\n// ==========================================\nprogram\n .command('controls <shaderPath>')\n .description('Inspect and parse @control declarations in a WebGL shader file')\n .option('--json', 'Output controls as JSON', false)\n .action((shaderPath, options) => {\n const fullPath = path.resolve(process.cwd(), shaderPath);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Shader file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n const source = fs.readFileSync(fullPath, 'utf-8');\n const controls = parseControls(source);\n\n if (options.json) {\n console.log(JSON.stringify(controls, null, 2));\n return;\n }\n\n if (controls.length === 0) {\n console.log(`No @control annotations found in ${path.basename(shaderPath)}.`);\n return;\n }\n\n console.log(`Controls in ${path.basename(shaderPath)} (${controls.length}):`);\n for (const c of controls) {\n const defVal = Array.isArray(c.default) ? `[${c.default.join(', ')}]` : String(c.default);\n console.log(\n ` • ${c.name} (${c.type}): \"${c.label}\" | default=${defVal} | range=[${c.min}, ${c.max}] (line ${c.line})`\n );\n }\n });\n\nprogram\n .command('html <shaderPath>')\n .description('Generate a self-contained standalone HTML page running the shader')\n .option('-t, --title <title>', 'Page title')\n .option('-o, --out <outputPath>', 'Output HTML path')\n .option('-v, --values <jsonOrFile>', 'Control values as JSON string or path to JSON file')\n .option('--open', 'Open generated HTML page in default browser', false)\n .action((shaderPath, options) => {\n const fullPath = path.resolve(process.cwd(), shaderPath);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Shader file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n const source = fs.readFileSync(fullPath, 'utf-8');\n const title = options.title || path.basename(shaderPath, path.extname(shaderPath));\n\n let values: Record<string, ControlValue> = {};\n if (options.values) {\n try {\n if (fs.existsSync(options.values)) {\n values = JSON.parse(fs.readFileSync(options.values, 'utf-8'));\n } else {\n values = JSON.parse(options.values);\n }\n } catch (err: any) {\n console.error(`Error parsing values: ${err.message}`);\n process.exit(1);\n }\n }\n\n const htmlContent = standaloneHtml(title, source, values);\n const outputPath = path.resolve(\n process.cwd(),\n options.out || `${path.basename(shaderPath, path.extname(shaderPath))}.html`\n );\n\n fs.mkdirSync(path.dirname(outputPath), { recursive: true });\n fs.writeFileSync(outputPath, htmlContent, 'utf-8');\n console.log(`Generated standalone shader page at: ${outputPath}`);\n\n if (options.open) {\n exec(`open \"${outputPath}\"`);\n }\n });\n\nprogram\n .command('export <targetOrShader> [extraPath] [outputPath]')\n .description('Export shader animation (GIF/MP4) or scene to Apple Motion ozml 4.0 (.motn)')\n .option('-o, --out <outputPath>', 'Output file path')\n .option('-w, --width <width>', 'Canvas width', '720')\n .option('-h, --height <height>', 'Canvas height', '720')\n .option('--fps <fps>', 'Frames per second', '30')\n .option('-d, --duration <duration>', 'Duration in seconds', '3')\n .option('-v, --values <jsonOrFile>', 'Control values as JSON string or file')\n .action(async (targetOrShader, extraPath, outputPath, options) => {\n if (targetOrShader === 'motn' || targetOrShader === 'lottie' || targetOrShader === 'fcp7' || targetOrShader === 'edl') {\n const sceneFile = extraPath;\n if (!sceneFile) {\n console.error(`Error: Please provide a scene JSON file to export: flair export ${targetOrShader} <scene.json> [output]`);\n process.exit(1);\n }\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportMotn, exportLottie, exportFcp7Xml, exportCmx3600Edl } = await import('./export/index.js');\n const fps = parseInt(options.fps, 10);\n\n let content: string;\n let ext: string;\n if (targetOrShader === 'motn') {\n content = exportMotn(scene, { frameRate: fps });\n ext = 'motn';\n } else if (targetOrShader === 'lottie') {\n content = JSON.stringify(exportLottie(scene, { frameRate: fps }), null, 2);\n ext = 'json';\n } else if (targetOrShader === 'fcp7') {\n content = exportFcp7Xml(scene, { frameRate: fps });\n ext = 'xml';\n } else {\n content = exportCmx3600Edl(scene, { frameRate: fps });\n ext = 'edl';\n }\n\n const destination = path.resolve(\n process.cwd(),\n options.out || outputPath || `${scene.name || 'scene'}.${ext}`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, content, 'utf-8');\n console.log(`✅ Successfully exported ${targetOrShader.toUpperCase()} to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to ${targetOrShader}: ${err.message}`);\n process.exit(1);\n }\n return;\n }\n\n const shaderPath = targetOrShader;\n const fullPath = path.resolve(process.cwd(), shaderPath);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Shader file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n if (!options.out) {\n console.error('Error: Output file path required (-o, --out <outputPath>)');\n process.exit(1);\n }\n\n const source = fs.readFileSync(fullPath, 'utf-8');\n\n let values: Record<string, ControlValue> = {};\n if (options.values) {\n try {\n if (fs.existsSync(options.values)) {\n values = JSON.parse(fs.readFileSync(options.values, 'utf-8'));\n } else {\n values = JSON.parse(options.values);\n }\n } catch (err: any) {\n console.error(`Error parsing values: ${err.message}`);\n process.exit(1);\n }\n }\n\n const width = parseInt(options.width, 10);\n const height = parseInt(options.height, 10);\n const fps = parseInt(options.fps, 10);\n const duration = parseFloat(options.duration);\n\n console.log(`Rendering ${duration}s (${duration * fps} frames at ${width}x${height}, ${fps}fps) to ${options.out}...`);\n\n try {\n const { exportMotionGraphic } = await import('./export/recorder.js');\n const savedPath = await exportMotionGraphic({\n source,\n values,\n outputPath: options.out,\n width,\n height,\n fps,\n duration,\n onProgress: (frame, total) => {\n process.stdout.write(`\\rRendering frame ${frame}/${total} (${Math.round((frame / total) * 100)}%)`);\n },\n });\n console.log(`\\n✅ Successfully exported motion graphic to: ${savedPath}`);\n } catch (err: any) {\n console.error(`\\nExport failed: ${err.message}`);\n process.exit(1);\n }\n });\n\n// ==========================================\n// Scene Directing Commands\n// ==========================================\nconst sceneCmd = program\n .command('scene')\n .description('Direct, validate, simulate, and render multi-shot animated scenes');\n\nsceneCmd\n .command('validate <sceneFile>')\n .description('Validate scene JSON structure, camera framing, and effect IDs')\n .action((sceneFile) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const issues = validateScene(scene);\n if (issues.length === 0) {\n console.log(`✅ Scene \"${scene.name}\" is valid (${scene.shots.length} shots).`);\n } else {\n console.warn(`Found ${issues.length} issue(s) in \"${scene.name}\":`);\n for (const iss of issues) {\n const loc = iss.shot === 0 ? 'Scene' : `Shot ${iss.shot}`;\n console.warn(` • [${loc}] ${iss.message}`);\n }\n process.exit(1);\n }\n } catch (err: any) {\n console.error(`Error reading scene: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('review <sceneFile>')\n .alias('preview')\n .description('Simulate scene off-screen and generate timing breakdown & diagnostic review')\n .action(async (sceneFile) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { review } = await simulateScene(scene);\n console.log(review.markdown);\n } catch (err: any) {\n console.error(`Error reviewing scene: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('html <sceneFile>')\n .description('Generate standalone interactive web player for the scene')\n .option('-o, --out <outputPath>', 'Output HTML path')\n .option('--open', 'Open generated HTML in browser', false)\n .action((sceneFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const htmlContent = standaloneSceneHtml(scene);\n const outputPath = path.resolve(\n process.cwd(),\n options.out || `${scene.name || 'scene'}.html`\n );\n\n fs.mkdirSync(path.dirname(outputPath), { recursive: true });\n fs.writeFileSync(outputPath, htmlContent, 'utf-8');\n console.log(`Generated standalone scene player at: ${outputPath}`);\n\n if (options.open) {\n exec(`open \"${outputPath}\"`);\n }\n } catch (err: any) {\n console.error(`Error generating scene HTML: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('motn <sceneFile> [outFile]')\n .description('Export scene to Apple Motion ozml 4.0 XML (.motn) document')\n .option('--fps <fps>', 'Target frame rate', '30')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportMotn } = await import('./export/index.js');\n const xml = exportMotn(scene, { frameRate: parseInt(options.fps, 10) });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.motn`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, xml, 'utf-8');\n console.log(`✅ Successfully exported Apple Motion scene to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to .motn: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('lottie <sceneFile> [outFile]')\n .description('Export scene vector shapes and animations to Lottie JSON')\n .option('--fps <fps>', 'Target frame rate', '30')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportLottie } = await import('./export/index.js');\n const animation = exportLottie(scene, { frameRate: parseInt(options.fps, 10) });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.json`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, JSON.stringify(animation, null, 2), 'utf-8');\n console.log(`✅ Successfully exported Lottie animation to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to Lottie: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('fcp7 <sceneFile> [outFile]')\n .description('Export scene timeline and markers to Final Cut Pro 7 XML (xmeml v4)')\n .option('--fps <fps>', 'Target frame rate', '30')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportFcp7Xml } = await import('./export/index.js');\n const xml = exportFcp7Xml(scene, { frameRate: parseInt(options.fps, 10) });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.xml`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, xml, 'utf-8');\n console.log(`✅ Successfully exported FCP7 XML to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to FCP7 XML: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('edl <sceneFile> [outFile]')\n .description('Export scene edit decision list to standard CMX 3600 EDL')\n .option('--fps <fps>', 'Target frame rate', '30')\n .option('--reel <reel>', 'Reel name identifier', 'AX')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportCmx3600Edl } = await import('./export/index.js');\n const edl = exportCmx3600Edl(scene, {\n frameRate: parseInt(options.fps, 10),\n reel: options.reel,\n });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.edl`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, edl, 'utf-8');\n console.log(`✅ Successfully exported CMX 3600 EDL to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to CM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AAI,MAAM,OAAO,sBAAmB;AAC7D,UAAM,MAAM,iBAAiB,OAAO;AAAA,MAClC,WAAW,SAAS,QAAQ,KAAK,EAAE;AAAA,MACnC,MAAM,QAAQ;AAAA,IAChB,CAAC;AACD,UAAM,cAAc,KAAK;AAAA,MACvB,QAAQ,IAAI;AAAA,MACZ,WAAW,GAAG,MAAM,QAAQ,OAAO;AAAA,IACrC;AACA,OAAG,UAAU,KAAK,QAAQ,WAAW,GAAG,EAAE,WAAW,KAAK,CAAC;AAC3D,OAAG,cAAc,aAAa,KAAK,OAAO;AAC1C,YAAQ,IAAI,iDAA4C,WAAW,EAAE;AAAA,EACvE,SAAS,KAAU;AACjB,YAAQ,MAAM,0CAA0C,IAAI,OAAO,EAAE;AACrE,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QAAQ,MAAM,QAAQ,IAAI;","names":["fullPath","fps"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport path from 'path';\nimport fs from 'fs';\nimport { exec } from 'child_process';\nimport { parseControls, standaloneHtml, type ControlValue } from './shader/index.js';\nimport { validateScene, simulateScene, standaloneSceneHtml, type Scene } from './scene/index.js';\n\nconst program = new Command();\n\nprogram\n .name('flair')\n .description('Generative motion graphics, animation directing & bespoke WebGL shader engine')\n .version('2.0.0');\n\n// ==========================================\n// Shader Commands\n// ==========================================\nprogram\n .command('controls <shaderPath>')\n .description('Inspect and parse @control declarations in a WebGL shader file')\n .option('--json', 'Output controls as JSON', false)\n .action((shaderPath, options) => {\n const fullPath = path.resolve(process.cwd(), shaderPath);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Shader file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n const source = fs.readFileSync(fullPath, 'utf-8');\n const controls = parseControls(source);\n\n if (options.json) {\n console.log(JSON.stringify(controls, null, 2));\n return;\n }\n\n if (controls.length === 0) {\n console.log(`No @control annotations found in ${path.basename(shaderPath)}.`);\n return;\n }\n\n console.log(`Controls in ${path.basename(shaderPath)} (${controls.length}):`);\n for (const c of controls) {\n const defVal = Array.isArray(c.default) ? `[${c.default.join(', ')}]` : String(c.default);\n console.log(\n ` • ${c.name} (${c.type}): \"${c.label}\" | default=${defVal} | range=[${c.min}, ${c.max}] (line ${c.line})`\n );\n }\n });\n\nprogram\n .command('html <shaderPath>')\n .description('Generate a self-contained standalone HTML page running the shader')\n .option('-t, --title <title>', 'Page title')\n .option('-o, --out <outputPath>', 'Output HTML path')\n .option('-v, --values <jsonOrFile>', 'Control values as JSON string or path to JSON file')\n .option('--open', 'Open generated HTML page in default browser', false)\n .action((shaderPath, options) => {\n const fullPath = path.resolve(process.cwd(), shaderPath);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Shader file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n const source = fs.readFileSync(fullPath, 'utf-8');\n const title = options.title || path.basename(shaderPath, path.extname(shaderPath));\n\n let values: Record<string, ControlValue> = {};\n if (options.values) {\n try {\n if (fs.existsSync(options.values)) {\n values = JSON.parse(fs.readFileSync(options.values, 'utf-8'));\n } else {\n values = JSON.parse(options.values);\n }\n } catch (err: any) {\n console.error(`Error parsing values: ${err.message}`);\n process.exit(1);\n }\n }\n\n const htmlContent = standaloneHtml(title, source, values);\n const outputPath = path.resolve(\n process.cwd(),\n options.out || `${path.basename(shaderPath, path.extname(shaderPath))}.html`\n );\n\n fs.mkdirSync(path.dirname(outputPath), { recursive: true });\n fs.writeFileSync(outputPath, htmlContent, 'utf-8');\n console.log(`Generated standalone shader page at: ${outputPath}`);\n\n if (options.open) {\n exec(`open \"${outputPath}\"`);\n }\n });\n\nprogram\n .command('export <targetOrShader> [extraPath] [outputPath]')\n .description('Export a shader file to video (.mp4/.webm/.mov), .gif or .png frames, or a scene to motn/lottie/fcp7/edl')\n .option('-o, --out <outputPath>', 'Output file path')\n .option('-w, --width <width>', 'Canvas width', '720')\n .option('-h, --height <height>', 'Canvas height', '720')\n .option('--fps <fps>', 'Frames per second', '30')\n .option('-d, --duration <duration>', 'Duration in seconds', '3')\n .option('-v, --values <jsonOrFile>', 'Control values as JSON string or file')\n .option('--alpha', 'Keep the shader alpha (webm, mov, gif, png)', false)\n .option('--transparent', 'The shader is an overlay: composite its alpha over --background', false)\n .option('--background <css>', 'Colour under transparent pixels without --alpha', '#000000')\n .option('--pointer', 'Act out a pointer that hovers, wanders and clicks', false)\n .action(async (targetOrShader, extraPath, outputPath, options) => {\n if (targetOrShader === 'motn' || targetOrShader === 'lottie' || targetOrShader === 'fcp7' || targetOrShader === 'edl') {\n const sceneFile = extraPath;\n if (!sceneFile) {\n console.error(`Error: Please provide a scene JSON file to export: flair export ${targetOrShader} <scene.json> [output]`);\n process.exit(1);\n }\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportMotn, exportLottie, exportFcp7Xml, exportCmx3600Edl } = await import('./export/index.js');\n const fps = parseInt(options.fps, 10);\n\n let content: string;\n let ext: string;\n if (targetOrShader === 'motn') {\n content = exportMotn(scene, { frameRate: fps });\n ext = 'motn';\n } else if (targetOrShader === 'lottie') {\n content = JSON.stringify(exportLottie(scene, { frameRate: fps }), null, 2);\n ext = 'json';\n } else if (targetOrShader === 'fcp7') {\n content = exportFcp7Xml(scene, { frameRate: fps });\n ext = 'xml';\n } else {\n content = exportCmx3600Edl(scene, { frameRate: fps });\n ext = 'edl';\n }\n\n const destination = path.resolve(\n process.cwd(),\n options.out || outputPath || `${scene.name || 'scene'}.${ext}`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, content, 'utf-8');\n console.log(`✅ Successfully exported ${targetOrShader.toUpperCase()} to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to ${targetOrShader}: ${err.message}`);\n process.exit(1);\n }\n return;\n }\n\n const shaderPath = targetOrShader;\n const fullPath = path.resolve(process.cwd(), shaderPath);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Shader file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n if (!options.out) {\n console.error('Error: Output file path required (-o, --out <outputPath>)');\n process.exit(1);\n }\n\n const source = fs.readFileSync(fullPath, 'utf-8');\n\n let values: Record<string, ControlValue> = {};\n if (options.values) {\n try {\n if (fs.existsSync(options.values)) {\n values = JSON.parse(fs.readFileSync(options.values, 'utf-8'));\n } else {\n values = JSON.parse(options.values);\n }\n } catch (err: any) {\n console.error(`Error parsing values: ${err.message}`);\n process.exit(1);\n }\n }\n\n const width = parseInt(options.width, 10);\n const height = parseInt(options.height, 10);\n const fps = parseInt(options.fps, 10);\n const duration = parseFloat(options.duration);\n\n console.log(`Rendering ${duration}s (${duration * fps} frames at ${width}x${height}, ${fps}fps) to ${options.out}...`);\n\n try {\n const { exportMotionGraphic } = await import('./export/recorder.js');\n const savedPath = await exportMotionGraphic({\n source,\n values,\n outputPath: options.out,\n width,\n height,\n fps,\n duration,\n alpha: options.alpha,\n transparent: options.transparent,\n background: options.background,\n pointer: options.pointer ? 'auto' : 'none',\n onProgress: (frame, total) => {\n process.stdout.write(`\\rRendering frame ${frame}/${total} (${Math.round((frame / total) * 100)}%)`);\n },\n });\n console.log(`\\n✅ Successfully exported motion graphic to: ${savedPath}`);\n } catch (err: any) {\n console.error(`\\nExport failed: ${err.message}`);\n process.exit(1);\n }\n });\n\n// ==========================================\n// Catalog Commands\n// ==========================================\nconst collect = (value: string, previous: string[]) => [...previous, value];\n\nprogram\n .command('effects')\n .description('List catalog effects with what they take (image, video, svg, text, mask, path) and how they answer the pointer')\n .option('--accepts <inputs>', 'Only effects that take all of these (image, video, svg, text, mask, path; comma-separated or repeated)', collect, [])\n .option('--interaction <ways>', 'Only effects that answer the pointer in one of these ways (hover, press, click, trail, pointer)', collect, [])\n .option('--category <category>', 'Only this category')\n .option('--kind <kind>', 'shader or vector')\n .option('--search <words>', 'Words to look for in the id, name, description and tags')\n .option('--json', 'Output JSON (id, name, kind, category, description, inputs, presets)', false)\n .action(async (options) => {\n try {\n const { findEffects, effectInputs } = await import('./catalog/index.js');\n const { effectQueryFromFlags, describeEffect } = await import('./export/effect.js');\n const effects = findEffects(effectQueryFromFlags(options));\n if (options.json) {\n console.log(JSON.stringify(effects.map((e) => ({ id: e.id, name: e.name, kind: e.kind, category: e.category, description: e.description, inputs: effectInputs(e), presets: e.presets?.map((p) => p.name) ?? [] })), null, 2));\n return;\n }\n if (!effects.length) {\n console.log('No effects match.');\n return;\n }\n for (const e of effects) console.log(describeEffect(e));\n console.log(`\\n${effects.length} effect${effects.length === 1 ? '' : 's'}. Render one with: flair render <id> [--image p | --text \"…\" | …] -o out.mp4`);\n } catch (err: any) {\n console.error(`Error: ${err.message}`);\n process.exit(1);\n }\n });\n\nprogram\n .command('render <effect>')\n .description('Render a catalog effect, applied to a subject, to .mp4, .webm, .mov, .gif, .svg (vector effects) or .png frames')\n .option('--image <path>', 'A picture (file path or URL); repeat for effects that take two', collect, [])\n .option('--svg <path>', 'An SVG (file path, URL or markup)', collect, [])\n .option('--text <text>', 'Words, for a text effect or a text mask', collect, [])\n .option('--font <family>', 'CSS font family for --text drawn into a shader')\n .option('--weight <weight>', 'Font weight for --text drawn into a shader')\n .option('--path <d>', 'SVG path data, for a shape control', collect, [])\n .option('--video <path>', 'A video file, decoded to frames with ffmpeg', collect, [])\n .option('--preset <name>', 'A preset by name')\n .option('--set <name=value>', 'A control value (repeatable): --set uSpeed=2 --set uTint=#ff0080', collect, [])\n .option('--size <WxH>', 'Pixels, like 1280x720')\n .option('--fps <fps>', 'Frames per second', '30')\n .option('--duration <seconds>', 'Seconds (default: the effect\\'s loop or play-through)')\n .option('--alpha', 'Keep transparency (webm, mov, gif, png, svg)', false)\n .option('--background <css>', 'Colour under transparent pixels without --alpha')\n .option('--no-pointer', 'Leave the pointer still (interactive effects otherwise get a scripted pointer)')\n .option('-o, --out <outputPath>', 'Output: .mp4, .webm, .mov, .gif, .svg, a .png pattern (out_%04d.png) or a folder')\n .action(async (effectId, options) => {\n try {\n if (!options.out) throw new Error('Say where to write it: -o out.mp4 (or .webm, .mov, .gif, .svg, out_%04d.png, a folder/).');\n const { exportEffect, parseSets, parseSize, resolveEffect, subjectsFromFlags } = await import('./export/effect.js');\n const effect = resolveEffect(effectId);\n const subjects = subjectsFromFlags(options);\n const size = options.size ? parseSize(options.size) : undefined;\n const fps = Number(options.fps);\n if (!(fps > 0)) throw new Error(`--fps takes a positive number, not \"${options.fps}\".`);\n const duration = options.duration === undefined ? undefined : Number(options.duration);\n if (duration !== undefined && !(duration > 0)) throw new Error(`--duration takes seconds, more than 0, not \"${options.duration}\".`);\n console.log(`Rendering ${effect.id} to ${options.out}...`);\n const saved = await exportEffect(effect, {\n ...(subjects.length ? { subject: subjects } : {}),\n ...(options.preset ? { preset: options.preset } : {}),\n values: parseSets(effect, options.set),\n outputPath: options.out,\n ...(size ?? {}),\n fps,\n ...(duration !== undefined ? { duration } : {}),\n alpha: options.alpha,\n ...(options.background ? { background: options.background } : {}),\n ...(options.pointer === false ? { pointer: 'none' as const } : {}),\n onProgress: (frame, total) => {\n if (total > 1) process.stdout.write(`\\rFrame ${frame}/${total} (${Math.round((frame / total) * 100)}%)`);\n },\n });\n console.log(`\\nWrote ${saved}`);\n } catch (err: any) {\n console.error(`\\nRender failed: ${err.message}`);\n process.exit(1);\n }\n });\n\n// ==========================================\n// Scene Directing Commands\n// ==========================================\nconst sceneCmd = program\n .command('scene')\n .description('Direct, validate, simulate, and render multi-shot animated scenes');\n\nsceneCmd\n .command('validate <sceneFile>')\n .description('Validate scene JSON structure, camera framing, and effect IDs')\n .action((sceneFile) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const issues = validateScene(scene);\n if (issues.length === 0) {\n console.log(`✅ Scene \"${scene.name}\" is valid (${scene.shots.length} shots).`);\n } else {\n console.warn(`Found ${issues.length} issue(s) in \"${scene.name}\":`);\n for (const iss of issues) {\n const loc = iss.shot === 0 ? 'Scene' : `Shot ${iss.shot}`;\n console.warn(` • [${loc}] ${iss.message}`);\n }\n process.exit(1);\n }\n } catch (err: any) {\n console.error(`Error reading scene: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('review <sceneFile>')\n .alias('preview')\n .description('Simulate scene off-screen and generate timing breakdown & diagnostic review')\n .action(async (sceneFile) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { review } = await simulateScene(scene);\n console.log(review.markdown);\n } catch (err: any) {\n console.error(`Error reviewing scene: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('html <sceneFile>')\n .description('Generate standalone interactive web player for the scene')\n .option('-o, --out <outputPath>', 'Output HTML path')\n .option('--open', 'Open generated HTML in browser', false)\n .action((sceneFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const htmlContent = standaloneSceneHtml(scene);\n const outputPath = path.resolve(\n process.cwd(),\n options.out || `${scene.name || 'scene'}.html`\n );\n\n fs.mkdirSync(path.dirname(outputPath), { recursive: true });\n fs.writeFileSync(outputPath, htmlContent, 'utf-8');\n console.log(`Generated standalone scene player at: ${outputPath}`);\n\n if (options.open) {\n exec(`open \"${outputPath}\"`);\n }\n } catch (err: any) {\n console.error(`Error generating scene HTML: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('motn <sceneFile> [outFile]')\n .description('Export scene to Apple Motion ozml 4.0 XML (.motn) document')\n .option('--fps <fps>', 'Target frame rate', '30')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportMotn } = await import('./export/index.js');\n const xml = exportMotn(scene, { frameRate: parseInt(options.fps, 10) });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.motn`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, xml, 'utf-8');\n console.log(`✅ Successfully exported Apple Motion scene to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to .motn: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('lottie <sceneFile> [outFile]')\n .description('Export scene vector shapes and animations to Lottie JSON')\n .option('--fps <fps>', 'Target frame rate', '30')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportLottie } = await import('./export/index.js');\n const animation = exportLottie(scene, { frameRate: parseInt(options.fps, 10) });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.json`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, JSON.stringify(animation, null, 2), 'utf-8');\n console.log(`✅ Successfully exported Lottie animation to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to Lottie: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('fcp7 <sceneFile> [outFile]')\n .description('Export scene timeline and markers to Final Cut Pro 7 XML (xmeml v4)')\n .option('--fps <fps>', 'Target frame rate', '30')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportFcp7Xml } = await import('./export/index.js');\n const xml = exportFcp7Xml(scene, { frameRate: parseInt(options.fps, 10) });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.xml`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, xml, 'utf-8');\n console.log(`✅ Successfully exported FCP7 XML to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to FCP7 XML: ${err.message}`);\n process.exit(1);\n }\n });\n\nsceneCmd\n .command('edl <sceneFile> [outFile]')\n .description('Export scene edit decision list to standard CMX 3600 EDL')\n .option('--fps <fps>', 'Target frame rate', '30')\n .option('--reel <reel>', 'Reel name identifier', 'AX')\n .action(async (sceneFile, outFile, options) => {\n const fullPath = path.resolve(process.cwd(), sceneFile);\n if (!fs.existsSync(fullPath)) {\n console.error(`Error: Scene file not found at: ${fullPath}`);\n process.exit(1);\n }\n\n try {\n const scene: Scene = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));\n const { exportCmx3600Edl } = await import('./export/index.js');\n const edl = exportCmx3600Edl(scene, {\n frameRate: parseInt(options.fps, 10),\n reel: options.reel,\n });\n const destination = path.resolve(\n process.cwd(),\n outFile || `${scene.name || 'scene'}.edl`\n );\n fs.mkdirSync(path.dirname(destination), { recursive: true });\n fs.writeFileSync(destination, edl, 'utf-8');\n console.log(`✅ Successfully exported CMX 3600 EDL to: ${destination}`);\n } catch (err: any) {\n console.error(`Error exporting scene to CMX 3600 EDL: ${err.message}`);\n process.exit(1);\n }\n });\n\n\nprogram.parse(process.argv);\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AAM,QAAQ,OAAO;AAAA,IACrC;AACA,OAAG,UAAU,KAAK,QAAQ,WAAW,GAAG,EAAE,WAAW,KAAK,CAAC;AAC3D,OAAG,cAAc,aAAa,KAAK,OAAO;AAC1C,YAAQ,IAAI,iDAA4C,WAAW,EAAE;AAAA,EACvE,SAAS,KAAU;AACjB,YAAQ,MAAM,0CAA0C,IAAI,OAAO,EAAE;AACrE,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QAAQ,MAAM,QAAQ,IAAI;","names":["fullPath","fps"]}
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { AnimationEasingPreset, AnimationEasing, AnimationTrack, AnimationKeyfra
|
|
|
5
5
|
export { CubicBezierEasing, SpringEasing } from '@pixerate/editor/animation';
|
|
6
6
|
import { CommandRegistry, CommandSpec } from '@pixerate/editor/commands';
|
|
7
7
|
import { HistoryManager, HistoryState } from '@pixerate/editor/history';
|
|
8
|
-
import { C as CompileError, a as CompileStatus } from '../renderer-
|
|
8
|
+
import { C as CompileError, a as CompileStatus } from '../renderer-teaa98RE.js';
|
|
9
9
|
import { AgentToolProvider, McpToolResult, ToolRegistryOptions, ToolRegistry, McpToolDefinition } from '@pixerate/editor/tools';
|
|
10
10
|
import { ParameterImageOption, ParametersController, ParameterField, ParameterSchema, ParameterValue, ParameterValues } from '@pixerate/editor/parameters';
|
|
11
11
|
|
package/dist/editor/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
interpolateOklab
|
|
3
|
+
} from "../chunk-DBTLCXKY.js";
|
|
4
|
+
import {
|
|
5
|
+
BUILTIN_UNIFORMS
|
|
6
|
+
} from "../chunk-RDU63CDO.js";
|
|
1
7
|
import {
|
|
2
8
|
EFFECT_CATEGORIES,
|
|
3
9
|
EFFECT_INPUTS,
|
|
@@ -9,25 +15,21 @@ import {
|
|
|
9
15
|
renderVectorEffect,
|
|
10
16
|
vectorControlIssues,
|
|
11
17
|
vectorEffectControls
|
|
12
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-PYDN5G2P.js";
|
|
19
|
+
import "../chunk-EHDJ3CPJ.js";
|
|
20
|
+
import {
|
|
21
|
+
checkControlValue,
|
|
22
|
+
controlValue,
|
|
23
|
+
parseControls
|
|
24
|
+
} from "../chunk-VYOMXE6I.js";
|
|
13
25
|
import {
|
|
14
26
|
svgMotionIssues,
|
|
15
27
|
svgView
|
|
16
28
|
} from "../chunk-PFGGPIMT.js";
|
|
17
|
-
import "../chunk-OHW7UG6D.js";
|
|
18
|
-
import {
|
|
19
|
-
BUILTIN_UNIFORMS,
|
|
20
|
-
interpolateOklab
|
|
21
|
-
} from "../chunk-ARKC7LDW.js";
|
|
22
|
-
import "../chunk-EHDJ3CPJ.js";
|
|
23
29
|
import {
|
|
24
30
|
realClock
|
|
25
31
|
} from "../chunk-WMZQCUFJ.js";
|
|
26
|
-
import
|
|
27
|
-
checkControlValue,
|
|
28
|
-
controlValue,
|
|
29
|
-
parseControls
|
|
30
|
-
} from "../chunk-VYOMXE6I.js";
|
|
32
|
+
import "../chunk-ORAFCHX3.js";
|
|
31
33
|
|
|
32
34
|
// src/editor/timeline.ts
|
|
33
35
|
import {
|