@pixerate/flair 0.24.0 → 0.26.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 +27 -0
- package/README.md +1 -0
- package/dist/catalog/index.js +2 -2
- package/dist/{chunk-WAMA45G3.js → chunk-5USSDEQL.js} +77 -21
- package/dist/chunk-5USSDEQL.js.map +1 -0
- package/dist/{chunk-GTIAOYOK.js → chunk-74ZLCZOG.js} +13 -10
- package/dist/chunk-74ZLCZOG.js.map +1 -0
- package/dist/{chunk-NGKNI3QX.js → chunk-CK6EV37I.js} +19 -495
- package/dist/chunk-CK6EV37I.js.map +1 -0
- package/dist/chunk-DBTLCXKY.js +332 -0
- package/dist/chunk-DBTLCXKY.js.map +1 -0
- package/dist/chunk-G2B5L234.js +414 -0
- package/dist/chunk-G2B5L234.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-OQ4EWZ3B.js → chunk-HVXWNGTW.js} +83 -6
- package/dist/{chunk-OQ4EWZ3B.js.map → chunk-HVXWNGTW.js.map} +1 -1
- package/dist/chunk-JL6TI6II.js +724 -0
- package/dist/chunk-JL6TI6II.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-ARKC7LDW.js → chunk-RDU63CDO.js} +2 -331
- package/dist/chunk-RDU63CDO.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-UCZ43ARE.js +902 -0
- package/dist/chunk-UCZ43ARE.js.map +1 -0
- package/dist/chunk-YBGRXVAE.js +407 -0
- package/dist/chunk-YBGRXVAE.js.map +1 -0
- package/dist/cli.js +74 -11
- 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-GGH3OSOT.js +47 -0
- package/dist/embed/index.d.ts +215 -0
- package/dist/embed/index.js +21 -0
- package/dist/{export-DH2HMACO.js → export-QVW474KM.js} +3 -3
- package/dist/export-QVW474KM.js.map +1 -0
- package/dist/frames-VEcqa40g.d.ts +161 -0
- package/dist/index.d.ts +47 -164
- package/dist/index.js +102 -80
- 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-GTIAOYOK.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/chunk-WAMA45G3.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/{export-DH2HMACO.js.map → effect-GGH3OSOT.js.map} +0 -0
- /package/dist/{recorder-HKFFHQES.js.map → embed/index.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vector/animated.ts"],"sourcesContent":["/**\n * An {@link SvgMotion} as one self-contained animated `.svg` file, with no\n * DOM and no script: its changes written as SMIL (`<animate>`,\n * `<animateTransform>`, `<animateMotion>`), so it plays on its own wherever\n * an SVG image does (an `<img src>`, a file opened directly, inline markup).\n */\n\nimport { pathPointAt } from \"./morph.js\";\nimport {\n STEP_MS,\n SVG_PICTURE,\n stepStart,\n svgFrame,\n type EaseName,\n type SvgAnimation,\n type SvgBox,\n type SvgElementFrame,\n type SvgMotion,\n} from \"./motion.js\";\nimport { getAttr, serialize, setAttr, svgFrameTree, type SvgNode } from \"./static.js\";\nimport { svgDuration } from \"./svg.js\";\n\nexport interface AnimatedSvgOptions {\n /** Loop length in ms (default: `svgDuration(motion, steps)` + `hold`). */\n duration?: number;\n /** Ms to rest on the last frame before looping (default 600, like `SvgPlayer`). */\n hold?: number;\n /** Loop forever (default true); false plays once and holds the last frame. */\n loop?: boolean;\n /** Step start times in ms, for pictures that change on steps (like `SvgPlayer`'s `steps`). */\n steps?: readonly number[];\n /**\n * Samples per second for what cannot be written exactly (counts, written\n * text, a change cut short by the next, a `matrix` transform); default 30.\n */\n fps?: number;\n /**\n * Added to the ids the picture refers to (its gradients, filters, clips,\n * paths followed), so two files inlined in one page each use their own.\n * Default: a hash of the motion, so the same motion gives the same file;\n * `\"\"` keeps ids as written.\n */\n idSuffix?: string;\n}\n\n/** How a value gets to a keyframe from the one before: the shapes `EASES` are made of. */\ntype Shape = \"linear\" | \"in\" | \"out\";\n\n/** A channel's value at a time, reached from the keyframe before along `shape`. */\ninterface Key {\n t: number;\n v: string;\n shape: Shape;\n}\n\n/** One change to a channel, when it starts. */\ninterface Change {\n anim: SvgAnimation;\n start: number;\n}\n\n/**\n * Cubic Bézier timing for each shape. `out` (1 − (1 − t)³) is exactly the\n * curve (0, 1, 1, 1), and `in-out` is `in` (t³, the curve (0, 0, 0, 1)) to\n * its middle then `out`, so eases are written exactly, not sampled.\n */\nconst SPLINES: Record<Shape, string> = { linear: \"0 0 1 1\", in: \"0.3333 0 0.6667 0\", out: \"0.3333 1 0.6667 1\" };\n\n/** When an ease is halfway (where a value that cannot blend switches), as a share of its time. */\nconst HALFWAY: Record<EaseName, number> = { linear: 0.5, \"in-out\": 0.5, out: 1 - 0.5 ** (1 / 3) };\n\nconst NUMBER = /-?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[-+]?\\d+)?/gi;\nconst HEX = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst TRANSFORMS = new Set([\"transform\", \"gradienttransform\", \"patterntransform\"]);\nconst URL_REF = /url\\(\\s*(['\"]?)#([^'\")\\s]+)\\1\\s*\\)/g;\n\n/** Whether `lerpAttr` blends two values (else it switches halfway), so SMIL can interpolate them. */\nfunction blends(a: string | number, b: string | number): boolean {\n if (typeof a === \"number\" && typeof b === \"number\") return true;\n const [sa, sb] = [String(a), String(b)];\n if (HEX.test(sa) && HEX.test(sb)) return true;\n const na = sa.match(NUMBER) ?? [];\n return na.length > 0 && na.length === (sb.match(NUMBER) ?? []).length && sa.replace(NUMBER, \"#\") === sb.replace(NUMBER, \"#\");\n}\n\nconst num = (n: number) => String(+n.toFixed(3));\n\n/** A short, stable hash of a string, for default id suffixes. */\nfunction hash(s: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < s.length; i++) h = Math.imul(h ^ s.charCodeAt(i), 0x01000193);\n return (h >>> 0).toString(36);\n}\n\n/** An element: `<tag attrs/>`. */\nconst node = (tag: string, attrs: Record<string, string | undefined>, children: SvgNode[\"children\"] = []): SvgNode => ({\n tag,\n attrs: Object.entries(attrs).filter((e): e is [string, string] => e[1] !== undefined),\n children,\n});\n\n/**\n * The transform functions in a `transform` value, with their arguments:\n * `translate(10 20) rotate(45)` → [[\"translate\", [10, 20]], [\"rotate\", [45]]].\n */\nfunction transformList(value: string): [string, number[]][] {\n return [...value.matchAll(/([a-z]+)\\s*\\(([^)]*)\\)/gi)].map((m) => [m[1]!, (m[2]!.match(NUMBER) ?? []).map(Number)]);\n}\n\n/** A transform list as one matrix [a b c d e f]. */\nfunction transformMatrix(value: string): number[] {\n let m = [1, 0, 0, 1, 0, 0];\n const times = (n: number[]) => {\n const [a, b, c, d, e, f] = m as [number, number, number, number, number, number];\n m = [a * n[0]! + c * n[1]!, b * n[0]! + d * n[1]!, a * n[2]! + c * n[3]!, b * n[2]! + d * n[3]!, a * n[4]! + c * n[5]! + e, b * n[4]! + d * n[5]! + f];\n };\n const rad = Math.PI / 180;\n for (const [name, [p = 0, q, r = 0, s = 0, t = 0, u = 0]] of transformList(value)) {\n if (name === \"translate\") times([1, 0, 0, 1, p, q ?? 0]);\n else if (name === \"scale\") times([p, 0, 0, q ?? p, 0, 0]);\n else if (name === \"rotate\") {\n const [cos, sin] = [Math.cos(p * rad), Math.sin(p * rad)];\n const [cx, cy] = [q ?? 0, r];\n times([1, 0, 0, 1, cx, cy]);\n times([cos, sin, -sin, cos, 0, 0]);\n times([1, 0, 0, 1, -cx, -cy]);\n } else if (name === \"skewX\") times([1, 0, Math.tan(p * rad), 1, 0, 0]);\n else if (name === \"skewY\") times([1, Math.tan(p * rad), 0, 1, 0, 0]);\n else if (name === \"matrix\") times([p, q ?? 0, r, s, t, u]);\n }\n return m;\n}\n\n/** A matrix as translate · rotate · skewX · scale (degrees), the order SMIL can add them in. */\nfunction decompose([a, b, c, d, e, f]: number[]): [number, number, number, number, number, number] {\n const sx = Math.hypot(a!, b!);\n const angle = sx ? Math.atan2(b!, a!) : 0;\n const [cos, sin] = [Math.cos(angle), Math.sin(angle)];\n const sy = -sin * c! + cos * d!;\n const skew = sy ? Math.atan((cos * c! + sin * d!) / sy) : 0;\n return [e!, f!, (angle * 180) / Math.PI, (skew * 180) / Math.PI, sx, sy];\n}\n\n/** A shape's outline as a path `d`, for following it with `along`. */\nfunction outline(el: SvgNode): string | undefined {\n const at = (name: string) => Number(getAttr(el, name) ?? 0);\n switch (el.tag.toLowerCase()) {\n case \"path\":\n return getAttr(el, \"d\");\n case \"line\":\n return `M${at(\"x1\")} ${at(\"y1\")}L${at(\"x2\")} ${at(\"y2\")}`;\n case \"polyline\":\n case \"polygon\":\n return `M${getAttr(el, \"points\") ?? \"\"}${el.tag.toLowerCase() === \"polygon\" ? \"Z\" : \"\"}`;\n default:\n return undefined;\n }\n}\n\n/**\n * The timing attributes that play `keys` over the loop: `keyTimes` and,\n * where a key eases in, `keySplines`. Keys at the same time are a jump.\n */\nfunction timing(keys: readonly Key[], loop: number, repeat: boolean, discrete = false): Record<string, string | undefined> {\n const spline = !discrete && keys.some((k, i) => i > 0 && k.shape !== \"linear\");\n return {\n ...clock(loop, repeat),\n keyTimes: keys.map((k) => String(+(k.t / loop).toFixed(5))).join(\";\"),\n calcMode: discrete ? \"discrete\" : spline ? \"spline\" : \"linear\",\n keySplines: spline ? keys.slice(1).map((k) => SPLINES[k.shape]).join(\";\") : undefined,\n };\n}\n\n/** How long an animation runs, and whether it repeats or holds its end. */\nconst clock = (loop: number, repeat: boolean) => ({\n dur: `${+(loop / 1000).toFixed(4)}s`,\n repeatCount: repeat ? \"indefinite\" : undefined,\n fill: repeat ? undefined : \"freeze\",\n});\n\n/** Keys with their repeats dropped: a key between two of the same value, or a copy of the one before. */\nfunction collapse(keys: Key[]): Key[] {\n const out: Key[] = [];\n keys.forEach((k, i) => {\n const prev = out[out.length - 1];\n if (prev && prev.v === k.v && (prev.t === k.t || (keys[i + 1]?.v === k.v && i < keys.length - 1))) return;\n out.push(k);\n });\n return out;\n}\n\n/** Keys reduced to where the value changes, for a discrete animation (the last at a time wins). */\nfunction runs(keys: readonly Key[]): Key[] {\n const out: Key[] = [];\n for (const k of keys) {\n const prev = out[out.length - 1];\n if (prev?.t === k.t) out.pop();\n if (out[out.length - 1]?.v !== k.v) out.push(k);\n }\n return out;\n}\n\n/**\n * The {@link SvgMotion} as one animated SVG file that plays and loops on its\n * own, as `SvgPlayer` plays it, with no script: save it as `.svg`, put it in\n * an `<img src>`, or inline it. Each element starts as the motion's first\n * frame, so it still shows that where SMIL does not run.\n *\n * Attribute changes become one `<animate>` per attribute (`<animateTransform>`\n * per function of a `transform`), with the eases written exactly as splines;\n * `draw` animates `stroke-dashoffset`; `along` becomes `<animateMotion>` on\n * the path; `view` animates the root `viewBox` (keeping `data-fixed` and\n * `data-nonscaling` elements as the player does); `solo` toggles `display`.\n * Counts and written text are sampled at `fps`, each text shown in its own\n * `<tspan>` in turn.\n *\n * Limits: a `view` that frames an element by id stays where it is (it needs\n * layout, as in `svgFrameMarkup`); `style` and other attributes SMIL cannot\n * interpolate change in steps; ids are suffixed only where the picture\n * refers to them (CSS `#id` selectors in a `<style>` are left as written).\n * Undefined when `motion.svg` is not an `<svg>`.\n */\nexport function svgAnimatedMarkup(motion: SvgMotion, options: AnimatedSvgOptions = {}): string | undefined {\n const steps = options.steps ?? [];\n const repeat = options.loop ?? true;\n const fps = options.fps ?? 30;\n const loop = Math.max(1, options.duration ?? svgDuration(motion, steps) + (options.hold ?? 600));\n const animations = motion.animate ?? [];\n const tree = svgFrameTree(motion, steps, 0);\n if (!tree) return undefined;\n const { svg, byId, whole } = tree;\n\n // Each property's changes in the order they start, as `svgFrame` keeps them.\n const tracks = new Map<string, Change[]>();\n animations.forEach((anim) => {\n const s = stepStart(steps, anim.step ?? 0);\n const start = s === undefined ? Infinity : s + (anim.delay ?? 0);\n const add = (prop: string) => {\n const key = `${prop === \"view\" ? SVG_PICTURE : anim.id}\\u0000${prop}`;\n tracks.set(key, [...(tracks.get(key) ?? []), { anim, start }]);\n };\n for (const name of Object.keys(anim.attrs ?? {})) add(`@${name}`);\n if (anim.draw) add(\"draw\");\n if (anim.count || anim.write !== undefined) add(\"text\");\n if (anim.solo !== undefined) add(\"solo\");\n if (anim.view !== undefined) add(\"view\");\n if (anim.along) add(\"along\");\n });\n for (const list of tracks.values()) list.sort((x, y) => x.start - y.start);\n\n const frames = new Map<number, Map<string, SvgElementFrame>>();\n const frameAt = (t: number) => {\n let f = frames.get(t);\n if (!f) frames.set(t, (f = svgFrame(animations, steps, t)));\n return f;\n };\n const boxOf = (v: SvgBox | string | null) => (v === null ? whole : typeof v === \"string\" ? undefined : v);\n /** A channel's value in a frame, as written into the file. */\n const read = (frame: Map<string, SvgElementFrame>, id: string, prop: string): string | undefined => {\n const f = frame.get(id);\n if (!f) return undefined;\n if (prop.startsWith(\"@\")) return f.attrs[prop.slice(1)];\n if (prop === \"draw\") return f.draw === undefined ? undefined : num(1 - f.draw);\n if (prop === \"along\") return f.along && num(f.along.at);\n if (prop === \"solo\") return f.solo === undefined ? undefined : String(f.solo);\n if (prop === \"text\") return f.text;\n if (!f.view) return undefined;\n const [a, b] = [boxOf(f.view.from), boxOf(f.view.to)];\n const box = a && b ? a.map((n, i) => n + (b[i]! - n) * f.view!.u) : (b ?? a ?? whole);\n return box?.map(num).join(\" \");\n };\n\n /**\n * A channel's keyframes over the loop: before its first change its start,\n * then each change from its start to its end (or the next change), eased\n * exactly or (with `sampled`, or when cut short) sampled at `fps`.\n */\n const keyframes = (id: string, prop: string, list: readonly Change[], sampled = false): Key[] => {\n const shown = list.filter((c, i) => c.start < loop && !(list[i + 1] && list[i + 1]!.start <= c.start));\n // A change alone (with the one before it, where a view starts) gives its own value at any time.\n const value = (k: number, t: number) =>\n read(svgFrame(shown.slice(Math.max(0, k - 1), k + 1).map((c) => c.anim), steps, t), id, prop) ?? \"\";\n const keys: Key[] = [];\n const push = (t: number, v: string, shape: Shape = \"linear\") => keys.push({ t, v, shape });\n if (!shown.length) return [];\n push(0, read(frameAt(0), id, prop) ?? value(0, 0));\n shown.forEach((c, k) => {\n const next = Math.min(shown[k + 1]?.start ?? loop, loop);\n const ms = c.anim.ms ?? STEP_MS;\n const end = Math.min(c.start + ms, next);\n // Held until it starts, where it may jump.\n push(c.start, keys[keys.length - 1]!.v);\n push(c.start, value(k, c.start));\n if (!(ms > 0)) return;\n const ease = c.anim.ease ?? \"in-out\";\n const pair = prop.startsWith(\"@\") ? c.anim.attrs![prop.slice(1)]! : undefined;\n if (pair && !blends(pair[0], pair[1])) {\n const at = c.start + ms * HALFWAY[ease];\n if (at < next) {\n push(at, value(k, c.start));\n push(at, value(k, end));\n }\n } else if (!sampled && end === c.start + ms && ease !== \"linear\") {\n if (ease === \"in-out\") push(c.start + ms / 2, value(k, c.start + ms / 2), \"in\");\n push(end, value(k, end), \"out\");\n } else if (!sampled && ease === \"linear\") push(end, value(k, end));\n else {\n for (let t = c.start + 1000 / fps; t < end; t += 1000 / fps) push(t, value(k, t));\n push(end, value(k, end));\n }\n });\n if (keys[keys.length - 1]!.t < loop) push(loop, keys[keys.length - 1]!.v);\n return collapse(keys);\n };\n\n /** Times to sample text at: every 1/fps, and wherever a change starts or ends. */\n const sampleTimes = (list: readonly Change[]) => {\n const times = new Set<number>();\n for (let t = 0; t < loop; t += 1000 / fps) times.add(+t.toFixed(3));\n for (const c of list)\n for (const t of [c.start, c.start + (c.anim.ms ?? STEP_MS)]) if (t < loop) times.add(t);\n return [...times].sort((a, b) => a - b);\n };\n\n // What to add to each element, appended once all are worked out (so a solo's children stay as written).\n const added = new Map<SvgNode, SvgNode[]>();\n const add = (el: SvgNode, ...anims: SvgNode[]) => added.set(el, [...(added.get(el) ?? []), ...anims]);\n const animate = (name: string, keys: readonly Key[], values = keys.map((k) => k.v), discrete = false) =>\n node(\"animate\", { attributeName: name, values: values.join(\";\"), ...timing(keys, loop, repeat, discrete) });\n const followers = new Set(animations.filter((a) => a.along).map((a) => a.id));\n let viewKeys: Key[] | undefined;\n\n for (const [key, list] of tracks) {\n const [id, prop] = key.split(\"\\u0000\") as [string, string];\n const el = id === SVG_PICTURE ? svg : byId.get(id);\n if (!el) continue;\n const name = prop.slice(1);\n if (prop === \"text\") {\n // One <tspan> per text it shows, each shown in its turn.\n const own = list.map((c) => c.anim);\n const text = (t: number) => read(svgFrame(own, steps, t), id, prop) ?? \"\";\n const shown: Key[] = [];\n let last = -1;\n for (const t of sampleTimes(list)) {\n const v = text(t);\n if (shown.length && v !== shown[shown.length - 1]!.v) {\n let [lo, hi] = [last, t];\n while (hi - lo > 0.5) {\n const mid = (lo + hi) / 2;\n if (text(mid) === shown[shown.length - 1]!.v) lo = mid;\n else hi = mid;\n }\n // One change between them is placed exactly; several (a fast count) change at the middle.\n shown.push({ t: text(hi) === v ? hi : (last + t) / 2, v, shape: \"linear\" });\n }\n if (v !== shown[shown.length - 1]?.v) shown.push({ t, v, shape: \"linear\" });\n last = t;\n }\n const texts = [...new Set(shown.map((k) => k.v))];\n el.children = texts.map((value, i) => {\n const keys = runs(shown.map((k) => ({ ...k, v: k.v === value ? \"inline\" : \"none\" })));\n const span = node(\"tspan\", { display: i === 0 ? undefined : \"none\" }, [value]);\n if (keys.length > 1) span.children.push(animate(\"display\", keys, undefined, true));\n return span;\n });\n continue;\n }\n if (prop.startsWith(\"@\") && TRANSFORMS.has(name.toLowerCase())) {\n if (followers.has(id) && name === \"transform\") continue;\n let keys = keyframes(id, prop, list);\n if (keys.length < 2) continue;\n const lists = keys.map((k) => transformList(k.v));\n const shape = (l: [string, number[]][]) => l.map(([f, args]) => `${f}${args.length}`).join(\" \");\n if (lists.every((l) => shape(l) === shape(lists[0]!)) && !/matrix|skewY/.test(shape(lists[0]!))) {\n // The same functions throughout: each animated on its own, added up in order.\n lists[0]!.forEach(([type], j) =>\n add(el, node(\"animateTransform\", {\n attributeName: name,\n type,\n additive: j ? \"sum\" : undefined,\n values: lists.map((l) => l[j]![1].map(num).join(\" \")).join(\";\"),\n ...timing(keys, loop, repeat),\n })),\n );\n } else {\n // Anything else as translate · rotate · skewX · scale, sampled, with the angle kept continuous.\n keys = keyframes(id, prop, list, true);\n const parts = keys.map((k) => decompose(transformMatrix(k.v)));\n parts.forEach((p, i) => {\n const before = parts[i - 1];\n if (before) p[2] += 360 * Math.round((before[2] - p[2]) / 360);\n });\n const types: [string, (p: number[]) => number[]][] = [\n [\"translate\", (p) => [p[0]!, p[1]!]],\n [\"rotate\", (p) => [p[2]!]],\n [\"skewX\", (p) => [p[3]!]],\n [\"scale\", (p) => [p[4]!, p[5]!]],\n ];\n types.forEach(([type, pick], j) =>\n add(el, node(\"animateTransform\", {\n attributeName: name,\n type,\n additive: j ? \"sum\" : undefined,\n values: parts.map((p) => pick(p).map(num).join(\" \")).join(\";\"),\n ...timing(keys, loop, repeat),\n })),\n );\n }\n continue;\n }\n if (prop === \"along\") {\n const paths = new Set(list.map((c) => c.anim.along!));\n const pathEl = byId.get([...paths][0]!);\n const d = pathEl && outline(pathEl);\n if (!d) continue;\n const point = (at: string) => pathPointAt(d, Number(at));\n const first = point(read(frameAt(0), id, prop) ?? \"0\");\n if (first) setAttr(el, \"transform\", `translate(${num(first[0])} ${num(first[1])})`);\n if (paths.size === 1 && pathEl.tag.toLowerCase() === \"path\") {\n // The browser follows the path itself: the markup's place (for no SMIL) set aside while it does.\n const keys = keyframes(id, prop, list);\n add(\n el,\n node(\"animateTransform\", { attributeName: \"transform\", type: \"translate\", values: \"0 0\", ...clock(loop, repeat) }),\n node(\"animateMotion\", { keyPoints: keys.map((k) => k.v).join(\";\"), ...timing(keys, loop, repeat) }, [\n node(\"mpath\", { href: `#${[...paths][0]}` }),\n ]),\n );\n } else {\n // Along several paths, or a shape SMIL cannot follow: its points, sampled.\n const keys = sampleTimes(list).map((t): Key => {\n const f = frameAt(t).get(id)?.along;\n const p = f && byId.get(f.path) && pathPointAt(outline(byId.get(f.path)!) ?? \"\", f.at);\n return { t, v: p ? `${num(p[0])} ${num(p[1])}` : \"0 0\", shape: \"linear\" };\n });\n keys.push({ t: loop, v: keys[keys.length - 1]!.v, shape: \"linear\" });\n const ks = collapse(keys);\n add(el, node(\"animateTransform\", { attributeName: \"transform\", type: \"translate\", values: ks.map((k) => k.v).join(\";\"), ...timing(ks, loop, repeat) }));\n }\n continue;\n }\n const keys = keyframes(id, prop, list);\n if (keys.length < 2) continue;\n if (prop === \"solo\") {\n const shown = runs(keys);\n let i = 0;\n for (const child of el.children) {\n if (typeof child === \"string\") continue;\n const index = String(i++);\n const toggles = runs(shown.map((k) => ({ ...k, v: k.v === index ? \"inline\" : \"none\" })));\n if (toggles.length > 1) add(child, animate(\"display\", toggles, undefined, true));\n }\n } else if (prop === \"view\") {\n viewKeys = keys;\n add(svg, animate(\"viewBox\", keys));\n } else add(el, animate(prop === \"draw\" ? \"stroke-dashoffset\" : name, keys));\n }\n\n if (viewKeys && whole) {\n // As the view zooms, `data-nonscaling` elements keep their size and `data-fixed` ones their place.\n const boxes = viewKeys.map((k) => k.v.split(\" \").map(Number));\n const all: SvgNode[] = [];\n const walk = (n: SvgNode) => {\n all.push(n);\n for (const c of n.children) if (typeof c !== \"string\") walk(c);\n };\n walk(svg);\n const zooms = boxes.map((b) => num(b[2]! / whole[2]));\n for (const el of all.filter((n) => getAttr(n, \"data-nonscaling\") !== undefined)) {\n setAttr(el, \"transform\", zooms[0] === \"1\" ? undefined : `scale(${zooms[0]})`);\n add(el, node(\"animateTransform\", { attributeName: \"transform\", type: \"scale\", values: zooms.join(\";\"), ...timing(viewKeys, loop, repeat) }));\n }\n const fixed = all.filter((n) => getAttr(n, \"data-fixed\") !== undefined);\n const top = fixed.filter((n) => !fixed.some((f) => f !== n && contains(f, n)));\n if (top.length) {\n for (const el of top) for (const n of all) n.children = n.children.filter((c) => c !== el);\n // A layer that maps the whole picture onto the view as it moves (as a nested <svg> with the\n // whole viewBox would, but with transforms, which images animate where they do not re-lay out one).\n const fit = boxes.map(([x, y, w, h]) => {\n const k = Math.min(w! / whole[2], h! / whole[3]);\n return { at: `${num(x! + (w! - whole[2] * k) / 2 - whole[0] * k)} ${num(y! + (h! - whole[3] * k) / 2 - whole[1] * k)}`, k: num(k) };\n });\n const layer = node(\"g\", { transform: `translate(${fit[0]!.at}) scale(${fit[0]!.k})` }, top);\n add(\n layer,\n node(\"animateTransform\", { attributeName: \"transform\", type: \"translate\", values: fit.map((f) => f.at).join(\";\"), ...timing(viewKeys, loop, repeat) }),\n node(\"animateTransform\", { attributeName: \"transform\", type: \"scale\", additive: \"sum\", values: fit.map((f) => f.k).join(\";\"), ...timing(viewKeys, loop, repeat) }),\n );\n svg.children.push(layer);\n }\n }\n\n for (const [el, anims] of added) el.children.push(...anims);\n scopeIds(svg, options.idSuffix ?? hash(motion.svg + JSON.stringify(animations)));\n setAttr(svg, \"width\", \"100%\");\n setAttr(svg, \"height\", \"100%\");\n setAttr(svg, \"xmlns\", \"http://www.w3.org/2000/svg\");\n const markup = serialize(svg);\n // Read as XML (an image, a file), `xlink:` attributes need their namespace declared.\n return /\\sxlink:/.test(markup) && !/\\sxmlns:xlink=/.test(markup)\n ? markup.replace(/^<svg/, '<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"')\n : markup;\n}\n\nconst contains = (outer: SvgNode, inner: SvgNode): boolean =>\n outer.children.some((c) => c === inner || (typeof c !== \"string\" && contains(c, inner)));\n\n/**\n * Gives the ids the picture refers to (by `url(#…)` or `href=\"#…\"`) `-suffix`,\n * and points the references at them, as a live player does.\n */\nfunction scopeIds(svg: SvgNode, suffix: string) {\n if (!suffix) return;\n const all: SvgNode[] = [];\n const walk = (n: SvgNode) => {\n all.push(n);\n for (const c of n.children) if (typeof c !== \"string\") walk(c);\n };\n walk(svg);\n const referred = new Set<string>();\n for (const n of all) {\n const css = n.tag.toLowerCase() === \"style\" ? n.children.filter((c): c is string => typeof c === \"string\") : [];\n for (const [name, value] of [...n.attrs, ...css.map((c) => [\"\", c] as const)]) {\n if (/^(xlink:)?href$/i.test(name) && value.startsWith(\"#\")) referred.add(value.slice(1));\n for (const m of value.matchAll(URL_REF)) referred.add(m[2]!);\n }\n }\n const ids = new Map<string, string>();\n for (const n of all) {\n const id = getAttr(n, \"id\");\n if (id && referred.has(id) && !ids.has(id)) ids.set(id, `${id}-${suffix}`);\n }\n if (!ids.size) return;\n const scoped = (value: string) =>\n value.replace(URL_REF, (whole, quote: string, id: string) => (ids.has(id) ? `url(${quote}#${ids.get(id)}${quote})` : whole));\n for (const n of all) {\n for (const attr of n.attrs) {\n if (attr[0] === \"id\") attr[1] = ids.get(attr[1]) ?? attr[1];\n else if (/^(xlink:)?href$/i.test(attr[0])) attr[1] = attr[1].startsWith(\"#\") && ids.has(attr[1].slice(1)) ? `#${ids.get(attr[1].slice(1))}` : attr[1];\n else attr[1] = scoped(attr[1]);\n }\n if (n.tag.toLowerCase() === \"style\") n.children = n.children.map((c) => (typeof c === \"string\" ? scoped(c) : c));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkEA,IAAM,UAAiC,EAAE,QAAQ,WAAW,IAAI,qBAAqB,KAAK,oBAAoB;AAG9G,IAAM,UAAoC,EAAE,QAAQ,KAAK,UAAU,KAAK,KAAK,IAAI,QAAQ,IAAI,GAAG;AAEhG,IAAM,SAAS;AACf,IAAM,MAAM;AACZ,IAAM,aAAa,oBAAI,IAAI,CAAC,aAAa,qBAAqB,kBAAkB,CAAC;AACjF,IAAM,UAAU;AAGhB,SAAS,OAAO,GAAoB,GAA6B;AAC/D,MAAI,OAAO,MAAM,YAAY,OAAO,MAAM,SAAU,QAAO;AAC3D,QAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AACtC,MAAI,IAAI,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,EAAG,QAAO;AACzC,QAAM,KAAK,GAAG,MAAM,MAAM,KAAK,CAAC;AAChC,SAAO,GAAG,SAAS,KAAK,GAAG,YAAY,GAAG,MAAM,MAAM,KAAK,CAAC,GAAG,UAAU,GAAG,QAAQ,QAAQ,GAAG,MAAM,GAAG,QAAQ,QAAQ,GAAG;AAC7H;AAEA,IAAM,MAAM,CAAC,MAAc,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAG/C,SAAS,KAAK,GAAmB;AAC/B,MAAI,IAAI;AACR,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,IAAK,KAAI,KAAK,KAAK,IAAI,EAAE,WAAW,CAAC,GAAG,QAAU;AAChF,UAAQ,MAAM,GAAG,SAAS,EAAE;AAC9B;AAGA,IAAM,OAAO,CAAC,KAAa,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AAM;AACf,QAAM,SAAS,CAAC,UACd,MAAM,QAAQ,SAAS,CAAC,OAAO,OAAe,OAAgB,IAAI,IAAI,EAAE,IAAI,OAAO,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC,GAAG,KAAK,MAAM,KAAM;AAC7H,aAAW,KAAK,KAAK;AACnB,eAAW,QAAQ,EAAE,OAAO;AAC1B,UAAI,KAAK,CAAC,MAAM,KAAM,MAAK,CAAC,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC;AAAA,eACjD,mBAAmB,KAAK,KAAK,CAAC,CAAC,EAAG,MAAK,CAAC,IAAI,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC;AAAA,UAC/I,MAAK,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC;AAAA,IAC/B;AACA,QAAI,EAAE,IAAI,YAAY,MAAM,QAAS,GAAE,WAAW,EAAE,SAAS,IAAI,CAAC,MAAO,OAAO,MAAM,WAAW,OAAO,CAAC,IAAI,CAAE;AAAA,EACjH;AACF;","names":["add","keys"]}
|
package/dist/cli.js
CHANGED
|
@@ -3,16 +3,18 @@ import {
|
|
|
3
3
|
standaloneHtml,
|
|
4
4
|
standaloneSceneHtml,
|
|
5
5
|
validateScene
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CK6EV37I.js";
|
|
7
7
|
import {
|
|
8
8
|
simulateScene
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-5USSDEQL.js";
|
|
10
|
+
import "./chunk-DBTLCXKY.js";
|
|
11
|
+
import "./chunk-H6VDFBIO.js";
|
|
12
|
+
import "./chunk-RDU63CDO.js";
|
|
11
13
|
import "./chunk-EHDJ3CPJ.js";
|
|
12
|
-
import "./chunk-WMZQCUFJ.js";
|
|
13
14
|
import {
|
|
14
15
|
parseControls
|
|
15
16
|
} from "./chunk-VYOMXE6I.js";
|
|
17
|
+
import "./chunk-WMZQCUFJ.js";
|
|
16
18
|
|
|
17
19
|
// src/cli.ts
|
|
18
20
|
import { Command } from "commander";
|
|
@@ -78,7 +80,7 @@ program.command("html <shaderPath>").description("Generate a self-contained stan
|
|
|
78
80
|
exec(`open "${outputPath}"`);
|
|
79
81
|
}
|
|
80
82
|
});
|
|
81
|
-
program.command("export <targetOrShader> [extraPath] [outputPath]").description("Export shader
|
|
83
|
+
program.command("export <targetOrShader> [extraPath] [outputPath]").description("Export a shader file to video (.mp4/.webm/.mov), .gif or .png frames, or a scene to motn/lottie/fcp7/edl").option("-o, --out <outputPath>", "Output file path").option("-w, --width <width>", "Canvas width", "720").option("-h, --height <height>", "Canvas height", "720").option("--fps <fps>", "Frames per second", "30").option("-d, --duration <duration>", "Duration in seconds", "3").option("-v, --values <jsonOrFile>", "Control values as JSON string or file").option("--alpha", "Keep the shader alpha (webm, mov, gif, png)", false).option("--transparent", "The shader is an overlay: composite its alpha over --background", false).option("--background <css>", "Colour under transparent pixels without --alpha", "#000000").option("--pointer", "Act out a pointer that hovers, wanders and clicks", false).action(async (targetOrShader, extraPath, outputPath, options) => {
|
|
82
84
|
if (targetOrShader === "motn" || targetOrShader === "lottie" || targetOrShader === "fcp7" || targetOrShader === "edl") {
|
|
83
85
|
const sceneFile = extraPath;
|
|
84
86
|
if (!sceneFile) {
|
|
@@ -92,7 +94,7 @@ program.command("export <targetOrShader> [extraPath] [outputPath]").description(
|
|
|
92
94
|
}
|
|
93
95
|
try {
|
|
94
96
|
const scene = JSON.parse(fs.readFileSync(fullPath2, "utf-8"));
|
|
95
|
-
const { exportMotn, exportLottie, exportFcp7Xml, exportCmx3600Edl } = await import("./export-
|
|
97
|
+
const { exportMotn, exportLottie, exportFcp7Xml, exportCmx3600Edl } = await import("./export-QVW474KM.js");
|
|
96
98
|
const fps2 = parseInt(options.fps, 10);
|
|
97
99
|
let content;
|
|
98
100
|
let ext;
|
|
@@ -152,7 +154,7 @@ program.command("export <targetOrShader> [extraPath] [outputPath]").description(
|
|
|
152
154
|
const duration = parseFloat(options.duration);
|
|
153
155
|
console.log(`Rendering ${duration}s (${duration * fps} frames at ${width}x${height}, ${fps}fps) to ${options.out}...`);
|
|
154
156
|
try {
|
|
155
|
-
const { exportMotionGraphic } = await import("./recorder-
|
|
157
|
+
const { exportMotionGraphic } = await import("./recorder-CDPPTJMG.js");
|
|
156
158
|
const savedPath = await exportMotionGraphic({
|
|
157
159
|
source,
|
|
158
160
|
values,
|
|
@@ -161,6 +163,10 @@ program.command("export <targetOrShader> [extraPath] [outputPath]").description(
|
|
|
161
163
|
height,
|
|
162
164
|
fps,
|
|
163
165
|
duration,
|
|
166
|
+
alpha: options.alpha,
|
|
167
|
+
transparent: options.transparent,
|
|
168
|
+
background: options.background,
|
|
169
|
+
pointer: options.pointer ? "auto" : "none",
|
|
164
170
|
onProgress: (frame, total) => {
|
|
165
171
|
process.stdout.write(`\rRendering frame ${frame}/${total} (${Math.round(frame / total * 100)}%)`);
|
|
166
172
|
}
|
|
@@ -173,6 +179,63 @@ Export failed: ${err.message}`);
|
|
|
173
179
|
process.exit(1);
|
|
174
180
|
}
|
|
175
181
|
});
|
|
182
|
+
var collect = (value, previous) => [...previous, value];
|
|
183
|
+
program.command("effects").description("List catalog effects with what they take (image, video, svg, text, mask, path) and how they answer the pointer").option("--accepts <inputs>", "Only effects that take all of these (image, video, svg, text, mask, path; comma-separated or repeated)", collect, []).option("--interaction <ways>", "Only effects that answer the pointer in one of these ways (hover, press, click, trail, pointer)", collect, []).option("--category <category>", "Only this category").option("--kind <kind>", "shader or vector").option("--search <words>", "Words to look for in the id, name, description and tags").option("--json", "Output JSON (id, name, kind, category, description, inputs, presets)", false).action(async (options) => {
|
|
184
|
+
try {
|
|
185
|
+
const { findEffects, effectInputs } = await import("./catalog/index.js");
|
|
186
|
+
const { effectQueryFromFlags, describeEffect } = await import("./effect-GGH3OSOT.js");
|
|
187
|
+
const effects = findEffects(effectQueryFromFlags(options));
|
|
188
|
+
if (options.json) {
|
|
189
|
+
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));
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (!effects.length) {
|
|
193
|
+
console.log("No effects match.");
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
for (const e of effects) console.log(describeEffect(e));
|
|
197
|
+
console.log(`
|
|
198
|
+
${effects.length} effect${effects.length === 1 ? "" : "s"}. Render one with: flair render <id> [--image p | --text "\u2026" | \u2026] -o out.mp4`);
|
|
199
|
+
} catch (err) {
|
|
200
|
+
console.error(`Error: ${err.message}`);
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
program.command("render <effect>").description("Render a catalog effect, applied to a subject, to .mp4, .webm, .mov, .gif, .svg (vector effects) or .png frames").option("--image <path>", "A picture (file path or URL); repeat for effects that take two", collect, []).option("--svg <path>", "An SVG (file path, URL or markup)", collect, []).option("--text <text>", "Words, for a text effect or a text mask", collect, []).option("--font <family>", "CSS font family for --text drawn into a shader").option("--weight <weight>", "Font weight for --text drawn into a shader").option("--path <d>", "SVG path data, for a shape control", collect, []).option("--video <path>", "A video file, decoded to frames with ffmpeg", collect, []).option("--preset <name>", "A preset by name").option("--set <name=value>", "A control value (repeatable): --set uSpeed=2 --set uTint=#ff0080", collect, []).option("--size <WxH>", "Pixels, like 1280x720").option("--fps <fps>", "Frames per second", "30").option("--duration <seconds>", "Seconds (default: the effect's loop or play-through)").option("--alpha", "Keep transparency (webm, mov, gif, png, svg)", false).option("--background <css>", "Colour under transparent pixels without --alpha").option("--no-pointer", "Leave the pointer still (interactive effects otherwise get a scripted pointer)").option("-o, --out <outputPath>", "Output: .mp4, .webm, .mov, .gif, .svg, a .png pattern (out_%04d.png) or a folder").action(async (effectId, options) => {
|
|
205
|
+
try {
|
|
206
|
+
if (!options.out) throw new Error("Say where to write it: -o out.mp4 (or .webm, .mov, .gif, .svg, out_%04d.png, a folder/).");
|
|
207
|
+
const { exportEffect, parseSets, parseSize, resolveEffect, subjectsFromFlags } = await import("./effect-GGH3OSOT.js");
|
|
208
|
+
const effect = resolveEffect(effectId);
|
|
209
|
+
const subjects = subjectsFromFlags(options);
|
|
210
|
+
const size = options.size ? parseSize(options.size) : void 0;
|
|
211
|
+
const fps = Number(options.fps);
|
|
212
|
+
if (!(fps > 0)) throw new Error(`--fps takes a positive number, not "${options.fps}".`);
|
|
213
|
+
const duration = options.duration === void 0 ? void 0 : Number(options.duration);
|
|
214
|
+
if (duration !== void 0 && !(duration > 0)) throw new Error(`--duration takes seconds, more than 0, not "${options.duration}".`);
|
|
215
|
+
console.log(`Rendering ${effect.id} to ${options.out}...`);
|
|
216
|
+
const saved = await exportEffect(effect, {
|
|
217
|
+
...subjects.length ? { subject: subjects } : {},
|
|
218
|
+
...options.preset ? { preset: options.preset } : {},
|
|
219
|
+
values: parseSets(effect, options.set),
|
|
220
|
+
outputPath: options.out,
|
|
221
|
+
...size ?? {},
|
|
222
|
+
fps,
|
|
223
|
+
...duration !== void 0 ? { duration } : {},
|
|
224
|
+
alpha: options.alpha,
|
|
225
|
+
...options.background ? { background: options.background } : {},
|
|
226
|
+
...options.pointer === false ? { pointer: "none" } : {},
|
|
227
|
+
onProgress: (frame, total) => {
|
|
228
|
+
if (total > 1) process.stdout.write(`\rFrame ${frame}/${total} (${Math.round(frame / total * 100)}%)`);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
console.log(`
|
|
232
|
+
Wrote ${saved}`);
|
|
233
|
+
} catch (err) {
|
|
234
|
+
console.error(`
|
|
235
|
+
Render failed: ${err.message}`);
|
|
236
|
+
process.exit(1);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
176
239
|
var sceneCmd = program.command("scene").description("Direct, validate, simulate, and render multi-shot animated scenes");
|
|
177
240
|
sceneCmd.command("validate <sceneFile>").description("Validate scene JSON structure, camera framing, and effect IDs").action((sceneFile) => {
|
|
178
241
|
const fullPath = path.resolve(process.cwd(), sceneFile);
|
|
@@ -245,7 +308,7 @@ sceneCmd.command("motn <sceneFile> [outFile]").description("Export scene to Appl
|
|
|
245
308
|
}
|
|
246
309
|
try {
|
|
247
310
|
const scene = JSON.parse(fs.readFileSync(fullPath, "utf-8"));
|
|
248
|
-
const { exportMotn } = await import("./export-
|
|
311
|
+
const { exportMotn } = await import("./export-QVW474KM.js");
|
|
249
312
|
const xml = exportMotn(scene, { frameRate: parseInt(options.fps, 10) });
|
|
250
313
|
const destination = path.resolve(
|
|
251
314
|
process.cwd(),
|
|
@@ -267,7 +330,7 @@ sceneCmd.command("lottie <sceneFile> [outFile]").description("Export scene vecto
|
|
|
267
330
|
}
|
|
268
331
|
try {
|
|
269
332
|
const scene = JSON.parse(fs.readFileSync(fullPath, "utf-8"));
|
|
270
|
-
const { exportLottie } = await import("./export-
|
|
333
|
+
const { exportLottie } = await import("./export-QVW474KM.js");
|
|
271
334
|
const animation = exportLottie(scene, { frameRate: parseInt(options.fps, 10) });
|
|
272
335
|
const destination = path.resolve(
|
|
273
336
|
process.cwd(),
|
|
@@ -289,7 +352,7 @@ sceneCmd.command("fcp7 <sceneFile> [outFile]").description("Export scene timelin
|
|
|
289
352
|
}
|
|
290
353
|
try {
|
|
291
354
|
const scene = JSON.parse(fs.readFileSync(fullPath, "utf-8"));
|
|
292
|
-
const { exportFcp7Xml } = await import("./export-
|
|
355
|
+
const { exportFcp7Xml } = await import("./export-QVW474KM.js");
|
|
293
356
|
const xml = exportFcp7Xml(scene, { frameRate: parseInt(options.fps, 10) });
|
|
294
357
|
const destination = path.resolve(
|
|
295
358
|
process.cwd(),
|
|
@@ -311,7 +374,7 @@ sceneCmd.command("edl <sceneFile> [outFile]").description("Export scene edit dec
|
|
|
311
374
|
}
|
|
312
375
|
try {
|
|
313
376
|
const scene = JSON.parse(fs.readFileSync(fullPath, "utf-8"));
|
|
314
|
-
const { exportCmx3600Edl } = await import("./export-
|
|
377
|
+
const { exportCmx3600Edl } = await import("./export-QVW474KM.js");
|
|
315
378
|
const edl = exportCmx3600Edl(scene, {
|
|
316
379
|
frameRate: parseInt(options.fps, 10),
|
|
317
380
|
reel: options.reel
|
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 CMX 3600 EDL: ${err.message}`);\n process.exit(1);\n }\n });\n\n\nprogram.parse(process.argv);\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,SAAS,eAAe;AACxB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,YAAY;AAIrB,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,OAAO,EACZ,YAAY,+EAA+E,EAC3F,QAAQ,OAAO;AAKlB,QACG,QAAQ,uBAAuB,EAC/B,YAAY,gEAAgE,EAC5E,OAAO,UAAU,2BAA2B,KAAK,EACjD,OAAO,CAAC,YAAY,YAAY;AAC/B,QAAM,WAAW,KAAK,QAAQ,QAAQ,IAAI,GAAG,UAAU;AACvD,MAAI,CAAC,GAAG,WAAW,QAAQ,GAAG;AAC5B,YAAQ,MAAM,oCAAoC,QAAQ,EAAE;AAC5D,YAAQ,KAAK,CAAC;AA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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);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,SAAS,eAAe;AACxB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,YAAY;AAIrB,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,OAAO,EACZ,YAAY,+EAA+E,EAC3F,QAAQ,OAAO;AAKlB,QACG,QAAQ,uBAAuB,EAC/B,YAAY,gEAAgE,EAC5E,OAAO,UAAU,2BAA2B,KAAK,EACjD,OAAO,CAAC,YAAY,YAAY;AAC/B,QAAM,WAAW,KAAK,QAAQ,QAAQ,IAAI,GAAG,UAAU;AACvD,MAAI,CAAC,GAAG,WAAW,QAAQ,GAAG;AAC5B,YAAQ,MAAM,oCAAoC,QAAQ,EAAE;AAC5D,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,SAAS,GAAG,aAAa,UAAU,OAAO;AAChD,Q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,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,SACG,QAAQ,2BAA2B,EACnC,YAAY,0DAA0D,EACtE,OAAO,eAAe,qBAAqB,IAAI,EAC/C,OAAO,iBAAiB,wBAAwB,IAAI,EACpD,OAAO,OAAO,WAAW,SAAS,YAAY;AAC7C,QAAM,WAAW,KAAK,QAAQ,QAAQ,IAAI,GAAG,SAAS;AACtD,MAAI,CAAC,GAAG,WAAW,QAAQ,GAAG;AAC5B,YAAQ,MAAM,mCAAmC,QAAQ,EAAE;AAC3D,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,MAAI;AACF,UAAM,QAAe,KAAK,MAAM,GAAG,aAAa,UAAU,OAAO,CAAC;AAClE,UAAM,EAAE,iBAAiB,IAAI,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"]}
|
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-HVXWNGTW.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 {
|