@pixerate/editor-react 0.93.1 → 0.95.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/README.md CHANGED
@@ -99,7 +99,7 @@ useAgentToolProvider(registry, provider);
99
99
  | `@pixerate/editor-react/image-editor` | `ImageEditor`, `useImageEditor`: crop, rotate/flip, adjustments, annotations, depth masks, Select & Mask (`SelectionOptionsBar`, `RefineEdgePanel`: magic wand, marquees, lasso, Refine Edge, layer masks), and `onInpaint` / `onRemoveBackground` AI hooks |
100
100
  | `@pixerate/editor-react/paint-editor` | `PaintEditor`, `usePaintEditor`: natural-media painting with `PaintCanvas` (pen pressure, tilt and twist, coalesced and predicted events, palm rejection, view rotation and mirroring), `PaintToolbar` (tools, symmetry, perspective, tracing and reference images, save / open, PNG / JPEG / PSD), `BrushPanel` (library with thumbnails), `PaperPanel`, `ColorPanel` (wheel, harmonies, swatches, mixing pad) and `PaintLayersPanel` |
101
101
  | `@pixerate/editor-react/commands` | `CommandPalette`, `useCommandPalette` (`hotkey: "Mod+K"`), `useCommandShortcuts`, `useRegisterCommands` over a `CommandRegistry` from `@pixerate/editor/commands` (also re-exported from the root entry) |
102
- | `@pixerate/editor-react/persistence` | `useAutosave` (crash-recovery snapshots bound to a history / dirty flag, flushed on `pagehide`, with a recovery check on mount) and `<RecoveryPrompt>` (also re-exported from the root entry) |
102
+ | `@pixerate/editor-react/persistence` | `useAutosave` (crash-recovery snapshots bound to a history / dirty flag, flushed on `pagehide`, with a recovery check on mount), `useEditorAutosave` (the same for any editor's `EditorDocument`, e.g. `useMermaidDiagram().editorDocument`; `restore` loads the snapshot into the editor) and `<RecoveryPrompt>` (also re-exported from the root entry) |
103
103
  | `@pixerate/editor-react/generation` | `GenerationSettings` (controls generated from a model's capabilities, reference slots by role, plan adjustments), `useGenerationPlan`, `JobProgress`, `useJobProgress` over `@pixerate/editor/generation` (also re-exported from the root entry) |
104
104
  | `@pixerate/editor-react/vector` | `VectorEditor` (toolbar, canvas and style panel), `VectorCanvas` (SVG canvas forwarding pointer, wheel, keyboard and clipboard events), `VectorToolbar`, `VectorStylePanel`, `VectorSceneNodes`, `VectorGradientDefs`, `useVectorEditor`, `useVectorEditorController`, `useVectorEditorState` and `useVectorCommands` over `@pixerate/editor/vector` (see [the vector editor guide](../../docs/vector-editor.md)) |
105
105
  | `@pixerate/editor-react/chart` | `ChartEditor` (toolbar, chart, inspector and data grid), `ChartCanvas` (SVG chart with selection, drag-to-edit and keyboard editing), `ChartDataGrid`, `ChartInspector`, `useChartEditor`, `useChartController`, `useChartState` and `useChartCommands` over `@pixerate/editor/chart` (see [the chart editor guide](../../docs/chart-editor.md)) |
@@ -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;