@pixerate/editor 0.58.0 → 0.59.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/dist/animation/index.cjs +9 -3
- package/dist/animation/index.cjs.map +1 -1
- package/dist/animation/index.d.cts +2 -2
- package/dist/animation/index.d.ts +2 -2
- package/dist/animation/index.js +9 -3
- package/dist/animation-editor/index.cjs +456 -83
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +159 -9
- package/dist/animation-editor/index.d.ts +159 -9
- package/dist/animation-editor/index.js +415 -42
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/canvas/index.cjs +35 -29
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +4 -4
- package/dist/canvas/index.d.ts +4 -4
- package/dist/canvas/index.js +9 -3
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-O4ONBPZW.cjs → chunk-2FGRTYJN.cjs} +4 -4
- package/dist/{chunk-O4ONBPZW.cjs.map → chunk-2FGRTYJN.cjs.map} +1 -1
- package/dist/{chunk-XZ4L3R4K.cjs → chunk-2FHLHZAL.cjs} +39 -3
- package/dist/chunk-2FHLHZAL.cjs.map +1 -0
- package/dist/{chunk-PYMV7HLI.js → chunk-3TLL5OID.js} +2 -2
- package/dist/{chunk-UB2OY7FD.js → chunk-AGR4P4UZ.js} +38 -2
- package/dist/chunk-AGR4P4UZ.js.map +1 -0
- package/dist/{chunk-SHOVAHUB.js → chunk-JK6M6V7G.js} +2 -2
- package/dist/{chunk-FKONE6AO.cjs → chunk-YJLCBA7V.cjs} +3 -3
- package/dist/{chunk-FKONE6AO.cjs.map → chunk-YJLCBA7V.cjs.map} +1 -1
- package/dist/{easing-CNGk-W6d.d.ts → easing-lM0Xo9Ni.d.cts} +14 -2
- package/dist/{easing-CNGk-W6d.d.cts → easing-lM0Xo9Ni.d.ts} +14 -2
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.d.cts +1 -1
- package/dist/parameters/index.d.ts +1 -1
- package/dist/parameters/index.js +1 -1
- package/dist/{player-W-5DX3Go.d.ts → player-DV4Jujdq.d.ts} +1 -1
- package/dist/{player-Dg0FT0UI.d.cts → player-DrcP2xqj.d.cts} +1 -1
- package/dist/vector/index.cjs +472 -472
- package/dist/vector/index.d.cts +1 -1
- package/dist/vector/index.d.ts +1 -1
- package/dist/vector/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-UB2OY7FD.js.map +0 -1
- package/dist/chunk-XZ4L3R4K.cjs.map +0 -1
- /package/dist/{chunk-PYMV7HLI.js.map → chunk-3TLL5OID.js.map} +0 -0
- /package/dist/{chunk-SHOVAHUB.js.map → chunk-JK6M6V7G.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as AnimationEasing } from '../easing-
|
|
2
|
-
import { b as AnimationLoopMode, c as AnimationPlayer, C as Clock } from '../player-
|
|
1
|
+
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.js';
|
|
2
|
+
import { b as AnimationLoopMode, c as AnimationPlayer, C as Clock } from '../player-DV4Jujdq.js';
|
|
3
3
|
import { V as VectorDocument, a as VectorNode, b as VectorBounds, c as VectorSvgExportOptions } from '../svg-Dh17jCyA.js';
|
|
4
4
|
import { a as MotionBehavior } from '../behavior-Ymbld6jL.js';
|
|
5
5
|
import { A as AffineMatrix, B as BezierPath } from '../bezier-DYBvLgUH.js';
|
|
@@ -31,6 +31,11 @@ interface MotionScene {
|
|
|
31
31
|
loop?: AnimationLoopMode;
|
|
32
32
|
/** Frame rate used to sample motion that a target format cannot express exactly (default 30). */
|
|
33
33
|
fps?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Stepped time for every command that gives none: changes hold on a grid of this many frames
|
|
36
|
+
* per second ("on twos" at 12), for a hand-drawn look. Default: smooth.
|
|
37
|
+
*/
|
|
38
|
+
steps?: number;
|
|
34
39
|
/** Wanted length in seconds `[min, max]`; `check` warns outside it. */
|
|
35
40
|
target?: [number, number];
|
|
36
41
|
/** Parameters a Flair effect made from this scene exposes (see `toFlairVectorEffect`). */
|
|
@@ -55,6 +60,8 @@ type MotionCamera = (MotionRect | {
|
|
|
55
60
|
}) & {
|
|
56
61
|
ease?: AnimationEasing;
|
|
57
62
|
ms?: number;
|
|
63
|
+
/** Zoom at a steady rate (the size changes by the same factor each moment) instead of linearly. */
|
|
64
|
+
geometric?: boolean;
|
|
58
65
|
};
|
|
59
66
|
/** One beat of the animation. */
|
|
60
67
|
interface MotionShot {
|
|
@@ -73,7 +80,7 @@ interface MotionShot {
|
|
|
73
80
|
interface MotionCommandBase {
|
|
74
81
|
/** Node ids from the artwork (groups animate as one). */
|
|
75
82
|
targets: string[];
|
|
76
|
-
/** Length in ms for each target (each type has a default; `draw` follows the path length). */
|
|
83
|
+
/** Length in ms for each target, one cycle when repeating (each type has a default; `draw` follows the path length; a spring `ease` lasts until it settles). */
|
|
77
84
|
duration?: number;
|
|
78
85
|
/** Wait this many ms before starting (default 0). */
|
|
79
86
|
delay?: number;
|
|
@@ -81,9 +88,23 @@ interface MotionCommandBase {
|
|
|
81
88
|
stagger?: number;
|
|
82
89
|
/** `after` (default) starts when the commands before it finish; `previous` starts with the command before. */
|
|
83
90
|
with?: 'after' | 'previous';
|
|
91
|
+
/** An easing; a spring with no `duration` lasts until it settles. */
|
|
84
92
|
ease?: AnimationEasing;
|
|
85
93
|
/** Why this command is here (for people and agents reading the scene). */
|
|
86
94
|
note?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Play the change this many times (a whole number, default 1); `duration` is one cycle. Not
|
|
97
|
+
* for `enter`, `exit` or `wait`.
|
|
98
|
+
*/
|
|
99
|
+
repeat?: number;
|
|
100
|
+
/**
|
|
101
|
+
* How repeats follow each other: `loop` (default) starts each cycle afresh, `mirror` plays
|
|
102
|
+
* every other one backwards, `offset` carries on from where the last ended (rotate by 90,
|
|
103
|
+
* repeat 4: a full turn). Colours and shapes offset like `loop`.
|
|
104
|
+
*/
|
|
105
|
+
repeatMode?: 'loop' | 'mirror' | 'offset';
|
|
106
|
+
/** Stepped time: hold the change on a grid of this many frames per second (default: the scene's `steps`, else smooth). */
|
|
107
|
+
steps?: number;
|
|
87
108
|
}
|
|
88
109
|
type MotionEnterStyle = 'fade' | 'pop' | 'grow' | 'slide' | 'draw' | 'zoom' | 'rise' | 'wipe' | 'iris' | 'split';
|
|
89
110
|
type MotionExitStyle = 'fade' | 'shrink' | 'slide' | 'undraw' | 'wipe';
|
|
@@ -161,6 +182,8 @@ interface MotionScaleCommand extends MotionCommandBase {
|
|
|
161
182
|
x: number;
|
|
162
183
|
y: number;
|
|
163
184
|
};
|
|
185
|
+
/** Grow at a steady rate (the same factor each moment), which reads as an even zoom. */
|
|
186
|
+
geometric?: boolean;
|
|
164
187
|
}
|
|
165
188
|
/** Changes opacity (0–1). */
|
|
166
189
|
interface MotionFadeCommand extends MotionCommandBase {
|
|
@@ -271,6 +294,7 @@ type MotionCommand = MotionEnterCommand | MotionExitCommand | MotionDrawCommand
|
|
|
271
294
|
type MotionCommandType = MotionCommand['type'];
|
|
272
295
|
declare const MOTION_COMMAND_TYPES: readonly MotionCommandType[];
|
|
273
296
|
declare const MOTION_ENTER_STYLES: readonly MotionEnterStyle[];
|
|
297
|
+
declare const MOTION_REPEAT_MODES: readonly ["loop", "mirror", "offset"];
|
|
274
298
|
declare const MOTION_EXIT_STYLES: readonly MotionExitStyle[];
|
|
275
299
|
declare const MOTION_IRIS_SHAPES: readonly MotionIrisShape[];
|
|
276
300
|
declare const MOTION_SPLIT_ORIENTATIONS: readonly MotionSplitOrientation[];
|
|
@@ -388,6 +412,10 @@ declare const MOTION_ISSUE_CODES: {
|
|
|
388
412
|
readonly severity: "warning";
|
|
389
413
|
readonly wording: "A change is too quick to follow.";
|
|
390
414
|
};
|
|
415
|
+
readonly 'spring-cut-short': {
|
|
416
|
+
readonly severity: "warning";
|
|
417
|
+
readonly wording: "A spring is given a duration shorter than it takes to settle, so it jumps to its end.";
|
|
418
|
+
};
|
|
391
419
|
readonly 'scene-too-long': {
|
|
392
420
|
readonly severity: "warning";
|
|
393
421
|
readonly wording: "The scene runs past its target length.";
|
|
@@ -496,6 +524,12 @@ interface MotionSegment {
|
|
|
496
524
|
* transform Flair is given), so a wriggle wanders each on the channel Flair uses. Default 0.
|
|
497
525
|
*/
|
|
498
526
|
index?: number;
|
|
527
|
+
/** Played backwards in time (a mirrored repeat): progress runs 1 → 0 through the ease. */
|
|
528
|
+
reverse?: boolean;
|
|
529
|
+
/** Stepped time: progress holds on a grid of this many frames per second from the start. */
|
|
530
|
+
steps?: number;
|
|
531
|
+
/** Numbers change by a steady factor (`from·(to/from)^u`); a camera zooms at a steady rate. */
|
|
532
|
+
geometric?: boolean;
|
|
499
533
|
/** For `follow`: the path node id, and whether to turn with it. */
|
|
500
534
|
path?: string;
|
|
501
535
|
rotate?: boolean;
|
|
@@ -584,7 +618,7 @@ declare function motionRestValue(entry: MotionNodeEntry | undefined, property: M
|
|
|
584
618
|
}): MotionValue;
|
|
585
619
|
/** `from` → `to` at eased progress `u` (numbers extrapolate, colours mix in OKLab, others switch at the end). */
|
|
586
620
|
declare function interpolateMotionValue(from: MotionValue, to: MotionValue, u: number): MotionValue;
|
|
587
|
-
/** Progress (0–1, unclamped by the easing) of a segment at `time
|
|
621
|
+
/** Progress (0–1, unclamped by the easing) of a segment at `time`: stepped, reversed and eased as the segment says. */
|
|
588
622
|
declare function segmentProgress(segment: MotionSegment, time: number): {
|
|
589
623
|
u: number;
|
|
590
624
|
eased: number;
|
|
@@ -605,8 +639,12 @@ declare function fitMotionRect(rect: MotionRect, aspect: number): MotionRect;
|
|
|
605
639
|
declare function resolveMotionCamera(camera: MotionCamera, scene: MotionScene): MotionRect | null;
|
|
606
640
|
/** Length of a node's outline (its longest path for a group), in document units. */
|
|
607
641
|
declare function motionPathLength(node: VectorNode, parentWorld?: AffineMatrix): number;
|
|
608
|
-
/** How
|
|
642
|
+
/** How many times a command plays (1 for `enter`, `exit` and `wait`, which do not repeat). */
|
|
643
|
+
declare function motionCommandRepeat(command: MotionCommand): number;
|
|
644
|
+
/** How long one target of a command takes (ms), every repeat included. */
|
|
609
645
|
declare function motionCommandDuration(command: MotionCommand, scene: MotionScene, target?: string): number;
|
|
646
|
+
/** How long one cycle of a command takes for one target (ms): its `duration`, a spring's settle time, the line's length for a draw, or the type's default. */
|
|
647
|
+
declare function motionCycleDuration(command: MotionCommand, scene: MotionScene, target?: string): number;
|
|
610
648
|
/** Cubic ease-out, `1 − (1 − t)³` exactly (Flair's `out`): the default for things arriving. */
|
|
611
649
|
declare const MOTION_EASE_OUT: AnimationEasing;
|
|
612
650
|
/** Cubic ease-in-out (close to Flair's `in-out`): the default for moves. */
|
|
@@ -721,6 +759,7 @@ type MotionEdit = {
|
|
|
721
759
|
description?: string | null;
|
|
722
760
|
loop?: MotionScene['loop'];
|
|
723
761
|
fps?: number;
|
|
762
|
+
steps?: number | null;
|
|
724
763
|
target?: [number, number] | null;
|
|
725
764
|
} | {
|
|
726
765
|
op: 'insert_shots';
|
|
@@ -805,8 +844,17 @@ declare function createMotionScene(artwork: VectorDocument, init?: Partial<Omit<
|
|
|
805
844
|
*/
|
|
806
845
|
/** Flair's easing names. */
|
|
807
846
|
type FlairEaseName = 'linear' | 'in-out' | 'out';
|
|
808
|
-
/**
|
|
809
|
-
|
|
847
|
+
/** Flair's spring ease (Flair 0.39 and later): the editor's spring, number for number. */
|
|
848
|
+
interface FlairSpringEase {
|
|
849
|
+
spring: {
|
|
850
|
+
mass?: number;
|
|
851
|
+
stiffness?: number;
|
|
852
|
+
damping?: number;
|
|
853
|
+
velocity?: number;
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
/** A Flair easing: a name, (Flair 0.36 and later) a CSS cubic-bezier `[x1, y1, x2, y2]`, or (0.39) a spring. */
|
|
857
|
+
type FlairEase = FlairEaseName | readonly [number, number, number, number] | FlairSpringEase;
|
|
810
858
|
/** Flair's curves, for matching. */
|
|
811
859
|
declare const FLAIR_EASES: Readonly<Record<FlairEaseName, (t: number) => number>>;
|
|
812
860
|
/** One change of a Flair `SvgMotion` (mirrors `SvgAnimation` in `@pixerate/flair/vector`). */
|
|
@@ -825,6 +873,16 @@ interface FlairSvgAnimation {
|
|
|
825
873
|
orient?: boolean;
|
|
826
874
|
/** Flair 0.38 and later: how the change swings from → to (see `MotionBehavior`). */
|
|
827
875
|
behavior?: MotionBehavior;
|
|
876
|
+
/** Flair 0.39 and later: stepped time, held on a grid of this many frames per second. */
|
|
877
|
+
strobe?: number;
|
|
878
|
+
/** Flair 0.39 and later: whole cycles to play (default 1); with `alternate`, every other one backwards. */
|
|
879
|
+
repeat?: number;
|
|
880
|
+
alternate?: boolean;
|
|
881
|
+
/** Flair features scenes do not have (imports skip them with a note). */
|
|
882
|
+
count?: readonly [number, number];
|
|
883
|
+
write?: string;
|
|
884
|
+
scramble?: string;
|
|
885
|
+
solo?: number;
|
|
828
886
|
view?: readonly [number, number, number, number] | string;
|
|
829
887
|
}
|
|
830
888
|
/** Mirrors `SvgMotion` in `@pixerate/flair/vector`. */
|
|
@@ -896,7 +954,17 @@ interface FlairExportOptions {
|
|
|
896
954
|
* older Flair, and they are sampled into linear steps.
|
|
897
955
|
*/
|
|
898
956
|
behaviors?: boolean;
|
|
957
|
+
/**
|
|
958
|
+
* The Flair version the export is for (default `0.39`): it decides what is written exactly
|
|
959
|
+
* and what is sampled. 0.36 adds cubic-bezier curves, 0.38 behaviours, 0.39 springs and
|
|
960
|
+
* stepped time (`strobe`). `curves` and `behaviors` override it.
|
|
961
|
+
*/
|
|
962
|
+
flair?: string;
|
|
899
963
|
}
|
|
964
|
+
/** The Flair version exports target by default. */
|
|
965
|
+
declare const FLAIR_EXPORT_VERSION = "0.39";
|
|
966
|
+
/** Whether Flair `version` is at least `min` (dotted numbers). */
|
|
967
|
+
declare function flairAtLeast(version: string, min: string): boolean;
|
|
900
968
|
/** The Flair easing that matches `ease` (within 1% everywhere), if any. */
|
|
901
969
|
declare function flairEaseFor(ease: AnimationEasing): FlairEaseName | undefined;
|
|
902
970
|
/**
|
|
@@ -922,6 +990,36 @@ declare function toFlairVectorEffect(scene: MotionScene, options?: FlairEffectOp
|
|
|
922
990
|
/** A scene as a document for Flair's `EffectEditor` (`replaceDocument`). */
|
|
923
991
|
declare function toFlairEffectDocument(scene: MotionScene, options?: FlairExportOptions): FlairEffectDocument;
|
|
924
992
|
|
|
993
|
+
/**
|
|
994
|
+
* Import from Flair: a Flair `SvgMotion` (or a catalog `VectorEffect`) becomes a scene, so an
|
|
995
|
+
* effect made in Flair, or taken from its catalog, can be opened and edited here. The reverse
|
|
996
|
+
* of `toFlairSvgMotion`, as far as the scene model goes:
|
|
997
|
+
*
|
|
998
|
+
* - The SVG becomes the artwork (`parseVectorSvg`); `{{name: color …}}` placeholders become
|
|
999
|
+
* colour controls (other placeholders take their defaults).
|
|
1000
|
+
* - Each Flair step becomes a shot, its changes commands timed by their `delay`, all together.
|
|
1001
|
+
* - Opacity, paint, stroke width, transforms (as move, rotate and scale), drawing on, following
|
|
1002
|
+
* a path, camera views and behaviours (pulse, shake, teeter, wave, wiggle, colour pulse) carry
|
|
1003
|
+
* over. Counting, writing text, solo containers and anything else are listed in `notes`.
|
|
1004
|
+
*/
|
|
1005
|
+
interface FlairImportResult {
|
|
1006
|
+
scene: MotionScene;
|
|
1007
|
+
/** What could not be carried over exactly, in sentences. */
|
|
1008
|
+
notes: string[];
|
|
1009
|
+
/** `checkMotionScene` of the result. */
|
|
1010
|
+
issues: MotionIssue[];
|
|
1011
|
+
}
|
|
1012
|
+
interface FlairImportOptions {
|
|
1013
|
+
/** The scene's name (default: the effect's, else `from-flair`). */
|
|
1014
|
+
name?: string;
|
|
1015
|
+
/** Hold after the last shot, ms (default: the effect's `hold`, else 600). */
|
|
1016
|
+
hold?: number;
|
|
1017
|
+
}
|
|
1018
|
+
/** A Flair `SvgMotion` as a scene (see the module notes for what carries over). */
|
|
1019
|
+
declare function fromFlairSvgMotion(input: FlairSvgMotion, options?: FlairImportOptions): FlairImportResult;
|
|
1020
|
+
/** A Flair catalog `VectorEffect` as a scene: its motion, name, description, colour controls and presets. */
|
|
1021
|
+
declare function fromFlairVectorEffect(effect: FlairVectorEffect, options?: FlairImportOptions): FlairImportResult;
|
|
1022
|
+
|
|
925
1023
|
interface AnimationEditorOptions {
|
|
926
1024
|
/** The scene to open (default: an empty one over a blank 800 × 450 artwork). */
|
|
927
1025
|
scene?: MotionScene;
|
|
@@ -1105,6 +1203,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1105
1203
|
with?: "after" | "previous";
|
|
1106
1204
|
ease?: AnimationEasing;
|
|
1107
1205
|
note?: string;
|
|
1206
|
+
repeat?: number;
|
|
1207
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1208
|
+
steps?: number;
|
|
1108
1209
|
index: number;
|
|
1109
1210
|
} | {
|
|
1110
1211
|
flairPrimitive?: string | undefined;
|
|
@@ -1121,6 +1222,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1121
1222
|
with?: "after" | "previous";
|
|
1122
1223
|
ease?: AnimationEasing;
|
|
1123
1224
|
note?: string;
|
|
1225
|
+
repeat?: number;
|
|
1226
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1227
|
+
steps?: number;
|
|
1124
1228
|
index: number;
|
|
1125
1229
|
} | {
|
|
1126
1230
|
flairPrimitive?: string | undefined;
|
|
@@ -1136,6 +1240,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1136
1240
|
with?: "after" | "previous";
|
|
1137
1241
|
ease?: AnimationEasing;
|
|
1138
1242
|
note?: string;
|
|
1243
|
+
repeat?: number;
|
|
1244
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1245
|
+
steps?: number;
|
|
1139
1246
|
index: number;
|
|
1140
1247
|
} | {
|
|
1141
1248
|
flairPrimitive?: string | undefined;
|
|
@@ -1157,6 +1264,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1157
1264
|
with?: "after" | "previous";
|
|
1158
1265
|
ease?: AnimationEasing;
|
|
1159
1266
|
note?: string;
|
|
1267
|
+
repeat?: number;
|
|
1268
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1269
|
+
steps?: number;
|
|
1160
1270
|
index: number;
|
|
1161
1271
|
} | {
|
|
1162
1272
|
flairPrimitive?: string | undefined;
|
|
@@ -1172,6 +1282,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1172
1282
|
with?: "after" | "previous";
|
|
1173
1283
|
ease?: AnimationEasing;
|
|
1174
1284
|
note?: string;
|
|
1285
|
+
repeat?: number;
|
|
1286
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1287
|
+
steps?: number;
|
|
1175
1288
|
index: number;
|
|
1176
1289
|
} | {
|
|
1177
1290
|
flairPrimitive?: string | undefined;
|
|
@@ -1182,6 +1295,7 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1182
1295
|
x: number;
|
|
1183
1296
|
y: number;
|
|
1184
1297
|
};
|
|
1298
|
+
geometric?: boolean;
|
|
1185
1299
|
targets: string[];
|
|
1186
1300
|
duration?: number;
|
|
1187
1301
|
delay?: number;
|
|
@@ -1189,6 +1303,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1189
1303
|
with?: "after" | "previous";
|
|
1190
1304
|
ease?: AnimationEasing;
|
|
1191
1305
|
note?: string;
|
|
1306
|
+
repeat?: number;
|
|
1307
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1308
|
+
steps?: number;
|
|
1192
1309
|
index: number;
|
|
1193
1310
|
} | {
|
|
1194
1311
|
flairPrimitive?: string | undefined;
|
|
@@ -1203,6 +1320,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1203
1320
|
with?: "after" | "previous";
|
|
1204
1321
|
ease?: AnimationEasing;
|
|
1205
1322
|
note?: string;
|
|
1323
|
+
repeat?: number;
|
|
1324
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1325
|
+
steps?: number;
|
|
1206
1326
|
index: number;
|
|
1207
1327
|
} | {
|
|
1208
1328
|
flairPrimitive?: string | undefined;
|
|
@@ -1219,6 +1339,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1219
1339
|
with?: "after" | "previous";
|
|
1220
1340
|
ease?: AnimationEasing;
|
|
1221
1341
|
note?: string;
|
|
1342
|
+
repeat?: number;
|
|
1343
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1344
|
+
steps?: number;
|
|
1222
1345
|
index: number;
|
|
1223
1346
|
} | {
|
|
1224
1347
|
flairPrimitive?: string | undefined;
|
|
@@ -1233,6 +1356,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1233
1356
|
with?: "after" | "previous";
|
|
1234
1357
|
ease?: AnimationEasing;
|
|
1235
1358
|
note?: string;
|
|
1359
|
+
repeat?: number;
|
|
1360
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1361
|
+
steps?: number;
|
|
1236
1362
|
index: number;
|
|
1237
1363
|
} | {
|
|
1238
1364
|
flairPrimitive?: string | undefined;
|
|
@@ -1250,6 +1376,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1250
1376
|
with?: "after" | "previous";
|
|
1251
1377
|
ease?: AnimationEasing;
|
|
1252
1378
|
note?: string;
|
|
1379
|
+
repeat?: number;
|
|
1380
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1381
|
+
steps?: number;
|
|
1253
1382
|
index: number;
|
|
1254
1383
|
} | {
|
|
1255
1384
|
flairPrimitive?: string | undefined;
|
|
@@ -1265,6 +1394,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1265
1394
|
with?: "after" | "previous";
|
|
1266
1395
|
ease?: AnimationEasing;
|
|
1267
1396
|
note?: string;
|
|
1397
|
+
repeat?: number;
|
|
1398
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1399
|
+
steps?: number;
|
|
1268
1400
|
index: number;
|
|
1269
1401
|
} | {
|
|
1270
1402
|
flairPrimitive?: string | undefined;
|
|
@@ -1281,6 +1413,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1281
1413
|
with?: "after" | "previous";
|
|
1282
1414
|
ease?: AnimationEasing;
|
|
1283
1415
|
note?: string;
|
|
1416
|
+
repeat?: number;
|
|
1417
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1418
|
+
steps?: number;
|
|
1284
1419
|
index: number;
|
|
1285
1420
|
} | {
|
|
1286
1421
|
flairPrimitive?: string | undefined;
|
|
@@ -1296,6 +1431,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1296
1431
|
with?: "after" | "previous";
|
|
1297
1432
|
ease?: AnimationEasing;
|
|
1298
1433
|
note?: string;
|
|
1434
|
+
repeat?: number;
|
|
1435
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1436
|
+
steps?: number;
|
|
1299
1437
|
index: number;
|
|
1300
1438
|
} | {
|
|
1301
1439
|
flairPrimitive?: string | undefined;
|
|
@@ -1311,6 +1449,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1311
1449
|
with?: "after" | "previous";
|
|
1312
1450
|
ease?: AnimationEasing;
|
|
1313
1451
|
note?: string;
|
|
1452
|
+
repeat?: number;
|
|
1453
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1454
|
+
steps?: number;
|
|
1314
1455
|
index: number;
|
|
1315
1456
|
} | {
|
|
1316
1457
|
flairPrimitive?: string | undefined;
|
|
@@ -1329,6 +1470,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1329
1470
|
with?: "after" | "previous";
|
|
1330
1471
|
ease?: AnimationEasing;
|
|
1331
1472
|
note?: string;
|
|
1473
|
+
repeat?: number;
|
|
1474
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1475
|
+
steps?: number;
|
|
1332
1476
|
index: number;
|
|
1333
1477
|
} | {
|
|
1334
1478
|
flairPrimitive?: string | undefined;
|
|
@@ -1345,6 +1489,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1345
1489
|
with?: "after" | "previous";
|
|
1346
1490
|
ease?: AnimationEasing;
|
|
1347
1491
|
note?: string;
|
|
1492
|
+
repeat?: number;
|
|
1493
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1494
|
+
steps?: number;
|
|
1348
1495
|
index: number;
|
|
1349
1496
|
} | {
|
|
1350
1497
|
flairPrimitive?: string | undefined;
|
|
@@ -1361,6 +1508,9 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1361
1508
|
with?: "after" | "previous";
|
|
1362
1509
|
ease?: AnimationEasing;
|
|
1363
1510
|
note?: string;
|
|
1511
|
+
repeat?: number;
|
|
1512
|
+
repeatMode?: "loop" | "mirror" | "offset";
|
|
1513
|
+
steps?: number;
|
|
1364
1514
|
index: number;
|
|
1365
1515
|
} | {
|
|
1366
1516
|
flairPrimitive?: string | undefined;
|
|
@@ -1392,6 +1542,6 @@ declare function createAnimationEditorToolProvider(controller: AnimationEditorCo
|
|
|
1392
1542
|
* A short authoring guide for a model writing vector animations with the animation editor's
|
|
1393
1543
|
* tools. Static, so it caches well as part of a system prompt.
|
|
1394
1544
|
*/
|
|
1395
|
-
declare const ANIMATION_EDITOR_AGENT_INSTRUCTIONS = "You animate vector artwork. A scene is artwork (vector paths and groups, each with an id) plus shots.\n\nHow it plays\n- Shots play in order. A shot optionally moves the camera, plays its commands, then holds (default 600 ms).\n- Commands in a shot play one after another; give \"with\": \"previous\" to start one together with the command before, \"delay\" to wait, \"stagger\" to offset several targets.\n- Timing comes from the content: each command has a default length (enter 600 ms, move 700 ms, draw follows the path length). Only set \"duration\" to change the pace.\n- Anything that enters later is hidden until it enters. Things that never enter are visible from the start.\n- Every frame is a pure function of time: the same scene always plays the same frames.\n\nCommands\n- enter (fade, pop, grow, slide, draw) and exit (fade, shrink, slide, undraw) bring things in and out.\n- enter also reveals through a clip over the target's box: wipe (behind an edge travelling \"direction\", default right), iris (from the centre; \"shape\": circle or box) and split (from a line through the middle; \"orientation\": horizontal or vertical). exit wipe hides the same way. Reveals need a width and a height: use draw / undraw for a straight line.\n- draw draws strokes on to a fraction; move, rotate, scale and fade change the pose (about the centre); style blends solid colours and stroke width.\n- enter also has zoom (settles from larger) and rise (rises a short way, overshooting a touch); pop and zoom take a starting \"scale\".\n- morph turns a shape into another node's shape (keep the target hidden); follow moves along a path node (with \"rotate\", moves made meanwhile turn with the path).\n- Emphasis draws the eye and returns to rest: pulse (swell), shake (side to side, or \"axis\": \"vertical\"), teeter (rock), wave (bob, no settling), wiggle (seeded wander; the same seed wanders the same way) and color-pulse (tint and back).\n- Commands share their names and defaults with Flair's motion primitives (get_animation shows each one's \"flairPrimitive\"), and emphasis, reveals and follows export to Flair exactly.\n- effect tweens a numeric parameter of a live path effect already on the node (twist angle, wiggle time, zig zag size).\n\nWorking method\n1. get_animation to learn the element ids (set_animation_artwork_svg first if there is no artwork: give every element you will animate an id).\n2. Plan a few shots, each one idea. Add them with insert_shots, or edit_animation to make several edits as one step (dry_run first when unsure).\n3. check_animation and fix every error and warning; render_animation_frame (shot + \"end\") to look at the result.\n4. To make a reusable Flair effect, set_animation_controls (colour controls stand for every use of their default colour) and export_flair_effect.\n\nKeep motion purposeful: one thing moving at a time reads best, ease-out for arrivals, ease-in for exits, and hold long enough to see each result.";
|
|
1545
|
+
declare const ANIMATION_EDITOR_AGENT_INSTRUCTIONS = "You animate vector artwork. A scene is artwork (vector paths and groups, each with an id) plus shots.\n\nHow it plays\n- Shots play in order. A shot optionally moves the camera, plays its commands, then holds (default 600 ms).\n- Commands in a shot play one after another; give \"with\": \"previous\" to start one together with the command before, \"delay\" to wait, \"stagger\" to offset several targets.\n- Timing comes from the content: each command has a default length (enter 600 ms, move 700 ms, draw follows the path length). Only set \"duration\" to change the pace.\n- Anything that enters later is hidden until it enters. Things that never enter are visible from the start.\n- Every frame is a pure function of time: the same scene always plays the same frames.\n\nCommands\n- enter (fade, pop, grow, slide, draw) and exit (fade, shrink, slide, undraw) bring things in and out.\n- enter also reveals through a clip over the target's box: wipe (behind an edge travelling \"direction\", default right), iris (from the centre; \"shape\": circle or box) and split (from a line through the middle; \"orientation\": horizontal or vertical). exit wipe hides the same way. Reveals need a width and a height: use draw / undraw for a straight line.\n- draw draws strokes on to a fraction; move, rotate, scale and fade change the pose (about the centre); style blends solid colours and stroke width.\n- enter also has zoom (settles from larger) and rise (rises a short way, overshooting a touch); pop and zoom take a starting \"scale\".\n- morph turns a shape into another node's shape (keep the target hidden); follow moves along a path node (with \"rotate\", moves made meanwhile turn with the path).\n- Emphasis draws the eye and returns to rest: pulse (swell), shake (side to side, or \"axis\": \"vertical\"), teeter (rock), wave (bob, no settling), wiggle (seeded wander; the same seed wanders the same way) and color-pulse (tint and back).\n- Any command but enter and exit can \"repeat\" (loop, mirror back and forth, or offset to carry on: rotate by 90, repeat 4 is a full turn); \"duration\" is one cycle.\n- Springs (\"spring-gentle\", \"spring-quick\", \"spring-bouncy\", \"spring-slow\" or { \"type\": \"spring\", \u2026 }) feel physical; leave \"duration\" out and the spring sets it.\n- \"steps\": 12 (on a command, or for the whole scene with set_animation_settings) holds poses \"on twos\" for a hand-drawn look. \"geometric\": true on scale or a camera zooms at an even rate.\n- Commands share their names and defaults with Flair's motion primitives (get_animation shows each one's \"flairPrimitive\"), and emphasis, reveals and follows export to Flair exactly.\n- effect tweens a numeric parameter of a live path effect already on the node (twist angle, wiggle time, zig zag size).\n\nWorking method\n1. get_animation to learn the element ids (set_animation_artwork_svg first if there is no artwork: give every element you will animate an id; or import_flair_effect to start from a Flair effect and edit it).\n2. Plan a few shots, each one idea. Add them with insert_shots, or edit_animation to make several edits as one step (dry_run first when unsure).\n3. check_animation and fix every error and warning; render_animation_frame (shot + \"end\") to look at the result.\n4. To make a reusable Flair effect, set_animation_controls (colour controls stand for every use of their default colour) and export_flair_effect.\n\nKeep motion purposeful: one thing moving at a time reads best, ease-out for arrivals, ease-in for exits, and hold long enough to see each result.";
|
|
1396
1546
|
|
|
1397
|
-
export { ANIMATION_EDITOR_AGENT_INSTRUCTIONS, AnimationEditorController, type AnimationEditorOptions, type AnimationEditorSelection, type AnimationEditorState, type AnimationEditorToolProviderOptions, FLAIR_EASES, type FlairEase, type FlairEaseName, type FlairEffectDocument, type FlairEffectOptions, type FlairExportOptions, type FlairMotionExport, type FlairSvgAnimation, type FlairSvgMotion, type FlairVectorEffect, MOTION_CAMERA_MS, MOTION_COMMAND_SCHEMA, MOTION_COMMAND_TYPES, MOTION_DEFAULT_DURATIONS, MOTION_DEFAULT_HOLD, MOTION_DIRECTIONS, MOTION_DRAW_EFFECT_ID, MOTION_DRAW_MS_PER_UNIT, MOTION_DRAW_RANGE, MOTION_EASE_IN_OUT, MOTION_EASE_OUT, MOTION_EDIT_OPS, MOTION_ENTER_STYLES, MOTION_EXIT_STYLES, MOTION_IRIS_SHAPES, MOTION_ISSUE_CODES, MOTION_MIN_CHANGE_MS, MOTION_SPLIT_ORIENTATIONS, type MotionCamera, type MotionClipShape, type MotionColorPulseCommand, type MotionCommand, type MotionCommandBase, type MotionCommandTiming, type MotionCommandType, type MotionControl, type MotionDirection, type MotionDrawCommand, type MotionEdit, type MotionEditOp, type MotionEditResult, type MotionEffectCommand, type MotionEnterCommand, type MotionEnterStyle, type MotionExitCommand, type MotionExitStyle, type MotionFadeCommand, type MotionFollowCommand, type MotionFrame, type MotionFrameOptions, type MotionIrisShape, type MotionIssue, type MotionIssueCode, type MotionIssueSeverity, type MotionMorphCommand, type MotionMoveCommand, type MotionNodeEntry, type MotionPreset, type MotionProperty, type MotionPulseCommand, type MotionRect, type MotionReveal, type MotionRotateCommand, type MotionScaleCommand, type MotionScene, MotionSceneFormatError, type MotionSegment, type MotionShakeCommand, type MotionShot, type MotionShotTiming, type MotionSplitOrientation, type MotionStyleCommand, type MotionSvgOptions, type MotionTeeterCommand, type MotionTimeline, type MotionValue, type MotionWaitCommand, type MotionWaveCommand, type MotionWiggleCommand, activeSegment, applyMotionControlValues, applyMotionEdits, checkMotionScene, commandShapeProblems, compileMotionScene, createAnimationEditorToolProvider, createMotionScene, describeMotionElements, describeMotionShots, fitMotionRect, flairCurveFor, flairEaseFor, freshShotId, indexMotionNodes, interpolateMotionValue, isMotionCommand, isMotionShot, motionClipAttrs, motionCommandDuration, motionFlairPrimitive, motionFollowRoute, motionFrameAt, motionFrameToSvg, motionIssue, motionIssueKey, motionIssueLine, motionNodeClips, motionNodeOffset, motionPathLength, motionRestValue, motionRevealClip, motionRevealPadding, motionSceneShapeProblems, motionSceneToJson, motionShotAt, motionTrackKey, namedWithSuggestion, parseMotionScene, resolveMotionCamera, segmentProgress, segmentValue, shotShapeProblems, suggestName, toFlairEffectDocument, toFlairSvgMotion, toFlairVectorEffect, trackValue, withViewBox };
|
|
1547
|
+
export { ANIMATION_EDITOR_AGENT_INSTRUCTIONS, AnimationEditorController, type AnimationEditorOptions, type AnimationEditorSelection, type AnimationEditorState, type AnimationEditorToolProviderOptions, FLAIR_EASES, FLAIR_EXPORT_VERSION, type FlairEase, type FlairEaseName, type FlairEffectDocument, type FlairEffectOptions, type FlairExportOptions, type FlairImportOptions, type FlairImportResult, type FlairMotionExport, type FlairSpringEase, type FlairSvgAnimation, type FlairSvgMotion, type FlairVectorEffect, MOTION_CAMERA_MS, MOTION_COMMAND_SCHEMA, MOTION_COMMAND_TYPES, MOTION_DEFAULT_DURATIONS, MOTION_DEFAULT_HOLD, MOTION_DIRECTIONS, MOTION_DRAW_EFFECT_ID, MOTION_DRAW_MS_PER_UNIT, MOTION_DRAW_RANGE, MOTION_EASE_IN_OUT, MOTION_EASE_OUT, MOTION_EDIT_OPS, MOTION_ENTER_STYLES, MOTION_EXIT_STYLES, MOTION_IRIS_SHAPES, MOTION_ISSUE_CODES, MOTION_MIN_CHANGE_MS, MOTION_REPEAT_MODES, MOTION_SPLIT_ORIENTATIONS, type MotionCamera, type MotionClipShape, type MotionColorPulseCommand, type MotionCommand, type MotionCommandBase, type MotionCommandTiming, type MotionCommandType, type MotionControl, type MotionDirection, type MotionDrawCommand, type MotionEdit, type MotionEditOp, type MotionEditResult, type MotionEffectCommand, type MotionEnterCommand, type MotionEnterStyle, type MotionExitCommand, type MotionExitStyle, type MotionFadeCommand, type MotionFollowCommand, type MotionFrame, type MotionFrameOptions, type MotionIrisShape, type MotionIssue, type MotionIssueCode, type MotionIssueSeverity, type MotionMorphCommand, type MotionMoveCommand, type MotionNodeEntry, type MotionPreset, type MotionProperty, type MotionPulseCommand, type MotionRect, type MotionReveal, type MotionRotateCommand, type MotionScaleCommand, type MotionScene, MotionSceneFormatError, type MotionSegment, type MotionShakeCommand, type MotionShot, type MotionShotTiming, type MotionSplitOrientation, type MotionStyleCommand, type MotionSvgOptions, type MotionTeeterCommand, type MotionTimeline, type MotionValue, type MotionWaitCommand, type MotionWaveCommand, type MotionWiggleCommand, activeSegment, applyMotionControlValues, applyMotionEdits, checkMotionScene, commandShapeProblems, compileMotionScene, createAnimationEditorToolProvider, createMotionScene, describeMotionElements, describeMotionShots, fitMotionRect, flairAtLeast, flairCurveFor, flairEaseFor, freshShotId, fromFlairSvgMotion, fromFlairVectorEffect, indexMotionNodes, interpolateMotionValue, isMotionCommand, isMotionShot, motionClipAttrs, motionCommandDuration, motionCommandRepeat, motionCycleDuration, motionFlairPrimitive, motionFollowRoute, motionFrameAt, motionFrameToSvg, motionIssue, motionIssueKey, motionIssueLine, motionNodeClips, motionNodeOffset, motionPathLength, motionRestValue, motionRevealClip, motionRevealPadding, motionSceneShapeProblems, motionSceneToJson, motionShotAt, motionTrackKey, namedWithSuggestion, parseMotionScene, resolveMotionCamera, segmentProgress, segmentValue, shotShapeProblems, suggestName, toFlairEffectDocument, toFlairSvgMotion, toFlairVectorEffect, trackValue, withViewBox };
|