@pixerate/editor-react 0.93.1 → 0.94.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.
@@ -37,7 +37,8 @@ export interface AnimationEditorProps {
37
37
  /**
38
38
  * A whole animation editor for an `AnimationEditorController`: the stage (click an element to
39
39
  * pick it, shift-click to add it to or remove it from the selected command's targets), the
40
- * playhead scrubber, and panels to edit commands, shots and scene settings by hand. Every edit
41
- * is one undo step.
40
+ * playhead scrubber, a Record button to perform changes live on the stage and keep them as a
41
+ * shot, and panels to edit commands, shots and scene settings by hand. Every edit is one undo
42
+ * step.
42
43
  */
43
44
  export declare function AnimationEditor({ controller, values, onionSkin, motionPaths, showIssues, editable, effects, className, playback, playbackId, onPlaybackReveal }: AnimationEditorProps): React.JSX.Element;
@@ -37,7 +37,8 @@ export interface AnimationEditorProps {
37
37
  /**
38
38
  * A whole animation editor for an `AnimationEditorController`: the stage (click an element to
39
39
  * pick it, shift-click to add it to or remove it from the selected command's targets), the
40
- * playhead scrubber, and panels to edit commands, shots and scene settings by hand. Every edit
41
- * is one undo step.
40
+ * playhead scrubber, a Record button to perform changes live on the stage and keep them as a
41
+ * shot, and panels to edit commands, shots and scene settings by hand. Every edit is one undo
42
+ * step.
42
43
  */
43
44
  export declare function AnimationEditor({ controller, values, onionSkin, motionPaths, showIssues, editable, effects, className, playback, playbackId, onPlaybackReveal }: AnimationEditorProps): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { type AnimationEditorController, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
+ export interface AnimationRecordPanelProps {
4
+ controller: AnimationEditorController;
5
+ /** The element the paint and opacity controls record (e.g. the one picked on the stage). */
6
+ node?: string | null;
7
+ /** What a stage drag does while recording (pass the same to `<AnimationStage recordMode>`). */
8
+ mode: MotionRecordGestureMode;
9
+ onModeChange: (mode: MotionRecordGestureMode) => void;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Record a take: Record plays on from the end of the scene while you drag elements on the stage
14
+ * (moving, scaling or turning them, as `mode` says) and change the picked element's paint and
15
+ * opacity; Stop keeps the performance as a new shot of ordinary commands, one undo step.
16
+ */
17
+ export declare function AnimationRecordPanel({ controller, node, mode, onModeChange, className }: AnimationRecordPanelProps): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { type AnimationEditorController, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
+ export interface AnimationRecordPanelProps {
4
+ controller: AnimationEditorController;
5
+ /** The element the paint and opacity controls record (e.g. the one picked on the stage). */
6
+ node?: string | null;
7
+ /** What a stage drag does while recording (pass the same to `<AnimationStage recordMode>`). */
8
+ mode: MotionRecordGestureMode;
9
+ onModeChange: (mode: MotionRecordGestureMode) => void;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Record a take: Record plays on from the end of the scene while you drag elements on the stage
14
+ * (moving, scaling or turning them, as `mode` says) and change the picked element's paint and
15
+ * opacity; Stop keeps the performance as a new shot of ordinary commands, one undo step.
16
+ */
17
+ export declare function AnimationRecordPanel({ controller, node, mode, onModeChange, className }: AnimationRecordPanelProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin } from '@pixerate/editor/animation-editor';
2
+ import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
3
  export interface AnimationStageProps {
4
4
  controller: AnimationEditorController;
5
5
  /** Control values to preview (`{ accent: "#0ea5e9" }`). */
@@ -15,10 +15,16 @@ export interface AnimationStageProps {
15
15
  onPick?: (id: string | null, event: React.MouseEvent<HTMLDivElement>) => void;
16
16
  /** Node ids to outline (e.g. the picked element and the selected command's targets). */
17
17
  highlight?: readonly string[];
18
+ /**
19
+ * While the controller records a take (`startRecording`), what dragging an element does:
20
+ * `move` it, `scale` it about its centre or `rotate` it (default `move`). Each pointer move
21
+ * is a sample of the take.
22
+ */
23
+ recordMode?: MotionRecordGestureMode;
18
24
  className?: string;
19
25
  }
20
26
  /**
21
27
  * The animation's frame at the playhead, drawn as inline SVG scaled to the stage's width. The
22
28
  * SVG keeps the artwork's node ids, so `onPick` can say which element was clicked.
23
29
  */
24
- export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, className }: AnimationStageProps): React.JSX.Element;
30
+ export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, recordMode, className }: AnimationStageProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin } from '@pixerate/editor/animation-editor';
2
+ import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
3
  export interface AnimationStageProps {
4
4
  controller: AnimationEditorController;
5
5
  /** Control values to preview (`{ accent: "#0ea5e9" }`). */
@@ -15,10 +15,16 @@ export interface AnimationStageProps {
15
15
  onPick?: (id: string | null, event: React.MouseEvent<HTMLDivElement>) => void;
16
16
  /** Node ids to outline (e.g. the picked element and the selected command's targets). */
17
17
  highlight?: readonly string[];
18
+ /**
19
+ * While the controller records a take (`startRecording`), what dragging an element does:
20
+ * `move` it, `scale` it about its centre or `rotate` it (default `move`). Each pointer move
21
+ * is a sample of the take.
22
+ */
23
+ recordMode?: MotionRecordGestureMode;
18
24
  className?: string;
19
25
  }
20
26
  /**
21
27
  * The animation's frame at the playhead, drawn as inline SVG scaled to the stage's width. The
22
28
  * SVG keeps the artwork's node ids, so `onPick` can say which element was clicked.
23
29
  */
24
- export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, className }: AnimationStageProps): React.JSX.Element;
30
+ export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, recordMode, className }: AnimationStageProps): React.JSX.Element;